Skip to content

[SCFD-3899] Added support for mach reynolds input in Aerospace condition #961

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 24 commits into from
May 28, 2025

Conversation

wiktor-flex
Copy link
Collaborator

Changed operating_condition_from_mach_reynolds function from a standalone one to a classmethod of AerospaceCondition. so that it utilizes MultiConstructorBaseModel.

@wiktor-flex wiktor-flex self-assigned this Apr 28, 2025
@wiktor-flex wiktor-flex force-pushed the wiktor/mach_reynolds branch from 77ccfd9 to 1140140 Compare April 28, 2025 16:39
@piotrkluba piotrkluba requested a review from angranl-flex April 29, 2025 14:39
@benflexcompute
Copy link
Collaborator

This is not a complete fix since for existing simulation.json on S3 cloud, we still store the key-None pairs in private_attribute_input_cache and this PR does not fix that. We need to add None popper in the parse_model_dict() too.

Also like I mentioned above. Let's not merge this to 25.2 for now since it is a public version. model_dump fix may introduce bugs.

I asked @angranl-flex to add the None-popper in an dedicated PR. We can merge this into develop + 25.5 branch

@wiktor-flex wiktor-flex requested a review from benflexcompute May 1, 2025 10:50
@benflexcompute
Copy link
Collaborator

Let's ensure the Reynolds is consistent with Solver definition. @wiktor-flex Could you also update the definition here?

def flow360_reynolds_number(self, length_unit: LengthType.Positive):

@wiktor-flex
Copy link
Collaborator Author

I did hand calculation for
AerospaceCondition.from_mach_reynolds( mach=0.2, reynolds=5e6, temperature=288.15 * u.K, alpha=2.0 * u.deg, beta=0.0 * u.deg, project_length_unit=u.m )
and got matching results. I followed the equations piece by piece, starting from calculating dynamic viscosity from Sutherland, then freestream speed of sound, freestream velocity and finally density.
My results:
dynamic viscosity = 1.789297e-5 Pa*s
speed of sound = 340.294 m/s
velocity = 68.0588 m/s
density = 1.314523 kg/m^3

@wiktor-flex wiktor-flex merged commit 962fc43 into develop May 28, 2025
15 checks passed
@wiktor-flex wiktor-flex deleted the wiktor/mach_reynolds branch May 28, 2025 14:24
github-actions bot pushed a commit that referenced this pull request May 28, 2025
…ion (#961)

* added operating condition from mach reynolds to aerospacecondition

* black and isort

* made exclude_none default in model_dump

* fixed test

* fixed solver translator unittests

* Revert "fixed solver translator unittests"

This reverts commit 1140140.

* Revert "fixed test"

This reverts commit 4137165.

* Revert "made exclude_none default in model_dump"

This reverts commit 5ece895.

* added removing none fields for multi constructor model

* small function name change to be more clear

* Revert "small function name change to be more clear"

This reverts commit 38358f9.

* Revert "added removing none fields for multi constructor model"

This reverts commit bae5e3d.

* fixed conflicts in unittest

* black

* removed space for consistency

* changed density to be calculated from mach and not mach ref

* changed reynolds number function to be consistent with solver

* added empty line so that list builds correctly

* added backslashes to make infty symboo

---------

Co-authored-by: Maciej Skarysz <maciej@flexcompute.com>
Co-authored-by: Ben <106089368+benflexcompute@users.noreply.github.com>
github-actions bot pushed a commit that referenced this pull request May 28, 2025
…ion (#961)

* added operating condition from mach reynolds to aerospacecondition

* black and isort

* made exclude_none default in model_dump

* fixed test

* fixed solver translator unittests

* Revert "fixed solver translator unittests"

This reverts commit 1140140.

* Revert "fixed test"

This reverts commit 4137165.

* Revert "made exclude_none default in model_dump"

This reverts commit 5ece895.

* added removing none fields for multi constructor model

* small function name change to be more clear

* Revert "small function name change to be more clear"

This reverts commit 38358f9.

* Revert "added removing none fields for multi constructor model"

This reverts commit bae5e3d.

* fixed conflicts in unittest

* black

* removed space for consistency

* changed density to be calculated from mach and not mach ref

* changed reynolds number function to be consistent with solver

* added empty line so that list builds correctly

* added backslashes to make infty symboo

---------

Co-authored-by: Maciej Skarysz <maciej@flexcompute.com>
Co-authored-by: Ben <106089368+benflexcompute@users.noreply.github.com>
wiktor-flex added a commit that referenced this pull request May 28, 2025
…ion (#961)

* added operating condition from mach reynolds to aerospacecondition

* black and isort

* made exclude_none default in model_dump

* fixed test

* fixed solver translator unittests

* Revert "fixed solver translator unittests"

This reverts commit 1140140.

* Revert "fixed test"

This reverts commit 4137165.

* Revert "made exclude_none default in model_dump"

This reverts commit 5ece895.

* added removing none fields for multi constructor model

* small function name change to be more clear

* Revert "small function name change to be more clear"

This reverts commit 38358f9.

* Revert "added removing none fields for multi constructor model"

This reverts commit bae5e3d.

* fixed conflicts in unittest

* black

* removed space for consistency

* changed density to be calculated from mach and not mach ref

* changed reynolds number function to be consistent with solver

* added empty line so that list builds correctly

* added backslashes to make infty symboo

---------

Co-authored-by: Maciej Skarysz <maciej@flexcompute.com>
Co-authored-by: Ben <106089368+benflexcompute@users.noreply.github.com>
wiktor-flex added a commit that referenced this pull request May 28, 2025
…ion (#961) (#1103)

* added operating condition from mach reynolds to aerospacecondition

* black and isort

* made exclude_none default in model_dump

* fixed test

* fixed solver translator unittests

* Revert "fixed solver translator unittests"

This reverts commit 1140140.

* Revert "fixed test"

This reverts commit 4137165.

* Revert "made exclude_none default in model_dump"

This reverts commit 5ece895.

* added removing none fields for multi constructor model

* small function name change to be more clear

* Revert "small function name change to be more clear"

This reverts commit 38358f9.

* Revert "added removing none fields for multi constructor model"

This reverts commit bae5e3d.

* fixed conflicts in unittest

* black

* removed space for consistency

* changed density to be calculated from mach and not mach ref

* changed reynolds number function to be consistent with solver

* added empty line so that list builds correctly

* added backslashes to make infty symboo

---------

Co-authored-by: Wiktor <wiktor.krzew@flexcompute.com>
Co-authored-by: Maciej Skarysz <maciej@flexcompute.com>
Co-authored-by: Ben <106089368+benflexcompute@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants