Skip to content

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

Merged
wiktor-flex merged 24 commits intodevelopfrom
wiktor/mach_reynolds
May 28, 2025
Merged

[SCFD-3899] Added support for mach reynolds input in Aerospace condition#961
wiktor-flex merged 24 commits intodevelopfrom
wiktor/mach_reynolds

Conversation

@wiktor-flex
Copy link
Contributor

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
Contributor 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 <[email protected]>
Co-authored-by: Ben <[email protected]>
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 <[email protected]>
Co-authored-by: Ben <[email protected]>
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 <[email protected]>
Co-authored-by: Ben <[email protected]>
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 <[email protected]>
Co-authored-by: Maciej Skarysz <[email protected]>
Co-authored-by: Ben <[email protected]>
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