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[Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])], Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])], Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])]]]#

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

Additional Constructors

classmethod from_file(filename)#

Load a Flow360BaseModel from a .json file.

Parameters:

filename (str)

Return type:

Flow360BaseModel

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

Print fields and methods of a Flow360BaseModel using rich.

Parameters:

methods (bool)

Return type:

None

to_file(filename, **kwargs)#

Export Flow360BaseModel instance to a .json file.

Parameters:
Return type:

None