FieldMaterial#

class FieldMaterial[source]#

Bases: MaterialBase

FieldMaterial maps scalar field values to colors for flow visualization.

Example

>>> FieldMaterial.rainbow(field="pressure", min_value=0, max_value=100000)

Attributes

opacity: float#

The transparency of the material 1 is fully opaque, 0 is fully transparent

Default:

1

output_field: Literal['Cp', 'Cpt', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'velocity', 'velocity_x', 'velocity_y', 'velocity_z', 'velocity_magnitude', 'pressure', 'vorticity', 'vorticityMagnitude', 'vorticity_x', 'vorticity_y', 'vorticity_z', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor', 'velocity_m_per_s', 'velocity_x_m_per_s', 'velocity_y_m_per_s', 'velocity_z_m_per_s', 'velocity_magnitude_m_per_s', 'pressure_pa'] | str | UserVariable#

Scalar field applied to the surface via the colormap

min: Expression | UnytQuantity | float#

Reference min value (in solver units) representing the left boundary of the colormap

max: Expression | UnytQuantity | float#

Reference max value (in solver units) representing the right boundary of the colormap

colormap: list[tuple[int, int, int]]#

List of key colors distributed evenly across the gradient, defines value to color mappings

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

classmethod rainbow(field, min_value, max_value, opacity=1)[source]#

Create a rainbow-style colormap for scalar fields.

Example

>>> FieldMaterial.rainbow("velocity_magnitude")
classmethod orizon(field, min_value, max_value, opacity=1)[source]#

Create an Orizon-style (blue–orange) colormap.

Example

>>> FieldMaterial.orizon("temperature")
classmethod viridis(field, min_value, max_value, opacity=1)[source]#

Create a Viridis colormap.

Example

>>> FieldMaterial.viridis("vorticity")
classmethod magma(field, min_value, max_value, opacity=1)[source]#

Create a Magma colormap.

Example

>>> FieldMaterial.magma("density")
classmethod airflow(field, min_value, max_value, opacity=1)[source]#

Create an Airflow-style visualization colormap.

Example

>>> FieldMaterial.airflow("pressure_coefficient")
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')