snek5000.solvers.kth#
KTH base solver#
Classes
|
Contain the information on a |
alias of |
|
|
A base class which incorporates parameters for KTH toolbox also. |
- class snek5000.solvers.kth.InfoSolverKTH(only_root=False, **kargs)[source]#
Contain the information on a
snek5000.solvers.kth.SimulKTH
instance.- complete_with_classes()#
Populate info solver by executing
_complete_info_solver
class methods
- import_classes()#
Import the classes and return a dictionary.
- class snek5000.solvers.kth.SimulKTH(params)[source]#
A base class which incorporates parameters for KTH toolbox also.
Examples
>>> from snek5000.solvers.kth 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]
Documentation for params.nek.runpar
Runtime parameter section for rprm module (KTH toolbox)
parf_write
: Do we write runtime parameter fileparf_name
: Runtime parameter file name for output (without .par)
[_RUNPAR] parfWrite = no parfName = outparfile
Documentation for params.nek.monitor
Runtime parameter section for monitor module (KTH toolbox)
log_level
: Logging threshold for toolboxeswall_time
: Simulation wall time
[_MONITOR] logLevel = 4 wallTime = 23:45
Documentation for params.nek.chkpoint
Runtime parameter section for checkpoint module (KTH toolbox)
read_chkpt
: Restart from checkpointchkp_fnumber
: Restart file numberchkp_interval
: Checkpoint saving frequency (number of time steps)
[_CHKPOINT] readChkpt = no chkpFnumber = 1 chkpInterval = 250
Documentation for params.nek.stat
Runtime parameter section for statistics module (KTH toolbox)
av_step
: Frequency of averagingio_step
: Frequency of file saving
[_STAT] avStep = 4 ioStep = 50
- InfoSolver#
alias of
InfoSolverKTH
- 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()#
Generate default parameters.
params.nek
contains runtime parameters consumed by Nek5000.
- create_symlink_start_from_file(path)#
Create a symlink towards the start_from file
- classmethod load_params_from_file(path_xml=None, path_par=None)#
Instantiate a Parameters instance and populate it from params_simul.xml or case.par