-
Notifications
You must be signed in to change notification settings - Fork 59
Understanding the Parameter file (.prm)
The documentation for the parameter files is currently under migration to the new Lethe documentation
- Boundary conditions - Multiphysics
- Non-Linear Solver Control
- Linear Solver Control
- Dynamic flow control
- Interface Sharpening
This subsection's purpose is defining the boundary conditions associated to multiphysic problems.
subsection boundary conditions heat transfer
set number = 2
subsection bc 0
set type = temperature
set value = 0
end
subsection bc 1
set type = convection
set h = 10
set Tinf = -13
end
end
-
number
: This is the number of boundary conditions of the problem. -
type
: This is the type of boundary condition been imposed. At the moment, choices are-
temperature
(Dirichlet BC), to impose a given temperaturevalue
at the boundary -
convection
(Robin BC) for cooling/heating, depending on the environment temperature at the boundaryTinf
, with a given heat transfer coefficienth
-
-
NB : by default, the boundary condition type is
temperature
withvalue = 0
subsection boundary conditions tracer
set number = 1
subsection bc 0
set type = dirichlet
subsection dirichlet
set Function expression = x
end
end
end
-
number
: This is the number of boundary conditions of the problem. -
type
: This is the type of boundary condition been imposed. At the moment, only dirichlet boundary conditions can be imposed for tracer.
The Navier-Stokes equations (and other) are non-linear equation. This section controls the non-linear solver used within lethe.
subsection non-linear solver
# Maximum number of Newton Iterations
set max iterations = 10
# Non-linear solver that will be used. Choices is newton.
set solver = newton
# Newton solver tolerance
set tolerance = 1e-6
# Tolerance for the acceptation of the step
set step tolerance = 0.9
# State whether from the non-linear solver should be printed Choices are
# .
set verbosity = verbose
end
- Lethe currently has one
solver
for non-linear equations. Thenewton
solver is a Newton-Raphson solver which recalculates the jacobian matrix at every iteration. - The
verbosity
options enables the display of the residual at each non-linear iteration. This allow ones to monitor how the non-linear iterations are progressing. - The
step tolerance
option controls how much the L2 norm of the residual must decrease for a non-linear step to be accepted. If the new_residual < old_residual * step tolerance, than a newton iteration is accepted. If this condition is not reached, then a theta weighting of the step is applied until this condition is reached.
In these subsections, the control options of linear solvers are specified. These control options may include solution method, maximum number of iterations, tolerance, residual precision and preconditioner information.
Lethe currently supports three core solution strategy or method
:
- GMRES solver + ILU preconditioning. This is set by
method = gmres
- GMRES solver + AMG preconditioning. This is set by
method = amg
- BiCGStab solver + ILU preconditioning. This is set by
method = bicgstab
For all methods, a number of parameters to control the preconditioner can be set.
On coarse meshes, the gmres/bicgstab solver with ILU preconditioning is more efficient. As the number of mesh elements increase, the amg solver is the most efficient. Generally, at 1M elements, the amg solver always outperforms the gmres or bicgstab for 2D steady-state problems.
subsection linear solver
# amg aggregation threshold
set amg aggregation threshold = 1e-14
# amg number of cycles
set amg n cycles = 1
# amg preconditioner ilu smoother/coarsener absolute tolerance
set amg preconditioner ilu absolute tolerance = 1e-12
# amg preconditioner ilu smoother/coarsener fill
set amg preconditioner ilu fill = 1
# amg preconditioner ilu smoother/coarsener relative tolerance
set amg preconditioner ilu relative tolerance = 1.00
# amg smoother overlap
set amg smoother overlap = 1
# amg smoother sweeps
set amg smoother sweeps = 2
# amg w cycling. If this is set to true, W cycling is used. Otherwise, V
# cycling is used.
set amg w cycles = false
# Ilu preconditioner tolerance
set ilu preconditioner absolute tolerance = 1e-6
# Ilu preconditioner fill
set ilu preconditioner fill = 1
# Ilu relative tolerance
set ilu preconditioner relative tolerance = 1.00
# Maximum solver iterations
set max iters = 1000
# Maximum number of krylov vectors for GMRES solver
set max krylov vectors = 30
# The iterative solver for the linear system of equations. Choices are
# . gmres is a GMRES iterative solver with ILU
# preconditioning. bicgstab is a BICGSTAB iterative solver with ILU
# preconditioning. amg is GMRES + AMG preconditioning with an ILU coarsener
# and smoother. On coarse meshes, the gmres/bicgstab solver with ILU
# preconditioning is more efficient. As the number of mesh elements
# increase, the amg solver is the most efficient. Generally, at 1M elements,
# the amg solver always outperforms the gmres or bicgstab
set method = gmres
# Linear solver minimum residual
set minimum residual = 1e-8
# Linear solver residual
set relative residual = 1e-3
# State whether output from solver runs should be printed. Choices are
# .
set verbosity = verbose
end
This subsection's purpose is to enable a dynamic flow control. When a periodic boundary condition is set, the flow must be controlled at inlet. It calculates a Beta coefficient at each time step and may be added to a source term. If the chosen wall boundary to force the flow is at inlet, the volumetric flow rate targeted must be negative since outward normal vector is used. Therefore, if the chosen wall boundary is at outlet, volumetric flow rate must be positive.
subsection flow control
# Enable the dynamic flow control
set enable = true
# Volumetric flow rate targeted (negative if at inlet)
set volumetric flow rate = -91.75
# Wall boundary where the flow is adjusted
set boundary id = 0
# Flow direction
set flow direction = 0
# Initial Beta coefficient
set initial beta = 100
end
- The
volumetric flow rate
parameter set a flow rate where the algorithm will target at each time step. Important : when there is a periodic boundary, the wall boundary should be at inlet only and if the chosen wall boundary is at inlet, flow rate must be negative and vice versa. - The
boundary id
parameter is the wall boundary where the flow rate intended is controlled. (inlet or outlet). - The
flow direction
parameter set the absolute direction. 0 = x, 1 = y and 2 = z. - The
initial beta
parameter set a initial beta coefficient that may speed up the convergence of the flow rate targeted. Some tests should be done to find a good initial beta coefficient.
This subsection includes parameters related to the interface sharpening in VOF simulations of Lethe.
subsection interface sharpening
set sharpening threshold = 0.5
set interface sharpness = 2
set sharpening frequency = 10
end
- The
sharpening threshold
parameter defines the interface sharpening threshold that represents the mass conservation level. This parameter must be larger than 1 for interface sharpening. Choosing values less than 1 leads to interface smoothing instead of sharpening. - The
interface sharpness
parameter defines the sharpness of the moving interface (parameter alpha in the interface sharpening model). - The
sharpening frequency
parameter defines the VOF interface sharpening frequency.