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 @@ ...@@ -29,9 +29,21 @@
<Parameter Widget="Edit" > <Parameter Widget="Edit" >
<Name> Surface Velocity 3 </Name> <Name> Surface Velocity 3 </Name>
</Parameter> </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> <Solver>
<Parameter Widget="Edit" > <Parameter Widget="Edit" >
<Name > Procedure </Name> <Name > Procedure </Name>
...@@ -42,21 +54,24 @@ ...@@ -42,21 +54,24 @@
<DefaultValue> FilmPressure </DefaultValue> <DefaultValue> FilmPressure </DefaultValue>
</Parameter> </Parameter>
<Parameter Widget="Label"> <Name>Additional definitions for cavitation</Name> </Parameter> <Parameter Widget="Label"> <Name>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="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> </Solver>
<InitialCondition> <InitialCondition>
...@@ -64,9 +79,6 @@ ...@@ -64,9 +79,6 @@
<Parameter Widget="Edit"> <Parameter Widget="Edit">
<Name> FilmPressure </Name> <Name> FilmPressure </Name>
</Parameter> </Parameter>
<Parameter Widget="Edit">
<Name> FilmPressure Condition </Name>
</Parameter>
</InitialCondition> </InitialCondition>
<BodyForce> <BodyForce>
...@@ -78,8 +90,25 @@ ...@@ -78,8 +90,25 @@
<Parameter Widget="Edit" Enabled="False"> <Parameter Widget="Edit" Enabled="False">
<Name> FilmPressure Condition </Name> <Name> FilmPressure Condition </Name>
<DefaultValue> Variable "FilmPressure Cavitation"; Real MATC "tx" </DefaultValue>
</Parameter> </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> </BodyForce>
<Material> <Material>
...@@ -146,6 +175,16 @@ ...@@ -146,6 +175,16 @@
<Name> Bulk Modulus </Name> <Name> Bulk Modulus </Name>
</Parameter> </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> </Material>
...@@ -155,6 +194,19 @@ ...@@ -155,6 +194,19 @@
<Parameter Widget="Edit"> <Parameter Widget="Edit">
<Name> FilmPressure </Name> <Name> FilmPressure </Name>
</Parameter> </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> </InitialCondition>
<BoundaryCondition> <BoundaryCondition>
...@@ -175,6 +227,24 @@ ...@@ -175,6 +227,24 @@
<Name> Open Side </Name> <Name> Open Side </Name>
<Whatis> If checked use effective elongation model for the side. </Whatis> <Whatis> If checked use effective elongation model for the side. </Whatis>
</Parameter> </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> </BoundaryCondition>
</PDE> </PDE>
</edf> </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, ...@@ -531,6 +531,7 @@ int LoadElmerInput(struct FemType *data,struct BoundaryType *bound,
sscanf(line,"%d",&dummyint); sscanf(line,"%d",&dummyint);
if(dummyint > maxelemtype) maxelemtype = dummyint; if(dummyint > maxelemtype) maxelemtype = dummyint;
} }
printf("Maximum elementtype index is: %d\n",maxelemtype);
fclose(in); fclose(in);
data->dim = GetElementDimension(maxelemtype); data->dim = GetElementDimension(maxelemtype);
......
This diff is collapsed.
...@@ -23,10 +23,6 @@ ...@@ -23,10 +23,6 @@
! !
!/****************************************************************************** !/******************************************************************************
! * ! *
! * Adaptive meshing routines.
! *
! ******************************************************************************
! *
! * Authors: Juha Ruokolainen, Mikko Lyly ! * Authors: Juha Ruokolainen, Mikko Lyly
! * Email: Juha.Ruokolainen@csc.fi, Mikko.Lyly@csc.fi ! * Email: Juha.Ruokolainen@csc.fi, Mikko.Lyly@csc.fi
! * Web: http://www.csc.fi/elmer ! * Web: http://www.csc.fi/elmer
...@@ -38,7 +34,14 @@ ...@@ -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 MODULE Adaptive
USE GeneralUtils USE GeneralUtils
...@@ -515,7 +518,7 @@ CONTAINS ...@@ -515,7 +518,7 @@ CONTAINS
IF ( ASSOCIATED( NewVar % Perm ) ) THEN IF ( ASSOCIATED( NewVar % Perm ) ) THEN
k = COUNT( NewVar % Perm > 0 ) k = COUNT( NewVar % Perm > 0 )
END IF END IF
IF ( NewVar % Name == 'flow solution' ) THEN IF ( GetVarName( NewVar ) == 'flow solution' ) THEN
NewVar % Norm = 0.0d0 NewVar % Norm = 0.0d0
DO i=1,NewMesh % NumberOfNodes DO i=1,NewMesh % NumberOfNodes
DO j=1,NewVar % DOFs-1 DO j=1,NewVar % DOFs-1
...@@ -2044,3 +2047,5 @@ use crsmatrix ...@@ -2044,3 +2047,5 @@ use crsmatrix
!------------------------------------------------------------------------------ !------------------------------------------------------------------------------
END MODULE Adaptive END MODULE Adaptive
!----------------------------------------------------------------------------- !-----------------------------------------------------------------------------
!> \}
This diff is collapsed.
...@@ -23,10 +23,6 @@ ...@@ -23,10 +23,6 @@
! !
!****************************************************************************** !******************************************************************************
! * ! *
! * Advection-reaction equation solver
! *
! *****************************************************************************
! *
! * Authors: Mikko, Lyly, Juha Ruokolainen, Thomas Zwinger ! * Authors: Mikko, Lyly, Juha Ruokolainen, Thomas Zwinger
! * Email: Juha.Ruokolainen@csc.fi ! * Email: Juha.Ruokolainen@csc.fi
! * Web: http://www.csc.fi/elmer ! * Web: http://www.csc.fi/elmer
...@@ -39,35 +35,19 @@ ...@@ -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 USE DefUtils
IMPLICIT NONE IMPLICIT NONE
!------------------------------------------------------------------------------ !------------------------------------------------------------------------------
TYPE(Model_t) :: Model TYPE(Model_t) :: Model !< All model information (mesh, materials, BCs, etc...)
TYPE(Solver_t), TARGET :: Solver TYPE(Solver_t), TARGET :: Solver !< Linear & nonlinear equation solver options
REAL(KIND=dp) :: dt REAL(KIND=dp) :: dt !< Timestep size for time dependent simulations
LOGICAL :: Transient LOGICAL :: Transient !< Steady state or transient simulation
!------------------------------------------------------------------------------ !------------------------------------------------------------------------------
! Local variables ! Local variables
!------------------------------------------------------------------------------ !------------------------------------------------------------------------------
...@@ -83,7 +63,7 @@ ...@@ -83,7 +63,7 @@
CorrectedLowerLimit,CorrectedUpperLimit CorrectedLowerLimit,CorrectedUpperLimit
INTEGER :: n1,n2, k, n, t, istat, i, j, dummyInt, NumberOfFAces, Indexes(128) 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,& REAL(KIND=dp) :: Norm,RelativeChange,at,at0,totat,st,totst,CPUTime,RealTime,&
LinearTol,NonlinearTol,OriginalValue OriginalValue
REAL(KIND=dp), ALLOCATABLE :: MASS(:,:), STIFF(:,:), LOAD(:), & REAL(KIND=dp), ALLOCATABLE :: MASS(:,:), STIFF(:,:), LOAD(:), &
FORCE(:), Velo(:,:), MeshVelo(:,:), Gamma(:), Ref(:), & FORCE(:), Velo(:,:), MeshVelo(:,:), Gamma(:), Ref(:), &
UpperLimit(:), LowerLimit(:) UpperLimit(:), LowerLimit(:)
...@@ -141,17 +121,14 @@ ...@@ -141,17 +121,14 @@
Constants => GetConstants() Constants => GetConstants()
SolverParams => GetSolverParams() SolverParams => GetSolverParams()
LinearTol = GetConstReal( SolverParams, &
'Linear System Convergence Tolerance', Found )
IF ( .NOT.Found ) THEN IF ( .NOT.Found ) THEN
CALL FATAL(SolverName, 'No >Linear System Convergence Tolerance< found') CALL FATAL(SolverName, 'No >Linear System Convergence Tolerance< found')
END IF END IF
NonlinearIterMax = GetInteger( SolverParams, & NonlinearIterMax = GetInteger( SolverParams, &
'Nonlinear System Max Iterations', Found ) 'Nonlinear System Max Iterations', Found )
IF ( .NOT.Found ) THEN 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 NonlinearIterMax = 1
END IF END IF
...@@ -168,25 +145,19 @@ ...@@ -168,25 +145,19 @@
NonlinearIterMin = NonlinearIterMax NonlinearIterMin = NonlinearIterMax
END IF END IF
NonlinearTol = GetConstReal( SolverParams, &
'Nonlinear System Convergence Tolerance', Found )
ExpVariableName = GetString(SolverParams , 'Exported Variable 1', Found ) ExpVariableName = GetString(SolverParams , 'Exported Variable 1', Found )
IF (.NOT.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, & LimitSolution = GetLogical( SolverParams, &
'Limit Solution', Found ) 'Limit Solution', Found )
IF ( .NOT.Found ) & IF ( .NOT.Found ) &
LimitSolution = .FALSE. LimitSolution = .FALSE.
IF (LimitSolution) THEN 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 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 END IF
!------------------------------------------------------------------------------ !------------------------------------------------------------------------------
...@@ -368,7 +339,7 @@ ...@@ -368,7 +339,7 @@
RelativeChange = Solver % Variable % NonlinChange RelativeChange = Solver % Variable % NonlinChange
IF (RelativeChange < NonlinearTol) THEN IF ( Solver % Variable % NonlinConverged == 1 ) THEN
WRITE(Message,'(A,I6,A,I6,A)') & WRITE(Message,'(A,I6,A,I6,A)') &
'Nonlinear iteration converged after ', iter, & 'Nonlinear iteration converged after ', iter, &
' out of max ',NonlinearIterMax,' iterations' ' out of max ',NonlinearIterMax,' iterations'
...@@ -421,7 +392,6 @@ ...@@ -421,7 +392,6 @@
! Average the elemental results to nodal values: ! Average the elemental results to nodal values:
!----------------------------------------------- !-----------------------------------------------
! Var => VariableGet( Mesh % Variables, TRIM(VariableName) // ' Nodal Result' )
Var => VariableGet( Mesh % Variables,TRIM(ExpVariableName)) Var => VariableGet( Mesh % Variables,TRIM(ExpVariableName))
IF ( ASSOCIATED( Var ) ) THEN IF ( ASSOCIATED( Var ) ) THEN
n1 = Mesh % NumberOfNodes n1 = Mesh % NumberOfNodes
......
...@@ -39,25 +39,13 @@ ...@@ -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 ) SUBROUTINE OutletCompute( Model,Solver,dt,TransientSimulation )
!------------------------------------------------------------------------------ !------------------------------------------------------------------------------
!******************************************************************************