fix: align PNL0003 Reynolds diagnostic with AMESim
This commit is contained in:
1 parent
60b743dd81
commit
27f9f4add8
5 files changed
+100
-3
No files matched your search
@@ -1,9 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import unittest
|
||||
from math import log10, sqrt
|
||||
from math import log10, pi, sqrt
|
||||
|
||||
from app.simulation.components.amesim.flow.pipes import AmesimPnl0002, AmesimPnl0003
|
||||
from app.simulation.components.amesim.media.mediums import (
|
||||
AmesimHeliumPengRobinsonMedium,
|
||||
)
|
||||
from app.simulation.core.medium import IdealGasMedium
|
||||
from app.simulation.registry import COMPONENT_MODEL_REGISTRY
|
||||
|
||||
@@ -462,6 +465,33 @@ class AmesimPnl0003ComponentTests(unittest.TestCase):
|
||||
self.assertIn("dmctr", values)
|
||||
self.assertIn("re", values)
|
||||
|
||||
def test_reported_reynolds_uses_amesim_helium_nasa_viscosity_only(self) -> None:
|
||||
medium = AmesimHeliumPengRobinsonMedium()
|
||||
pipe = AmesimPnl0003("pnl_3", medium, diam=0.02)
|
||||
mass_flow = 0.04555349965141288
|
||||
upstream_temperature = 233.92077861710192
|
||||
|
||||
# Frozen AMESim dense row: t=0.81 s, branch 2, D=0.02 m.
|
||||
expected_amesim_reynolds = 172298.96343252173
|
||||
reported = pipe.reported_reynolds_number(
|
||||
mass_flow,
|
||||
upstream_temperature,
|
||||
)
|
||||
dynamic = pipe.reynolds_number(mass_flow, upstream_temperature)
|
||||
|
||||
self.assertAlmostEqual(reported, expected_amesim_reynolds, delta=1.0e-9)
|
||||
self.assertNotAlmostEqual(reported, dynamic, delta=1.0)
|
||||
self.assertAlmostEqual(
|
||||
dynamic,
|
||||
4.0
|
||||
* abs(mass_flow)
|
||||
/ (
|
||||
pi
|
||||
* pipe.diam
|
||||
* medium.dynamic_viscosity(upstream_temperature)
|
||||
),
|
||||
)
|
||||
|
||||
def test_result_cm_excludes_center_resistance_flow_coefficient(self) -> None:
|
||||
pipe = AmesimPnl0003(
|
||||
"pnl_3",
|
||||
|
||||
Reference in new issue
Block a user