Skip to content

Om6wing diverged but likely because some param not properly set #252

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

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: unit testing
on:
workflow_dispatch:
push:
branches: [ develop, main, release-candidate/* ]
branches: [ develop, main, release-candidate/*, UnderConstruction/SimulationInterface ]
pull_request:
branches: [ develop, main, release-candidate/* ]
branches: [ develop, main, release-candidate/*, UnderConstruction/SimulationInterface ]
workflow_call:

jobs:
Expand All @@ -29,6 +29,7 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies
run: poetry install
run: |
poetry install
- name: Run tests
run: poetry run pytest -rA
59 changes: 59 additions & 0 deletions examples/om6WingWithSimulation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
from flow360 import SI_unit_system
from flow360 import units as u
from flow360.component.simulation.operating_condition import (
ExternalFlowOperatingConditions,
)
from flow360.component.simulation.physics_components import (
LinearSolver,
NavierStokesSolver,
SpalartAllmaras,
)
from flow360.component.simulation.references import ReferenceGeometry
from flow360.component.simulation.simulation import Simulation
from flow360.component.simulation.starting_points.volume_mesh import VolumeMesh
from flow360.component.simulation.surfaces import (
FreestreamBoundary,
NoSlipWall,
Patch,
SlipWall,
)
from flow360.component.simulation.volumes import FluidDynamics

om6wing_mesh = VolumeMesh.from_file(
file_name="/local_data/ben/testcases/localTests/om6Wing/wing_tetra.1.lb8.ugrid",
name="OM6wing-mesh",
)


wing_surface = Patch(mesh_patch_name="1", custom_name="wing_surface")
slip_wall = Patch(mesh_patch_name="2", custom_name="slip_wall")
far_field = Patch(mesh_patch_name="3", custom_name="far_field")

# with SI_unit_system:
simulation = Simulation(
volume_mesh=om6wing_mesh,
reference_geometry=ReferenceGeometry(
area=1.15315084119231,
moment_center=(0, 0, 0),
moment_length=(0.801672958512342, 0.801672958512342, 0.801672958512342),
),
operating_condition=ExternalFlowOperatingConditions(
Mach=0.84, temperature=288.15, alpha=3.06 * u.deg, Reynolds=14.6e6
),
volumes=[
FluidDynamics(
navier_stokes_solver=NavierStokesSolver(
linear_solver=LinearSolver(absolute_tolerance=1e-10)
),
turbulence_model_solver=SpalartAllmaras(),
),
],
surfaces=[
NoSlipWall(
entities=[wing_surface],
),
SlipWall(entities=[slip_wall]),
FreestreamBoundary(entities=[far_field]),
],
)
simulation.run()
Empty file.
2 changes: 1 addition & 1 deletion flow360/component/flow360_params/params_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ def __setitem__(self, key, value):
super().__setattr__(key, value)

def names(self) -> List[str]:
"""return names of all boundaries"""
"""return names of all instances"""
return [k for k, _ in self if k not in [COMMENTS, TYPE_TAG_STR]]

@classmethod
Expand Down
4 changes: 2 additions & 2 deletions flow360/component/flow360_params/solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ class LinearSolver(Flow360BaseModel):
"""

max_iterations: Optional[PositiveInt] = pd.Field(alias="maxIterations", default=50)
absolute_tolerance: Optional[PositiveFloat] = pd.Field(alias="absoluteTolerance")
relative_tolerance: Optional[PositiveFloat] = pd.Field(alias="relativeTolerance")
absolute_tolerance: Optional[PositiveFloat] = pd.Field(None, alias="absoluteTolerance")
relative_tolerance: Optional[PositiveFloat] = pd.Field(None, alias="relativeTolerance")

# pylint: disable=missing-class-docstring,too-few-public-methods
class Config(Flow360BaseModel.Config):
Expand Down
Loading