Skip to content
1 change: 1 addition & 0 deletions flow360/cloud/flow360_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class _Resource(Flow360RequestsV2):

class NewReportRequest(Flow360RequestsV2):
"New report request"

name: str
resources: List[_Resource]
config_json: str
Expand Down
3 changes: 1 addition & 2 deletions flow360/cloud/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""utils for cloud operations
"""
"""utils for cloud operations"""

from enum import Enum

Expand Down
3 changes: 1 addition & 2 deletions flow360/component/constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""Constants file
"""
"""Constants file"""


# pylint: disable=invalid-name,too-few-public-methods
Expand Down
3 changes: 1 addition & 2 deletions flow360/component/interfaces.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""webAPI interface definitions
"""
"""webAPI interface definitions"""

from typing import Union

Expand Down
35 changes: 33 additions & 2 deletions flow360/component/simulation/meshing_param/face_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,39 @@ class SurfaceRefinement(Flow360BaseModel):
refinement_type: Literal["SurfaceRefinement"] = pd.Field("SurfaceRefinement", frozen=True)
entities: EntityList[Surface] = pd.Field(alias="faces")
# pylint: disable=no-member
max_edge_length: LengthType.Positive = pd.Field(
description="Maximum edge length of surface cells."
geometry_accuracy: Optional[LengthType.Positive] = pd.Field(
description="The smallest length scale that will be resolved accurately by the surface meshing process. "
)

@pd.field_validator("entities", mode="after")
@classmethod
def ensure_surface_existence(cls, value):
"""Ensure all boundaries will be present after mesher"""
return check_deleted_surface_in_entity_list(value)


class GeometryRefinement(Flow360BaseModel):
"""
Setting for refining surface elements for given `Surface`.

Example
-------

>>> fl.GeometryRefinement(
... faces=[geometry["face1"], geometry["face2"]],
... geometry_accuracy=0.001*fl.u.m
... )

====
"""

name: Optional[str] = pd.Field("Surface refinement")
refinement_type: Literal["GeometryRefinement"] = pd.Field("GeometryRefinement", frozen=True)
entities: EntityList[Surface] = pd.Field(alias="faces")
# pylint: disable=no-member

geometry_accuracy: Optional[LengthType.Positive] = pd.Field(
description="The smallest length scale that will be resolved accurately by the surface meshing process. "
)

@pd.field_validator("entities", mode="after")
Expand Down
20 changes: 19 additions & 1 deletion flow360/component/simulation/meshing_param/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from flow360.component.simulation.meshing_param.edge_params import SurfaceEdgeRefinement
from flow360.component.simulation.meshing_param.face_params import (
BoundaryLayer,
GeometryRefinement,
PassiveSpacing,
SurfaceRefinement,
)
Expand All @@ -35,6 +36,7 @@
Union[
SurfaceEdgeRefinement,
SurfaceRefinement,
GeometryRefinement,
BoundaryLayer,
PassiveSpacing,
UniformRefinement,
Expand Down Expand Up @@ -70,7 +72,8 @@ class MeshingDefaults(Flow360BaseModel):
geometry_accuracy: Optional[LengthType.Positive] = pd.Field(
None,
description="The smallest length scale that will be resolved accurately by the surface meshing process. "
"This parameter is only valid when using geometry AI.",
"This parameter is only valid when using geometry AI."
"It can be overriden with class: ~flow360.GeometryRefinement.",
)

##:: Default surface edge settings
Expand Down Expand Up @@ -121,6 +124,20 @@ class MeshingDefaults(Flow360BaseModel):
" This can be overridden with :class:`~flow360.SurfaceRefinement`.",
context=SURFACE_MESH,
)

surface_max_aspect_ratio: pd.PositiveFloat = ConditionalField(
10.0,
description="Maximum aspect ratio for surface cells for the GAI surface mesher."
" This cannot be overriden per face",
context=SURFACE_MESH,
)

surface_max_adaptation_iterations: pd.NonNegativeInt = ConditionalField(
50,
description="Maximum adaptation iterations for the GAI surface mesher.",
context=SURFACE_MESH,
)

curvature_resolution_angle: AngleType.Positive = ContextField(
12 * u.deg,
description=(
Expand Down Expand Up @@ -200,6 +217,7 @@ class MeshingParams(Flow360BaseModel):
+ "and first layer thickness will be adjusted to generate `r`-times"
+ " finer mesh where r is the refinement_factor value.",
)

gap_treatment_strength: Optional[float] = ContextField(
default=0,
ge=0,
Expand Down
2 changes: 1 addition & 1 deletion flow360/component/simulation/models/solver_numerics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contains basic components(solvers) that composes the `volume` type models.
Each volume model represents a physical phenomena that require a combination of solver features to model.

E.g.
E.g.
NavierStokes, turbulence and transition composes FluidDynamics `volume` type

"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
""" U.S. STANDARD ATMOSPHERE 1976
"""U.S. STANDARD ATMOSPHERE 1976
# https://www.ngdc.noaa.gov/stp/space-weather/online-publications/miscellaneous/us-standard-atmosphere-1976/us-standard-atmosphere_st76-1562_noaa.pdf
Source: design 360
"""
"""

from math import exp

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,16 @@ def SurfaceRefinement_to_faces(obj: SurfaceRefinement, global_max_edge_length):
Translate SurfaceRefinement to faces.

"""
return {
refinement = {
"maxEdgeLength": (
obj.max_edge_length.value.item()
if obj.max_edge_length is not None
else global_max_edge_length.value.item()
),
}
if obj.geometry_accuracy is not None:
refinement["geometry_accuracy"] = obj.geometry_accuracy
return refinement


@preprocess_input
Expand Down
2 changes: 1 addition & 1 deletion flow360/component/types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" Defines 'types' that various fields can be """
"""Defines 'types' that various fields can be"""

from typing import List, Optional, Tuple

Expand Down
3 changes: 1 addition & 2 deletions flow360/component/v1/meshing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
"""meshing parameters
"""
"""meshing parameters"""

from .params import (
Aniso,
Expand Down
2 changes: 1 addition & 1 deletion flow360/plugins/report/report_context.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""
Module for ReportContext to hold shared configurations between Report and ReportItem
"""

Expand Down
Loading