snek5000.solvers.base#
Nek5000 base solver#
A bare Nek5000 solver which does not rely on any user parameters.
Classes
- class snek5000.solvers.base.SimulNek(params)[source]#
Simulation class
- Parameters
params (Parameters) – Input parameters for the simulation run.
write_files (bool, optional) – Write simulation files, including usr, box, SIZE files. By default all files are written.
Examples
>>> from snek5000.solvers.base import Simul >>> params = Simul.create_default_params() >>> sim = Simul(params)
Notes
Here, only the documention for
params.nek
is displayed. For the documentation onparams.oper
seesnek5000.operators
.Documentation for params.nek
The parameters in
params.nek
are used by Snek to produce the Nek file .par, which is documented here Parameter File (.par).Note
For these parameters, there is nearly a direct correspondance between Nek5000 par file keys and Snek5000 parameter variable names, with only camelCase <-> snake_case conversions. This is implemented in
snek5000.params
.The sections are:
general
(mandatory)problemtype
mesh
velocity
pressure
(required for velocity)temperature
scalar%%
cvode
When scalars are used, the keys of each scalar are defined under the section
scalar%%
varying betweenscalar01
andscalar99
.There is a mechanism to enable/disable these sections so that they are used or not to produce the .par file (see our tutorial on writting new solvers).
Documentation for params.nek.general
See table GENERAL keys in the .par file
[GENERAL] startFrom = stopAt = numSteps endTime = <real> numSteps = 1 dt = <real> variableDt = yes targetCfl = 0.5 writeControl = timeStep writeInterval = 10 filtering = none filterModes = 2 filterCutoffRatio = 0.65 filterWeight = 12.0 writeDoublePrecision = yes dealiasing = yes timeStepper = BDF2 extrapolation = standard optLevel = 2 logLevel = 2
Documentation for params.nek.problemtype
See table PROBLEMTYPE keys in the .par file
[PROBLEMTYPE] equation = incompNS variableProperties = no stressFormulation = no
Documentation for params.nek.velocity
See table VELOCITY keys in the .par file
[VELOCITY] residualTol = <real> residualProj = no writeToFieldFile = yes viscosity = <real> density = <real>
Documentation for params.nek.pressure
See table PRESSURE keys in the .par file
[PRESSURE] residualTol = <real> residualProj = no writeToFieldFile = yes preconditioner = semg_xxt
Documentation for params.nek.mesh
See table MESH keys in the .par file
[MESH] writeToFieldFile = yes
Documentation for params.nek.temperature
See table TEMPERATURE keys in the .par file
[TEMPERATURE] residualTol = <real> residualProj = no writeToFieldFile = yes solver = helm advection = yes absoluteTol = <real> conjugateHeatTransfer = no conductivity = <real> rhoCp = <real>
Documentation for params.nek.scalar01
See table SCALAR%% keys in the .par file
[SCALAR01] residualTol = <real> residualProj = no writeToFieldFile = yes solver = helm advection = yes absoluteTol = <real> density = <real> diffusivity = <real>
Documentation for params.nek.cvode
See table CVODE keys in the .par file
[CVODE]
- InfoSolver#
alias of
InfoSolverNek
- class Parameters(*args, **kwargs)#
Container for reading, modifying and writing par files.
- Parameters
tag – A string representing name of case files (for example: provide
"abl"
for files likeabl.usr, abl.par
etc).
- classmethod create_default_params()[source]#
Generate default parameters.
params.nek
contains runtime parameters consumed by Nek5000.