From efacd67f1f26ee2d571ee6474bcb4f0657ca2cb8 Mon Sep 17 00:00:00 2001 From: Sylwester Arabas Date: Sun, 30 Jul 2023 12:49:31 +0200 Subject: [PATCH] use formulae rho fun when for initial air density. closes #1108 --- examples/PySDM_examples/Pyrcel/settings.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/examples/PySDM_examples/Pyrcel/settings.py b/examples/PySDM_examples/Pyrcel/settings.py index 12838a2e3..0320bc4fb 100644 --- a/examples/PySDM_examples/Pyrcel/settings.py +++ b/examples/PySDM_examples/Pyrcel/settings.py @@ -42,15 +42,12 @@ def __init__( @property def initial_air_density(self): - const = self.formulae.constants - dry_air_density = ( - self.formulae.trivia.p_d( + return self.formulae.state_variable_triplet.rho_of_rhod_qv( + rhod=self.formulae.trivia.p_d( self.initial_pressure, self.initial_vapour_mixing_ratio - ) - / self.initial_temperature - / const.Rd + ) / self.initial_temperature / self.formulae.constants.Rd, + qv=self.initial_vapour_mixing_ratio ) - return dry_air_density * (1 + self.initial_vapour_mixing_ratio) @property def nt(self) -> int: