flow360.BETDisk#

pydantic model BETDisk[source]#

BETDisk class

Parameters:

rotation_direction_rule (Optional[Literal['leftHand', 'rightHand']] = None) – center_of_rotation : Tuple[float, float, float] axis_of_rotation : Vector number_of_blades : ConstrainedIntValue radius : _Constrained omega : _Constrained chord_ref : _Constrained thickness : _Constrained n_loading_nodes : ConstrainedIntValue blade_line_chord : Optional[_Constrained] = None initial_blade_direction : Optional[Vector] = None tip_gap : Union[_Constrained, Literal[‘inf’], NoneType] = None mach_numbers : List[NonNegativeFloat] reynolds_numbers : List[PositiveFloat] alphas : List[float] twists : List[BETDiskTwist] chords : List[BETDiskChord] sectional_polars : List[BETDiskSectionalPolar] sectional_radiuses : List[float]

Fields:
  • alphas (List[float])

  • axis_of_rotation (flow360.component.types.Vector)

  • blade_line_chord (flow360.component.flow360_params.unit_system._Constrained | None)

  • center_of_rotation (Tuple[float, float, float])

  • chord_ref (flow360.component.flow360_params.unit_system._Constrained)

  • chords (List[flow360.component.flow360_params.flow360_params.BETDiskChord])

  • initial_blade_direction (flow360.component.types.Vector | None)

  • mach_numbers (List[pydantic.types.NonNegativeFloat])

  • n_loading_nodes (flow360.component.flow360_params.flow360_params.ConstrainedIntValue)

  • number_of_blades (flow360.component.flow360_params.flow360_params.ConstrainedIntValue)

  • omega (flow360.component.flow360_params.unit_system._Constrained)

  • radius (flow360.component.flow360_params.unit_system._Constrained)

  • reynolds_numbers (List[pydantic.types.PositiveFloat])

  • rotation_direction_rule (Literal['leftHand', 'rightHand'] | None)

  • sectional_polars (List[flow360.component.flow360_params.flow360_params.BETDiskSectionalPolar])

  • sectional_radiuses (List[float])

  • thickness (flow360.component.flow360_params.unit_system._Constrained)

  • tip_gap (flow360.component.flow360_params.unit_system._Constrained | Literal['inf'] | None)

  • twists (List[flow360.component.flow360_params.flow360_params.BETDiskTwist])

field rotation_direction_rule = None (alias 'rotationDirectionRule')#
field center_of_rotation [Required] (alias 'centerOfRotation')#
field axis_of_rotation [Required] (alias 'axisOfRotation')#
Constraints:
  • type = array

  • minItems = 3

  • maxItems = 3

  • items = [{‘type’: ‘number’}, {‘type’: ‘number’}, {‘type’: ‘number’}]

field number_of_blades [Required] (alias 'numberOfBlades')#
Constraints:
  • exclusiveMinimum = 0

  • maximum = 10

field radius [Required]#
Constraints:
  • properties = {‘value’: {‘type’: ‘number’, ‘exclusiveMinimum’: 0}, ‘units’: {‘type’: ‘string’, ‘dimension’: ‘length’, ‘enum’: [‘m’, ‘cm’, ‘ft’, ‘flow360_length_unit’, ‘mm’, ‘inch’]}}

field omega [Required]#
Constraints:
  • properties = {‘value’: {‘type’: ‘number’, ‘minimum’: 0}, ‘units’: {‘type’: ‘string’, ‘dimension’: ‘angular_velocity’, ‘enum’: [‘rad/s’, ‘flow360_angular_velocity_unit’]}}

field chord_ref [Required] (alias 'chordRef')#
Constraints:
  • properties = {‘value’: {‘type’: ‘number’, ‘exclusiveMinimum’: 0}, ‘units’: {‘type’: ‘string’, ‘dimension’: ‘length’, ‘enum’: [‘m’, ‘cm’, ‘ft’, ‘flow360_length_unit’, ‘mm’, ‘inch’]}}

field thickness [Required]#
Constraints:
  • properties = {‘value’: {‘type’: ‘number’, ‘exclusiveMinimum’: 0}, ‘units’: {‘type’: ‘string’, ‘dimension’: ‘length’, ‘enum’: [‘m’, ‘cm’, ‘ft’, ‘flow360_length_unit’, ‘mm’, ‘inch’]}}

field n_loading_nodes [Required] (alias 'nLoadingNodes')#
Constraints:
  • exclusiveMinimum = 0

  • maximum = 1000

field blade_line_chord = None (alias 'bladeLineChord')#
Constraints:
  • properties = {‘value’: {‘type’: ‘number’, ‘minimum’: 0}, ‘units’: {‘type’: ‘string’, ‘dimension’: ‘length’, ‘enum’: [‘m’, ‘cm’, ‘ft’, ‘flow360_length_unit’, ‘mm’, ‘inch’]}}

field initial_blade_direction = None (alias 'initialBladeDirection')#
Constraints:
  • type = array

  • minItems = 3

  • maxItems = 3

  • items = [{‘type’: ‘number’}, {‘type’: ‘number’}, {‘type’: ‘number’}]

field tip_gap = None (alias 'tipGap')#
field mach_numbers [Required] (alias 'MachNumbers')#
field reynolds_numbers [Required] (alias 'ReynoldsNumbers')#
field alphas [Required]#
field twists [Required]#
field chords [Required]#
field sectional_polars [Required] (alias 'sectionalPolars')#
field sectional_radiuses [Required] (alias 'sectionalRadiuses')#
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:

dict

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:

dict

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_solver(params, exclude=None, required_by=None)#

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

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)#