-
Notifications
You must be signed in to change notification settings - Fork 9
feat: wind tunnel farfield Python interface #1582
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
base: main
Are you sure you want to change the base?
Conversation
| common_ghost_surfaces = [ | ||
| GhostSurface(name="windTunnelInlet"), | ||
| GhostSurface(name="windTunnelOutlet"), | ||
| GhostSurface(name="windTunnelLeft"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might overlap with symmetric?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would it overlap?
…ow360 into alexxu/windtunnel-flow360
| "WindTunnelGhostSurface", frozen=True | ||
| ) | ||
| # For frontend: list of floor types that use this boundary patch, or ["all"] | ||
| used_by: List[str] = pd.Field(default_factory=lambda: ["all"], frozen=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we do list of literals to avoid typo etc?
| if floor_string == "FullyMovingFloor": | ||
| return common_ghost_surfaces | ||
| if floor_string == "CentralBelt": | ||
| return common_ghost_surfaces + [WindTunnelGhostSurface(name="windTunnelCentralBelt")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we somehow unify the definition of these surfaces? Otherwise there will be inconsistency for example this line already differs from central_belt() property.
One proposal is to change this function to only return all the surfaces? Do we use it with floor_string not being "all" anywhere?
Then the property functions above would reference here the surface? For example:
@property
def rear_wheel_belts(self) -> WindTunnelGhostSurface:
"""Returns the rear wheel belts for WheelBelts floor type."""
if not isinstance(self.floor_type, WheelBelts):
raise Flow360ValueError(
"Rear wheel belts for wind tunnel farfield "
"is only supported if floor type is `WheelBelts`."
)
return self.get_valid_ghost_surfaces()[2 or some Enum]Or implement what you think is the best.
|
|
||
| @pd.model_validator(mode="after") | ||
| def _validate_wheel_belts_ranges(self): | ||
| # pylint says too many branches if it's combined with the above |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this line.
| ) | ||
| private_attribute_dict: Optional[Dict] = pd.Field(None) | ||
|
|
||
| entities: EntityListAllowingGhost[Surface, WindTunnelGhostSurface] = pd.Field( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to invoke EntityListAllowingGhost? Non of the additonal validators apply here.
| Union[GhostSphere, GhostCircularPlane, WindTunnelGhostSurface], | ||
| pd.Field(discriminator="private_attribute_entity_type_name"), | ||
| ] | ||
| ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comma needed? If not remove.
…ow360 into alexxu/windtunnel-flow360
Python client support for analytic wind tunnel farfield (see https://github.com/flexcompute/compute/pull/2849)
__init__,meshing/params.py, translators,primitives.py, andvalidation/validation_simulation_params.pyto supportWindTunnelFarfieldentity_info.py,models/surface_models.py,outputs/outputs.pyandprimitives.pyto support defining wind tunnel boundaries asWindTunnelGhostSurfaces, which must be handled differently fromGhostSurfacesunit_system.pyfor shared checks