Skip to content

Add examples for Liquid related classes (#1127) #1128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion flow360/component/simulation/models/material.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,20 @@ class SolidMaterial(MaterialBase):


class Water(MaterialBase):
"""Water material used for LiquidOperatingCondition"""
"""
Water material used for :class:`LiquidOperatingCondition`

Example
-------

>>> fl.Water(
... name="Water",
... density=1000 * fl.u.kg / fl.u.m**3,
... dynamic_viscosity=0.001002 * fl.u.kg / fl.u.m / fl.u.s,
... )

====
"""

type: Literal["water"] = pd.Field("water", frozen=True)
name: str = pd.Field(frozen=True, description="Custom name of the water with given property.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,19 @@ def flow360_reynolds_number(self, length_unit: LengthType.Positive):
class LiquidOperatingCondition(Flow360BaseModel):
"""
Operating condition for simulation of water as the only material.

Example
-------

>>> fl.LiquidOperatingCondition(
... velocity_magnitude=10 * fl.u.m / fl.u.s,
... alpha=-90 * fl.u.deg,
... beta=0 * fl.u.deg,
... material=fl.Water(name="Water"),
... reference_velocity_magnitude=5 * fl.u.m / fl.u.s,
... )

====
"""

type_name: Literal["LiquidOperatingCondition"] = pd.Field(
Expand Down