flow360.VolumeOutput#
- pydantic model VolumeOutput[source]#
VolumeOutput
class- Parameters:
output_format (Optional[Literal['paraview', 'tecplot', 'both']] = paraview) â animation_frequency : Union[PositiveInt, Literal[-1], NoneType] = -1 animation_frequency_offset : Optional[int] = 0 compute_time_averages : Optional[bool] = False animation_frequency_time_average : Union[PositiveInt, Literal[-1], NoneType] = -1 animation_frequency_time_average_offset : Optional[int] = 0 start_average_integration_step : Union[NonNegativeInt, Literal[-1], NoneType] = -1 output_fields : Optional[List[Literal[âCpâ, âgradWâ, âkOmegaâ, âMachâ, âmutâ, âmutRatioâ, ânuHatâ, âprimitiveVarsâ, âqcriterionâ, âresidualNavierStokesâ, âresidualTransitionâ, âresidualTurbulenceâ, âsâ, âsolutionNavierStokesâ, âsolutionTransitionâ, âsolutionTurbulenceâ, âTâ, âvorticityâ, âwallDistanceâ, ânumericalDissipationFactorâ, âresidualHeatSolverâ, âVelocityRelativeâ, âlowMachPreconditionerSensorâ, âbetMetricsâ, âbetMetricsPerDiskâ, âCoefficient of pressureâ, âGradient of primitive solutionâ, âk and omegaâ, âMach numberâ, âTurbulent viscosityâ, âTurbulent viscosity and freestream dynamic viscosity ratioâ, âSpalart-Almaras variableâ, ârho, u, v, w, p (density, 3 velocities and pressure)â, âQ criterionâ, âN-S residualâ, âTransition residualâ, âTurbulence residualâ, âEntropyâ, âN-S solutionâ, âTransition solutionâ, âTurbulence solutionâ, âTemperatureâ, âVorticityâ, âWall distanceâ, âNumericalDissipationFactor sensorâ, âHeat equation residualâ, âVelocity with respect to non-inertial frameâ, âLow-Mach preconditioner factorâ, âBET Metricsâ, âBET Metrics per Diskâ]]] = [âprimitiveVarsâ, âCpâ, âmutâ, âMachâ]
- Fields:
animation_frequency (pydantic.types.PositiveInt | Literal[-1] | None)
animation_frequency_offset (int | None)
animation_frequency_time_average (pydantic.types.PositiveInt | Literal[-1] | None)
animation_frequency_time_average_offset (int | None)
compute_time_averages (bool | None)
output_fields (types.ConstrainedListValue[Literal['Cp', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'vorticity', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor', 'betMetrics', 'betMetricsPerDisk', 'Coefficient of pressure', 'Gradient of primitive solution', 'k and omega', 'Mach number', 'Turbulent viscosity', 'Turbulent viscosity and freestream dynamic viscosity ratio', 'Spalart-Almaras variable', 'rho, u, v, w, p (density, 3 velocities and pressure)', 'Q criterion', 'N-S residual', 'Transition residual', 'Turbulence residual', 'Entropy', 'N-S solution', 'Transition solution', 'Turbulence solution', 'Temperature', 'Vorticity', 'Wall distance', 'NumericalDissipationFactor sensor', 'Heat equation residual', 'Velocity with respect to non-inertial frame', 'Low-Mach preconditioner factor', 'BET Metrics', 'BET Metrics per Disk']] | None)
output_format (Literal['paraview', 'tecplot', 'both'] | None)
start_average_integration_step (pydantic.types.NonNegativeInt | Literal[-1] | None)
- field output_fields = ['primitiveVars', 'Cp', 'mut', 'Mach'] (alias 'outputFields')#
- Constraints:
uniqueItems = True
- to_solver(params, **kwargs)[source]#
Loops through all fields, for Flow360BaseModel runs .to_solver() recusrively. For dimensioned value performs
unit conversion to flow360_base system.
- Parameters:
params (Flow360Params) â Full config definition as Flow360Params.
exclude (List[str] (optional)) â List of fields to ignore on returned model.
required_by (List[str] (optional)) â Path to property which requires conversion.
- Returns:
returns caller class with units all in flow360 base unit system
- Return type:
caller class
- classmethod add_type_field()#
Automatically place âtypeâ field with model name in the model field dictionary.
- append(params, overwrite=False)#
append parametrs to the model
- Parameters:
params (Flow360BaseModel) â Flow360BaseModel parameters to be appended
overwrite (bool, optional) â Whether to overwrite if key exists, by default False
- classmethod construct(_fields_set=None, **values)#
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = âallowâ was set since it adds all passed values
- copy(update=None, **kwargs)#
Copy a Flow360BaseModel. With
deep=True
as default.
- dict(*args, exclude=None, **kwargs)#
Returns dict representation of the model.
- Parameters:
*args â Arguments passed to pydanticâs
dict
method.**kwargs â Keyword arguments passed to pydanticâs
dict
method.
- Returns:
A formatted dict.
- Return type:
Example
>>> params.dict()
- classmethod dict_from_file(filename)#
Loads a dictionary containing the model from a .json or .yaml file.
- Parameters:
filename (str) â Full path to the .yaml or .json file to load the
Flow360BaseModel
from.- Returns:
A dictionary containing the model.
- Return type:
Example
>>> params = Flow360Params.from_file(filename='folder/flow360.json')
- classmethod flow360_schema()#
Generate a schema json string for the flow360 model
- classmethod flow360_ui_schema()#
Generate a UI schema json string for the flow360 model
- 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
>>> simulation = Simulation.from_file(filename='folder/sim.json')
- classmethod from_json(filename, **parse_obj_kwargs)#
Load a
Flow360BaseModel
from .json file.- Parameters:
filename (str) â Full path to the .json file to load the
Flow360BaseModel
from.- Returns:
Flow360BaseModel
â An instance of the component class calling load.**parse_obj_kwargs â Keyword arguments passed to pydanticâs
parse_obj
method.
Example
>>> params = Flow360Params.from_json(filename='folder/flow360.json')
- classmethod from_orm(obj)#
- classmethod from_yaml(filename, **parse_obj_kwargs)#
Loads
Flow360BaseModel
from .yaml file.- Parameters:
filename (str) â Full path to the .yaml file to load the
Flow360BaseModel
from.**parse_obj_kwargs â Keyword arguments passed to pydanticâs
parse_obj
method.
- Returns:
An instance of the component class calling from_yaml.
- Return type:
Flow360BaseModel
Example
>>> params = Flow360Params.from_yaml(filename='folder/flow360.yaml')
- classmethod generate_docstring()#
Generates a docstring for a Flow360 model and saves it to the __doc__ of the class.
- 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.
Example
>>> solver_params.help(methods=True)
- json(*args, exclude=None, **kwargs)#
Returns json representation of the model.
- Parameters:
*args â Arguments passed to pydanticâs
json
method.**kwargs â Keyword arguments passed to pydanticâs
json
method.
- Returns:
A formatted json. Sets default vaules by_alias=True, exclude_none=True
- Return type:
json
Example
>>> params.json()
- classmethod parse_file(path, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)#
- classmethod parse_obj(obj)#
- classmethod parse_raw(b, *, content_type=None, encoding='utf8', proto=None, allow_pickle=False)#
- classmethod schema(by_alias=True, ref_template='#/definitions/{model}')#
- classmethod schema_json(*, by_alias=True, ref_template='#/definitions/{model}', **dumps_kwargs)#
- set_will_export_to_flow360(flag)#
Recursivly sets flag will_export_to_flow360
- Parameters:
flag (bool) â set to true before exporting to flow360 json
- to_file(filename)#
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.
Example
>>> params.to_file(filename='folder/flow360.json')
- to_json(filename)#
Exports
Flow360BaseModel
instance to .json file- Parameters:
filename (str) â Full path to the .json file to save the
Flow360BaseModel
to.
Example
>>> params.to_json(filename='folder/flow360.json')
- to_yaml(filename)#
Exports
Flow360BaseModel
instance to .yaml file.- Parameters:
filename (str) â Full path to the .yaml file to save the
Flow360BaseModel
to.
Example
>>> params.to_yaml(filename='folder/flow360.yaml')
- classmethod update_forward_refs(**localns)#
Try to update ForwardRefs on fields based on this Model, globalns and localns.
- classmethod validate(value)#
- field compute_time_averages = False (alias 'computeTimeAverages')#
- field animation_frequency_time_average = -1 (alias 'animationFrequencyTimeAverage')#
- field animation_frequency_time_average_offset = 0 (alias 'animationFrequencyTimeAverageOffset')#
- field start_average_integration_step = -1 (alias 'startAverageIntegrationStep')#
animation_settings: Optional[AnimationSettingsExtended] = pd.Field(alias=âanimationSettingsâ)
# pylint: disable=unused-argument def to_solver(self, params, **kwargs) -> TimeAverageAnimatedOutput:
- if self.animation_settings is not None:
- if self.animation_settings.frequency is not None:
self.animation_frequency = self.animation_settings.frequency
- else:
self.animation_frequency = -1
- if self.animation_settings.frequency_offset is not None:
self.animation_frequency_offset = self.animation_settings.frequency_offset
- else:
self.animation_frequency_offset = 0
- if self.animation_settings.frequency_time_average is not None:
- self.animation_frequency_time_average = (
self.animation_settings.frequency_time_average
)
- else:
self.animation_frequency_time_average = -1
- if self.animation_settings.frequency_time_average_offset is not None:
- self.animation_frequency_time_average_offset = (
self.animation_settings.frequency_time_average_offset
)
- else:
self.animation_frequency_time_average_offset = 0
- solver_animations = self.__class__(
animation_frequency=self.animation_frequency, animation_frequency_offset=self.animation_frequency_offset,
) return solver_animations
- field output_format = 'paraview' (alias 'outputFormat')#
- field animation_frequency = -1 (alias 'animationFrequency')#
- field animation_frequency_offset = 0 (alias 'animationFrequencyOffset')#
animation_settings: Optional[AnimationSettings] = pd.Field(alias=âanimationSettingsâ)
# pylint: disable=unused-argument def to_solver(self, params, **kwargs) -> AnimatedOutput:
# Convert animation settings (UI representation) to solver representation if self.animation_settings is not None:
- if self.animation_settings.frequency is not None:
self.animation_frequency = self.animation_settings.frequency
- else:
self.animation_frequency = -1
- if self.animation_settings.frequency_offset is not None:
self.animation_frequency_offset = self.animation_settings.frequency_offset
- else:
self.animation_frequency_offset = 0
- solver_animations = self.__class__(
animation_frequency=self.animation_frequency, animation_frequency_offset=self.animation_frequency_offset,
) return solver_animations