LESARD: Boundary conditions¶
The modules related to the boundary conditions are stored in SourceCode/ProblemDefinition/BoundaryConditions
.
Each of the modules define a specific treatment to apply at the given boundary segment.
The indexing of the boundary types is done in the Mappers.py
file, while the application of the boundary treatment
themselves is done through the routine ApplyBCSState
defined in the module SourceCode/_Solver/Solver_ApplyBCs
(see LESARD: Solving modules).
Note
The interface is always considered as passive, therefore no condition is applied within the computational domain.
The boundary conditions are applied only to tagged boundaries according to the user wishes given in the problem’s definition. The degrees of freedom lying on the boundary that did not get tagged during the mesh generation process will be automatically treated as outflow.
A general description of the minimal structure of a boundary condition file is described below, the respective description of each of the implemented routines is given at the bottom of the page.
Page navigation
Boundary condition framework¶
All the boundary conditions present in the computational domain are applied by a the solver routine ApplyBCSState
after having been selected by the user through an index mapping to all the used module of the form ProblemDefinition/BoundaryConditions/$TheConditionName.py
,
named accordingly the boundary conditions that are in use on the boundary segments.
Any boundary condition is defined as a module itself containing the classes, whose structure should be given as follows.
TheConditionName, specifying the nature and the application routine of the associated condition
-
3_LESARD.Templates.Template_BoundaryConditions.
TheConditionName
(Problem, Mesh, Solution, Residuals, FluidId, Bd, BdIndex, *params)¶ Routine that does nothing, just here for you to modify at wish
- Parameters
Problem (Problem) – the considered problem
Mesh (MeshStructure) – the considered mesh
Solution (Solution) – the considered solution (as of the previous subtimestep (as used in the temporal scheme))
Residuals (2D numpy array) – the value of the currently computed residuals(NbVars x NbDofs)
FluidId (integer) – the index of the considered fluid (warning: NOT its value in mappers)
Bd (integer) – the tag of the boundary the considered points are lying on
BdIndex (integer list) – the list of indices of the degrees of freedom to treat
Params (parameters) – (optional) as many parameters as one requires
- Returns
the updated residuals in the same format as the given residuals
- Return type
res (2D float numpy array)
Pre-defined boundary conditions¶
Note
Templates for creating new boundary condition routines can be found in Templates
folder.
-
3_LESARD.SourceCode.ProblemDefinition.BoundaryConditions.Wall.
Wall
(Problem, Mesh, Solution, Residuals, FluidId, Bd, BdIndex, *args)¶ Routine that does nothing, just lets outflow (there for compatibility)
- Parameters
Problem (Problem) – the considered problem
Mesh (MeshStructure) – the considered mesh
Solution (Solution) – the considered solution (as of the previous subtimestep (as used in the temporal scheme))
Residuals (2D numpy array) – the value of the currently computed residuals(NbVars x NbDofs)
FluidId (integer) – the index of the considered fluid (warning: NOT its value in mappers)
Bd (integer) – the tag of the boundary the considered points are lying on
BdIndex (integer list) – the list of indices of the degrees of freedom to treat
- Returns
the updated residuals
- Return type
res (2D float numpy array)
Warning
Only accepts horizontal and vertical wall, is not computing the curvy location-dependent impact (yet)
Note
*args is here only for compatibility on call
-
3_LESARD.SourceCode.ProblemDefinition.BoundaryConditions.Outflow.
Outflow
(Problem, Mesh, Solution, Residuals, FluidId, Bd, BdIndex, *params)¶ Routine that does nothing, just lets outflow (there for compatibility)
- Parameters
Problem (Problem) – the considered problem
Mesh (MeshStructure) – the considered mesh
Solution (Solution) – the considered solution (as of the previous subtimestep (as used in the temporal scheme))
Residuals (2D numpy array) – the value of the currently computed residuals(NbVars x NbDofs)
FluidId (integer) – the index of the considered fluid (warning: NOT its value in mappers)
Bd (integer) – the tag of the boundary the considered points are lying on
BdIndex (integer list) – the list of indices of the degrees of freedom to treat
- Returns
the updated residuals
- Return type
res (2D float numpy array)
Note
*args is here only for compatibility on call
-
class
3_LESARD.SourceCode.ProblemDefinition.BoundaryConditions.Inflow.
Inflow
(Id, *params)¶ Class furnishing the methods giving the shape of the inflow on a given boundary. Upon creation, stores in the field
Inflow
the routine itself, whose fixed parameters have been shortcut.- Constant
- Parameters
Id (integer) – the index corresponding to the equation of fluid the user wants when considering the governing equations given in this module and the associated fluid.
Params (list) – (optinal) the fixed arguments to pass to the function (see each of them for details)
Methods
-
Constant
(Problem, Mesh, Solution, Residuals, FluidId, Bd, BdIndex, Constant, *args)¶ Inflows a constant at the given points
- Parameters
Problem (Problem) – the considered problem
Mesh (MeshStructure) – the considered mesh
Solution (Solution) – the considered solution (as of the previous subtimestep (as used in the temporal scheme))
Residuals (2D numpy array) – the value of the currently computed residuals(NbVars x NbDofs)
FluidId (integer) – the index of the considered fluid (warning: NOT its value in mappers)
Bd (integer) – the tag of the boundary the considered points are lying on
BdIndex (integer list) – the list of indices of the degrees of freedom to treat
Constant (floar) – the constant value to add on the degrees of freedom
- Returns
the updated residuals
- Return type
res (2D float numpy array)
Note
*args is here only for compatibility on call
-
3_LESARD.SourceCode.ProblemDefinition.BoundaryConditions.Dirichlet.
Dirichlet
(Problem, Mesh, Solution, Residuals, FluidId, Bd, BdIndex, Value, *params)¶ Routine that does nothing, just lets outflow (there for compatibility)
- Parameters
Problem (Problem) – the considered problem
Mesh (MeshStructure) – the considered mesh
Solution (Solution) – the considered solution (as of the previous subtimestep (as used in the temporal scheme))
Residuals (2D numpy array) – the value of the currently computed residuals(NbVars x NbDofs)
FluidId (integer) – the index of the considered fluid (warning: NOT its value in mappers)
Bd (integer) – the tag of the boundary the considered points are lying on
BdIndex (integer list) – the list of indices of the degrees of freedom to treat
Constant (floar) – the constant value to force on the degrees of freedom
- Returns
the updated residuals
- Return type
res (2D float numpy array)
Note
*args is here only for compatibility on call