Commit 9039f591 authored by Adam Powell's avatar Adam Powell

Imported Upstream version 6.1.0.svn.5396.dfsg

parent 1199140d
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE edf>
<edf version="1.0" >
<PDE Name="DivergenceSolver" >
<Name>Divergence</Name>
<Solver>
<Parameter Widget="Edit" >
<Name > Procedure </Name>
<DefaultValue> "DivergenceSolver" "DivergenceSolver" </DefaultValue>
</Parameter>
<Parameter Widget="Edit">
<Name> Target Variable </Name>
<Whatis> The vector variable to apply the Divergence computation to. Default is Velocity. </Whatis>
</Parameter>
<Parameter Widget="CheckBox">
<Name> Constant Bulk Matrix </Name>
<Whatis> Reuse the same bulk matrix when returning to the same solver. </Whatis>
</Parameter>
</Solver>
</PDE>
</edf>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE edf>
<edf version="1.0" >
<PDE Name="FluxSolver" >
<Name>Flux and Gradient</Name>
<Solver>
<Parameter Widget="Edit" >
<Name > Procedure </Name>
<DefaultValue> "FluxSolver" "FluxSolver" </DefaultValue>
</Parameter>
<Parameter Widget="Edit">
<Name> Target Variable </Name>
<Whatis> The scalar variable to apply the flux computation to. Default is Temperature. </Whatis>
</Parameter>
<Parameter Widget="Edit">
<Name> Flux Coefficient </Name>
<Whatis> The name of the material parameter used to multiply the gradient in flux computation. Default is Heat Conductivity. </Whatis>
</Parameter>
<Parameter Widget="CheckBox">
<Name> Calculate Grad </Name>
<Whatis> Calculate the gradient of the scalar field. </Whatis>
</Parameter>
<Parameter Widget="CheckBox">
<Name> Calculate Grad Magnitude </Name>
<Whatis> Calculate the magnitude of the gradient of the scalar field. </Whatis>
</Parameter>
<Parameter Widget="CheckBox">
<Name> Calculate Flux </Name>
<Whatis> Calculate the flux of the scalar field. </Whatis>
</Parameter>
<Parameter Widget="CheckBox">
<Name> Calculate Flux Magnitude </Name>
<Whatis> Calculate the magnitude of the flux of the scalar field. </Whatis>
</Parameter>
<Parameter Widget="CheckBox">
<Name> Enforce Positive Magnitude </Name>
<Whatis> In magnitude computation use an dirty a posteriori fix to get rid of negative magnitude values. </Whatis>
</Parameter>
</Solver>
</PDE>
</edf>
This diff is collapsed.
......@@ -29,9 +29,21 @@
<Parameter Widget="Edit" >
<Name> Surface Velocity 3 </Name>
</Parameter>
</Equation>
<Parameter Widget="Label">
<Name> Free text input </Name>
</Parameter>
<Parameter Widget="TextEdit" Enabled="True">
<Name> Free text </Name>
<Type> String </Type>
<Whatis> Free text is copied into the Equation-block of the SIF as such. </Whatis>
<StatusTip> Free text is copied into the Equation-block of the SIF as such. </StatusTip>
</Parameter>
</Equation>
<Solver>
<Parameter Widget="Edit" >
<Name > Procedure </Name>
......@@ -42,21 +54,24 @@
<DefaultValue> FilmPressure </DefaultValue>
</Parameter>
<Parameter Widget="Label"> <Name>Additional definitions for cavitation</Name> </Parameter>
<Parameter Widget="Edit">
<Name> Cavitation Pressure </Name>
<Activate> /Reynolds Equation/Solver/Exported Variable 1</Activate>
<Activate> /Reynolds Equation/Solver/Exported Variable 2</Activate>
</Parameter>
<Parameter Widget="Edit" Enabled="False" Visible="False">
<Name> Exported Variable 1 </Name>
<DefaultValue> FilmPressure Loads </DefaultValue>
</Parameter>
<Parameter Widget="Edit" Enabled="False" Visible="False">
<Name> Exported Variable 2 </Name>
<DefaultValue> FilmPressure Cavitation</DefaultValue>
</Parameter>
<Parameter Widget="Label"> <Name>Definitions for cavitation</Name> </Parameter>
<Parameter Widget="CheckBox">
<Name> Apply Limiter </Name>
<Whatis> If checked the pressure may be given a soft limit as in cavitation. </Whatis>
<StatusTip> If checked the pressure may be given a soft limit as in cavitation. </StatusTip>
<Activate> /Reynolds Equation/BodyForce/Filmpressure Lower Limit</Activate>
</Parameter>
<Parameter Widget="Label">
<Name> Free text input </Name>
</Parameter>
<Parameter Widget="TextEdit" Enabled="True">
<Name> Free text </Name>
<Type> String </Type>
<Whatis> Free text is copied into the Solver-block of the SIF as such. </Whatis>
<StatusTip> Free text is copied into the Solver-block of the SIF as such. </StatusTip>
</Parameter>
</Solver>
<InitialCondition>
......@@ -64,9 +79,6 @@
<Parameter Widget="Edit">
<Name> FilmPressure </Name>
</Parameter>
<Parameter Widget="Edit">
<Name> FilmPressure Condition </Name>
</Parameter>
</InitialCondition>
<BodyForce>
......@@ -78,8 +90,25 @@
<Parameter Widget="Edit" Enabled="False">
<Name> FilmPressure Condition </Name>
<DefaultValue> Variable "FilmPressure Cavitation"; Real MATC "tx" </DefaultValue>
</Parameter>
<Parameter Widget="Edit" Enabled="False">
<Name> Filmpressure Lower Limit </Name>
<Whatis> Soft limit for pressure that may be used to model cavitation</Whatis>
<StatusTip> Soft limit for pressure that may be used to model cavitation</StatusTip>
</Parameter>
<Parameter Widget="Label">
<Name> Free text input </Name>
</Parameter>
<Parameter Widget="TextEdit" Enabled="True">
<Name> Free text </Name>
<Type> String </Type>
<Whatis> Free text is copied into the Body Force-block of the SIF as such. </Whatis>
<StatusTip> Free text is copied into the Body Force-block of the SIF as such. </StatusTip>
</Parameter>
</BodyForce>
<Material>
......@@ -146,6 +175,16 @@
<Name> Bulk Modulus </Name>
</Parameter>
<Parameter Widget="Label">
<Name> Free text input </Name>
</Parameter>
<Parameter Widget="TextEdit" Enabled="True">
<Name> Free text </Name>
<Type> String </Type>
<Whatis> Free text is copied into the Material-block of the SIF as such. </Whatis>
<StatusTip> Free text is copied into the Material-block of the SIF as such. </StatusTip>
</Parameter>
</Material>
......@@ -155,6 +194,19 @@
<Parameter Widget="Edit">
<Name> FilmPressure </Name>
</Parameter>
<Parameter Widget="Label">
<Name> Free text input </Name>
</Parameter>
<Parameter Widget="TextEdit" Enabled="True">
<Name> Free text </Name>
<Type> String </Type>
<Whatis> Free text is copied into the Initial Condition-block of the SIF as such. </Whatis>
<StatusTip> Free text is copied into the Initial Condition-block of the SIF as such. </StatusTip>
</Parameter>
</InitialCondition>
<BoundaryCondition>
......@@ -175,6 +227,24 @@
<Name> Open Side </Name>
<Whatis> If checked use effective elongation model for the side. </Whatis>
</Parameter>
<Parameter Widget="Label"> <Name> Periodic boundary condition </Name> </Parameter>
<Parameter Widget="CheckBox">
<Name> Filmpressure periodic </Name>
<SifName> Periodic BC Filmpressure </SifName>
</Parameter>
<Parameter Widget="Label">
<Name> Free text input </Name>
</Parameter>
<Parameter Widget="TextEdit" Enabled="True">
<Name> Free text </Name>
<Type> String </Type>
<Whatis> Free text is copied into the Boundary Condition-block of the SIF as such. </Whatis>
<StatusTip> Free text is copied into the Boundary Condition-block of the SIF as such. </StatusTip>
</Parameter>
</BoundaryCondition>
</PDE>
</edf>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE edf>
<edf version="1.0" >
<PDE Name="VorticitySolver" >
<Name>Vorticity</Name>
<Solver>
<Parameter Widget="Edit" >
<Name > Procedure </Name>
<DefaultValue> "VorticitySolver" "VorticitySolver" </DefaultValue>
</Parameter>
<Parameter Widget="Edit">
<Name> Target Variable </Name>
<Whatis> The vector variable to apply the vorticity computation to. Default is Velocity. </Whatis>
</Parameter>
<Parameter Widget="Edit">
<Name> Vorticity Coefficient </Name>
<Whatis> The name of the material parameter used to multiply the gradient in vorticity computation. </Whatis>
</Parameter>
<Parameter Widget="CheckBox">
<Name> Constant Bulk Matrix </Name>
<Whatis> Reuse the same bulk matrix when returning to the same solver. </Whatis>
</Parameter>
</Solver>
</PDE>
</edf>
***** ElmerGrid input file for structured grid generation *****
Version = 210903
Coordinate System = 2D Cartesian
Subcell Divisions in 2D = 1 1
Subcell Limits 1 = 0 0.62831853
Subcell Limits 2 = 0 0.1
Material Structure in 2D
1
End
Materials Interval = 1 1
Boundary Definitions
! type out int double of the boundaries
1 -1 1 1
2 -3 1 1
3 -4 1 1
4 -2 1 1
End
Element Degree = 1
Element Innernodes = False
Triangles = False
Element Ratios 1 = 1
Element Ratios 2 = 1
Element Divisions 1 = 120
Element Divisions 2 = 20
\ No newline at end of file
# demo - .in2d file
# geometry consists of two squares,
# the inner square is made of iron, the outer is not specified (default)
# boundary condition 1 on the outside, 2 on the interface between inner and outer square
# new .in2d geomety files ...
# start with keyword splinecurves2dv2
splinecurves2dv2
# next the refinement factor
20
points
1 0 0 -ref=3
2 2.3 0 -ref=10
3 2.7 0 -ref=10
4 5.0 0 -ref=1
5 10.0 0 -ref=1
6 10.0 2.0
7 5.0 2.0 -ref=1
8 2.5 2.0 -ref=5
9 0.0 2.0 -ref=3
10 2.3 1.0 -ref=10
11 2.3 1.2 -ref=10
12 2.5 1.2 -ref=10
13 2.7 1.2 -ref=10
14 2.7 1.0 -ref=10
segments
1 0 2 1 2 -bc=1
1 2 2 2 10 -bc=2
1 2 3 10 11 12 -bc=2
1 2 3 12 13 14 -bc=3
1 2 2 14 3 -bc=3
1 0 2 3 4 -bc=4
1 0 2 4 5 -bc=4
1 0 2 5 6 -bc=5
1 0 2 6 7 -bc=6
1 0 2 7 8 -bc=6
1 0 2 8 9 -bc=6
1 0 2 9 1 -bc=7
2 0 2 2 3 -bc=8
#
# a large ball with four circular holes
#
algebraic3d
solid smallballs = sphere (-0.4, -0.3, -0.2; 0.26)
or sphere (0.4, -0.3, -0.2; 0.18)
or sphere (0.0, 0.5, -0.2; 0.17)
or sphere (0.0, 0.0, 0.4; 0.23);
solid bigball = sphere (0.0, 0.0, 0.0; 1.0);
solid rest = bigball and not smallballs;
# two sub-domains
tlo smallballs -col=[1,0,0];
tlo rest -col=[0,0,1] -transparent;
......@@ -531,6 +531,7 @@ int LoadElmerInput(struct FemType *data,struct BoundaryType *bound,
sscanf(line,"%d",&dummyint);
if(dummyint > maxelemtype) maxelemtype = dummyint;
}
printf("Maximum elementtype index is: %d\n",maxelemtype);
fclose(in);
data->dim = GetElementDimension(maxelemtype);
......
This diff is collapsed.
......@@ -23,10 +23,6 @@
!
!/******************************************************************************
! *
! * Adaptive meshing routines.
! *
! ******************************************************************************
! *
! * Authors: Juha Ruokolainen, Mikko Lyly
! * Email: Juha.Ruokolainen@csc.fi, Mikko.Lyly@csc.fi
! * Web: http://www.csc.fi/elmer
......@@ -38,7 +34,14 @@
! *
! *****************************************************************************/
!> \ingroup ElmerLib
!> \{
!--------------------------------------------------------------------------------------------------------
!> Module for adaptive meshing routines. The adaptivity is based on solver-specific error indicators that
!> are used to create a field with the desired mesh density. This may be used by some mesh generators to
!> create a more optimal mesh.
!--------------------------------------------------------------------------------------------------------
MODULE Adaptive
USE GeneralUtils
......@@ -515,7 +518,7 @@ CONTAINS
IF ( ASSOCIATED( NewVar % Perm ) ) THEN
k = COUNT( NewVar % Perm > 0 )
END IF
IF ( NewVar % Name == 'flow solution' ) THEN
IF ( GetVarName( NewVar ) == 'flow solution' ) THEN
NewVar % Norm = 0.0d0
DO i=1,NewMesh % NumberOfNodes
DO j=1,NewVar % DOFs-1
......@@ -2044,3 +2047,5 @@ use crsmatrix
!------------------------------------------------------------------------------
END MODULE Adaptive
!-----------------------------------------------------------------------------
!> \}
This diff is collapsed.
......@@ -23,10 +23,6 @@
!
!******************************************************************************
! *
! * Advection-reaction equation solver
! *
! *****************************************************************************
! *
! * Authors: Mikko, Lyly, Juha Ruokolainen, Thomas Zwinger
! * Email: Juha.Ruokolainen@csc.fi
! * Web: http://www.csc.fi/elmer
......@@ -39,35 +35,19 @@
! ****************************************************************************
!------------------------------------------------------------------------------
RECURSIVE SUBROUTINE AdvectionReactionSolver( Model,Solver,dt,Transient )
!> Advection-reaction equation solver for scalar fields with discontinous Galerkin method.
!> \ingroup Solvers
!------------------------------------------------------------------------------
SUBROUTINE AdvectionReactionSolver( Model,Solver,dt,Transient )
!------------------------------------------------------------------------------
!******************************************************************************
!
! Solves the advection-reaction equation with discontinous Galerkin method!
!
! ARGUMENTS:
!
! TYPE(Model_t) :: Model,
! INPUT: All model information (mesh, materials, BCs, etc...)
!
! TYPE(Solver_t) :: Solver
! INPUT: Linear equation solver options
!
! DOUBLE PRECISION :: dt,
! INPUT: Timestep size for time dependent simulations
!
! LOGICAL :: Transient
! INPUT: Steady state or transient simulation
!
!******************************************************************************
USE DefUtils
IMPLICIT NONE
!------------------------------------------------------------------------------
TYPE(Model_t) :: Model
TYPE(Solver_t), TARGET :: Solver
REAL(KIND=dp) :: dt
LOGICAL :: Transient
TYPE(Model_t) :: Model !< All model information (mesh, materials, BCs, etc...)
TYPE(Solver_t), TARGET :: Solver !< Linear & nonlinear equation solver options
REAL(KIND=dp) :: dt !< Timestep size for time dependent simulations
LOGICAL :: Transient !< Steady state or transient simulation
!------------------------------------------------------------------------------
! Local variables
!------------------------------------------------------------------------------
......@@ -83,7 +63,7 @@
CorrectedLowerLimit,CorrectedUpperLimit
INTEGER :: n1,n2, k, n, t, istat, i, j, dummyInt, NumberOfFAces, Indexes(128)
REAL(KIND=dp) :: Norm,RelativeChange,at,at0,totat,st,totst,CPUTime,RealTime,&
LinearTol,NonlinearTol,OriginalValue
OriginalValue
REAL(KIND=dp), ALLOCATABLE :: MASS(:,:), STIFF(:,:), LOAD(:), &
FORCE(:), Velo(:,:), MeshVelo(:,:), Gamma(:), Ref(:), &
UpperLimit(:), LowerLimit(:)
......@@ -141,17 +121,14 @@
Constants => GetConstants()
SolverParams => GetSolverParams()
LinearTol = GetConstReal( SolverParams, &
'Linear System Convergence Tolerance', Found )
IF ( .NOT.Found ) THEN
CALL FATAL(SolverName, 'No >Linear System Convergence Tolerance< found')
END IF
NonlinearIterMax = GetInteger( SolverParams, &
'Nonlinear System Max Iterations', Found )
IF ( .NOT.Found ) THEN
CALL WARN(SolverName,'No >Nonlinear System Max Iterations< found. Setting 1')
CALL WARN(SolverName,'No > Nonlinear System Max Iterations < found. Setting 1')
NonlinearIterMax = 1
END IF
......@@ -168,25 +145,19 @@
NonlinearIterMin = NonlinearIterMax
END IF
NonlinearTol = GetConstReal( SolverParams, &
'Nonlinear System Convergence Tolerance', Found )
ExpVariableName = GetString(SolverParams , 'Exported Variable 1', Found )
IF (.NOT.Found) &
CALL FATAL(SolverName,'No value >Exported Variable 1< found in Solver')
CALL FATAL(SolverName,'No value > Exported Variable 1 < found in Solver')
LimitSolution = GetLogical( SolverParams, &
'Limit Solution', Found )
'Limit Solution', Found )
IF ( .NOT.Found ) &
LimitSolution = .FALSE.
IF (LimitSolution) THEN
CALL INFO(SolverName, 'Keyword >Limit Solution< found. Solution will be limited',Level=1)
CALL INFO(SolverName, 'Keyword > Limit Solution < found. Solution will be limited',Level=1)
ELSE
CALL INFO(SolverName, 'No keyword >Limit Solution< found. Solution will not be limited',Level=1)
CALL INFO(SolverName, 'No keyword > Limit Solution < found. Solution will not be limited',Level=1)
END IF
!------------------------------------------------------------------------------
......@@ -368,7 +339,7 @@
RelativeChange = Solver % Variable % NonlinChange
IF (RelativeChange < NonlinearTol) THEN
IF ( Solver % Variable % NonlinConverged == 1 ) THEN
WRITE(Message,'(A,I6,A,I6,A)') &
'Nonlinear iteration converged after ', iter, &
' out of max ',NonlinearIterMax,' iterations'
......@@ -421,7 +392,6 @@
! Average the elemental results to nodal values:
!-----------------------------------------------
! Var => VariableGet( Mesh % Variables, TRIM(VariableName) // ' Nodal Result' )
Var => VariableGet( Mesh % Variables,TRIM(ExpVariableName))
IF ( ASSOCIATED( Var ) ) THEN
n1 = Mesh % NumberOfNodes
......
......@@ -39,25 +39,13 @@
! *
! *****************************************************************************/
!------------------------------------------------------------------------------
!> Solve for the 1D characteristics equation arising from newtonian flow in an
!> elastic tube. The subroutine may be used as the outlet for blood flow simulation.
!> \ingroup Solvers
!------------------------------------------------------------------------------
SUBROUTINE OutletCompute( Model,Solver,dt,TransientSimulation )
!------------------------------------------------------------------------------
!******************************************************************************
!
! TYPE(Model_t) :: Model,
! INPUT: All model information (mesh, materials, BCs, etc...)
!
! TYPE(Solver_t) :: Solver
! INPUT: Linear equation solver options
!
! REAL(KIND=dp) :: dt
! INPUT: Timestep size for time dependent simulations
! and time
!
! LOGICAL :: TransientSimulation
! INPUT: Steady state or transient simulation
!
!******************************************************************************
USE Types
USE Lists
USE Integration
......@@ -1078,9 +1066,9 @@ END SUBROUTINE OutletCompute
!------------------------------------------------------------------------------
! Compute the initial guess for the characteristics variable
!> Compute the initial guess for the characteristics variable
!> \ingroup UDF
!------------------------------------------------------------------------------
FUNCTION OutletInit( Model,n,t ) RESULT( Winit )
USE Types
......@@ -1113,9 +1101,9 @@ END FUNCTION OutletInit
!------------------------------------------------------------------------------
! Return the change in the radius x-component computed by the 1D model
!> Return the change in the radius x-component computed by the 1D model
!> \ingroup UDF
!------------------------------------------------------------------------------
FUNCTION OutletdX( Model,n,t ) RESULT(dx)
USE Types
......@@ -1191,17 +1179,14 @@ IF( y0 <= 0 ) THEN
END IF
!----!----!----!----!----!----!----!----!----!----!----!
IF ( CurrentCoordinateSystem() /= Cartesian ) dx = dRout
!----!----!----!----!----!----!----!----!----!----!----!
END FUNCTION OutletdX
!------------------------------------------------------------------------------
! Return the change in the radius y-component computed by the 1D model
!> Return the change in the radius y-component computed by the 1D model
!> \ingroup UDF
!------------------------------------------------------------------------------
FUNCTION OutletdY( Model,n,t ) RESULT(dy)
USE Types
......@@ -1243,7 +1228,6 @@ FUNCTION OutletdY( Model,n,t ) RESULT(dy)
dRout = ListGetConstReal( Model % Simulation, 'res: dRout', GotIt)
IF(.NOT. GotIt) THEN
bc = Model % CurrentElement % BoundaryInfo % Constraint
bc2 = ListGetInteger( Model % BCs(bc) % Values,'Structure Coupling With Boundary', GotIt)
......@@ -1258,7 +1242,6 @@ FUNCTION OutletdY( Model,n,t ) RESULT(dy)
!------------------------------------------------------------------------------
x = Model % Nodes % x(n)
y = Model % Nodes % y(n)
z = Model % Nodes % z(n)
......@@ -1277,22 +1260,18 @@ IF( y0 <= 0 ) THEN
dy = -dy
END IF
!----!----!----!----!----!----!----!----!----!----!----!
IF ( CurrentCoordinateSystem() /= Cartesian ) dy = dRout
!----!----!----!----!----!----!----!----!----!----!----!
END FUNCTION OutletdY
!------------------------------------------------------------------------------
! Return the pressure computed by the characteristics model
!> Return the pressure computed by the characteristics model.
!> \ingroup UDF
!------------------------------------------------------------------------------
FUNCTION OutletPres( Model,n,t ) RESULT(pout)
USE Types
......
......@@ -40,34 +40,20 @@
! *
! ******************************************************************************
!------------------------------------------------------------------------------
!> Subroutine that may be used to normalize the amplitude of artificial compressibility for
!> optimal fluid-structure coupling.
!> \ingroup Solvers
!------------------------------------------------------------------------------
SUBROUTINE CompressibilityScale( Model,Solver,dt,TransientSimulation )