flow360.NavierStokesSolver#

class NavierStokesSolver[source]#

Bases: GenericFlowSolverSettings

NavierStokesSolver class for setting up compressible Navier-Stokes solver

Parameters:
  • absolute_tolerance (pydantic.types.PositiveFloat | None) – relative_tolerance : Optional[NonNegativeFloat] = 0 order_of_accuracy : Optional[Literal[1, 2]] = 2 CFL_multiplier : Optional[PositiveFloat] = 1.0 update_jacobian_frequency : Optional[PositiveInt] = 4 max_force_jac_update_physical_steps : Optional[NonNegativeInt] = 0 kappa_MUSCL : Optional[ConstrainedFloatValue] = -1 equation_eval_frequency : Optional[PositiveInt] = 1 numerical_dissipation_factor : Optional[ConstrainedFloatValue] = 1 limit_velocity : Optional[bool] = False limit_pressure_density : Optional[bool] = False linear_solver : Optional[LinearSolver] = LinearSolver(max_iterations=30, absolute_tolerance=None, relative_tolerance=None, _type=’LinearSolver’) model_type : Literal[‘Compressible’] = Compressible low_mach_preconditioner : Optional[bool] = False low_mach_preconditioner_threshold : Optional[NonNegativeFloat] = None

  • absolute_tolerance – Tolerance for the NS residual, below which the solver goes to the next physical step

  • relative_tolerance (pydantic.types.NonNegativeFloat | None) – 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

  • CFL_multiplier (pydantic.types.PositiveFloat | None) – Factor to the CFL definitions defined in “timeStepping” section

  • kappa_MUSCL (flow360.component.flow360_params.solvers.ConstrainedFloatValue | None) – Kappa for the MUSCL scheme, range from [-1, 1], with 1 being unstable. The default value of -1 leads to a 2nd order upwind scheme and is the most stable. A value of 0.33 leads to a blended upwind/central scheme and is recommended for low subsonic flows leading to reduced dissipation

  • update_jacobian_frequency (pydantic.types.PositiveInt | None) – Frequency at which the jacobian is updated.

  • equation_eval_frequency (pydantic.types.PositiveInt | None) – Frequency at which to update the compressible NS equation in loosely-coupled simulations

  • max_force_jac_update_physical_steps (pydantic.types.NonNegativeInt | None) – When which physical steps, the jacobian matrix is updated every pseudo step

  • order_of_accuracy (Literal[1, 2] | None) – Order of accuracy in space

  • limit_velocity (bool | None) – Limiter for velocity

  • limit_pressure_density (bool | None) – Limiter for pressure and density

  • numerical_dissipation_factor (flow360.component.flow360_params.solvers.ConstrainedFloatValue | None) – A factor in the range [0.01, 1.0] which exponentially reduces the dissipation of the numerical flux. The recommended starting value for most low-dissipation runs is 0.2

  • linear_solver (flow360.component.flow360_params.solvers.LinearSolver | None) – Linear solver settings

  • low_mach_preconditioner (bool | None) – Uses preconditioning for accelerating low Mach number flows.

  • low_mach_preconditioner_threshold (pydantic.types.NonNegativeFloat | None) – For flow regions with Mach numbers smaller than threshold, the input Mach number to the preconditioner is assumed to be the threshold value if it is smaller than the threshold. The default value for the threshold is the freestream Mach number.

Returns:

An instance of the component class NavierStokesSolver.

Return type:

NavierStokesSolver

Example

>>> ns = NavierStokesSolver(absolute_tolerance=1e-10)

Attributes

Methods

__init__([filename])

Create a new model by parsing and validating input data from keyword arguments.

add_type_field()

Automatically place "type" field with model name in the model field dictionary.

allow_but_remove(values)

root validator for allow_but_remove, e.g., legacy properties that are no longer in use

append(params[, overwrite])

append parametrs to the model

construct([_fields_set])

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.

copy([update])

Copy a Flow360BaseModel.

dict(*args[, exclude])

Returns dict representation of the model.

dict_from_file(filename)

Loads a dictionary containing the model from a .json or .yaml file.

flow360_schema()

Generate a schema json string for the flow360 model

flow360_ui_schema()

Generate a UI schema json string for the flow360 model

from_file(filename)

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

from_json(filename, **parse_obj_kwargs)

Load a Flow360BaseModel from .json file.

from_orm(obj)

from_yaml(filename, **parse_obj_kwargs)

Loads Flow360BaseModel from .yaml file.

generate_docstring()

Generates a docstring for a Flow360 model and saves it to the __doc__ of the class.

handle_conflicting_fields(values)

root validator to handle deprecated aliases

handle_deprecated_aliases(values)

root validator to handle deprecated aliases

help([methods])

Prints message describing the fields and methods of a Flow360BaseModel.

json(*args[, exclude])

Returns json representation of the model.

one_of(values)

root validator for require one of

parse_file(path, *[, content_type, ...])

parse_obj(obj)

parse_raw(b, *[, content_type, encoding, ...])

schema([by_alias, ref_template])

schema_json(*[, by_alias, ref_template])

set_will_export_to_flow360(flag)

Recursivly sets flag will_export_to_flow360

to_file(filename)

Exports Flow360BaseModel instance to .json or .yaml file

to_json(filename)

Exports Flow360BaseModel instance to .json file

to_solver(params, **kwargs)

Set preconditioner threshold to freestream Mach number

to_yaml(filename)

Exports Flow360BaseModel instance to .yaml file.

update_forward_refs(**localns)

Try to update ForwardRefs on fields based on this Model, globalns and localns.

validate(value)

Inherited Common Usage

CFL_multiplier#
kappa_MUSCL#
equation_eval_frequency#
numerical_dissipation_factor#
limit_velocity#
limit_pressure_density#
linear_solver#
model_type#
low_mach_preconditioner#
low_mach_preconditioner_threshold#
to_solver(params, **kwargs)[source]#

Set preconditioner threshold to freestream Mach number