SpalartAllmaras#

class SpalartAllmaras[source]#

Bases: TurbulenceModelSolver

SpalartAllmaras class for setting up the turbulence solver based on the Spalart-Allmaras model.

Example

>>> fl.SpalartAllmaras(
...     absolute_tolerance=1e-10,
...     linear_solver=LinearSolver(max_iterations=25),
...     update_jacobian_frequency=2,
...     equation_evaluation_frequency=1,
... )

Attributes

absolute_tolerance: float#

Tolerance for the turbulence model residual, below which the solver progresses to the next physical step (unsteady) or completes the simulation (steady).

Default:

1e-08

relative_tolerance: float#

Tolerance to the relative residual, below which the solver goes to the next physical step. Relative residual is defined as the ratio of the current pseudoStep’s residual to the maximum residual present in the first 10 pseudoSteps within the current physicalStep. NOTE: relativeTolerance is ignored in steady simulations and only absoluteTolerance is used as the convergence criterion.

Default:

0

equation_evaluation_frequency: int#

Frequency at which to update the turbulence equation.

Default:

4

linear_solver: LinearSolver#

Linear solver settings, see LinearSolver documentation.

Default:

LinearSolver()

CFL_multiplier: float#

Factor to the CFL definitions defined in the Time Stepping section.

Default:

2.0

reconstruction_gradient_limiter: float, optional#

The strength of gradient limiter used in reconstruction of solution variables at the faces (specified in the range [0.0, 2.0]). 0.0 corresponds to setting the gradient equal to zero, and 2.0 means no limiting.

Default:

0.5

quadratic_constitutive_relation: bool#

Use quadratic constitutive relation for turbulence shear stress tensor instead of Boussinesq Approximation.

Default:

False

modeling_constants: SpalartAllmarasModelConstants, optional#

A SpalartAllmarasModelConstants object containing the coefficients used in the Spalart-Allmaras model. For the default values used in Flow360, please refer to SpalartAllmarasModelConstants.

Default:

SpalartAllmarasModelConstants()

update_jacobian_frequency: int#

Frequency at which the jacobian is updated.

Default:

4

max_force_jac_update_physical_steps: int#

For physical steps less than the input value, the jacobian matrix is updated every pseudo-step overriding the update_jacobian_frequency value.

Default:

0

hybrid_model: DetachedEddySimulation, optional#

Model used for running hybrid RANS-LES simulations

Default:

None

rotation_correction: bool#

Rotation correction for the turbulence model.

Default:

False

controls: list[TurbulenceModelControls], optional#

List of control zones to enforce specific turbulence model constants and behavior.

Default:

None

low_reynolds_correction: bool, optional#

Use low Reynolds number correction for Spalart-Allmaras turbulence model

Default:

False

Additional Constructors

classmethod from_file(filename)#

Loads a Flow360BaseModel from .json, or .yaml file.

Parameters:

filename (str) – Full path to the .yaml or .json file to load the Flow360BaseModel from.

Returns:

An instance of the component class calling load.

Return type:

Flow360BaseModel

Example

>>> params = Flow360BaseModel.from_file(filename='folder/sim.json') 

Methods

help(methods=False)#

Prints message describing the fields and methods of a Flow360BaseModel.

Parameters:

methods (bool = False) – Whether to also print out information about object’s methods.

Return type:

None

Example

>>> params.help(methods=True) 
to_file(filename, **kwargs)#

Exports Flow360BaseModel instance to .json or .yaml file

Parameters:

filename (str) – Full path to the .json or .yaml or file to save the Flow360BaseModel to.

Return type:

None

Example

>>> params.to_file(filename='folder/flow360.json')