PorousMedium#

class PorousMedium[source]#

Bases: Flow360BaseModel

PorousMedium class for specifying porous media settings. For further information please refer to the porous media knowledge base.

Example

Define a porous medium model porous_zone with the Box entity. The center and size of the porous_zone box are (0, 0, 0) * fl.u.m and (0.2, 0.3, 2) * fl.u.m, respectively. The axes of the porous_zone are set as (0, 1, 0) and (0, 0, 1).

>>> fl.PorousMedium(
...     entities=[
...         fl.Box.from_principal_axes(
...             name="porous_zone",
...             axes=[(0, 1, 0), (0, 0, 1)],
...             center=(0, 0, 0) * fl.u.m,
...             size=(0.2, 0.3, 2) * fl.u.m,
...         )
...    ],
...    darcy_coefficient=(1e6, 0, 0) / fl.u.m **2,
...    forchheimer_coefficient=(1, 0, 0) / fl.u.m,
...    volumetric_heat_source=1.0 * fl.u.W/ fl.u.m **3,
... )

Define a porous medium model porous_zone with the volume_mesh["porous_zone"] volume. The axes of entity must be specified to serve as the the principle axes of the porous medium material model, and we set the axes of the porous_zone as (1, 0, 0) and (0, 1, 0).

>>> porous_zone = volume_mesh["porous_zone"]
>>> porous_zone.axes = [(1, 0, 0), (0, 1, 0)]
>>> porous_medium_model = fl.PorousMedium(
...     entities=[porous_zone],
...     darcy_coefficient=(1e6, 0, 0) / fl.u.m **2,
...     forchheimer_coefficient=(1, 0, 0) / fl.u.m,
...     volumetric_heat_source=1.0 * fl.u.W/ fl.u.m **3,
... )

Attributes

name: str, optional#

Name of the PorousMedium model.

Default:

'Porous medium'

entities: EntityList[GenericVolume, Box, CustomVolume, SeedpointVolume]#

The entity list for the PorousMedium model. The entity should be defined by Box, zones from the geometry/volume mesh orby SeedpointVolume when using snappyHexMeshing.The axes of entity must be specified to serve as the the principle axes of the porous medium material model.

darcy_coefficient: InverseAreaType.Vector#

Darcy coefficient of the porous media model which determines the scaling of the viscous loss term. The 3 values define the coefficient for each of the 3 axes defined by the reference frame of the volume zone.

forchheimer_coefficient: InverseLengthType.Vector#

Forchheimer coefficient of the porous media model which determines the scaling of the inertial loss term.

volumetric_heat_source: str | HeatSourceType, optional#

The volumetric heat source.

Default:

None

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

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