diff --git a/MaterialLib/Fluid/Density/LinearTemperatureDependentDensity.h b/MaterialLib/Fluid/Density/LinearTemperatureDependentDensity.h index 3d7327d5607c24fed51285689120bc81bbc8d350..dd130b89bb9e3db3d4ad4cbf06008e94fbb80dcd 100644 --- a/MaterialLib/Fluid/Density/LinearTemperatureDependentDensity.h +++ b/MaterialLib/Fluid/Density/LinearTemperatureDependentDensity.h @@ -50,7 +50,7 @@ public: double getValue(const ArrayType& var_vals) const override { const double T = var_vals[static_cast<int>(PropertyVariableType::T)]; - return _rho0 * (1 + _beta * (T - _temperature0)); + return _rho0 * (1 - _beta * (T - _temperature0)); } /// Get the partial differential of the density with respect to temperature. @@ -62,7 +62,7 @@ public: { (void)var_vals; (void)var; - return _rho0 * _beta; + return - _rho0 * _beta; } private: diff --git a/Tests/MaterialLib/TestFluidDensity.cpp b/Tests/MaterialLib/TestFluidDensity.cpp index 4e592cc3892bd44124b98584abf8ee1752d44aa8..6c0785fd1ba60581c27dea29d5326673ce3a3606 100644 --- a/Tests/MaterialLib/TestFluidDensity.cpp +++ b/Tests/MaterialLib/TestFluidDensity.cpp @@ -91,9 +91,9 @@ TEST(Material, checkLinearTemperatureDependentDensity) ArrayType vars; vars[0] = 273.1; - ASSERT_NEAR(1000.0 * (1 + 4.3e-4 * (vars[0] - 293.0)), rho->getValue(vars), + ASSERT_NEAR(1000.0 * (1 - 4.3e-4 * (vars[0] - 293.0)), rho->getValue(vars), 1.e-10); - ASSERT_NEAR(1000.0 * 4.3e-4, + ASSERT_NEAR(-1000.0 * 4.3e-4, rho->getdValue(vars, Fluid::PropertyVariableType::T), 1.e-10); } diff --git a/Tests/MaterialLib/TestFluidProperties.cpp b/Tests/MaterialLib/TestFluidProperties.cpp index 0cf7851693a87786b96d975468c484bcd117e1ed..e89905b4f9ce962746325ae3780aeee53dc5ce41 100644 --- a/Tests/MaterialLib/TestFluidProperties.cpp +++ b/Tests/MaterialLib/TestFluidProperties.cpp @@ -70,10 +70,10 @@ TEST(MaterialFluidProperties, checkPrimaryVariableDependentFluidProperties) 1.e-10); vars[0] = 273.1; - ASSERT_NEAR(1000.0 * (1 + 4.3e-4 * (vars[0] - 293.0)), + ASSERT_NEAR(1000.0 * (1 - 4.3e-4 * (vars[0] - 293.0)), fluid_model->getValue(FluidPropertyType::Density, vars), 1.e-10); - ASSERT_NEAR(1000.0 * 4.3e-4, + ASSERT_NEAR(-1000.0 * 4.3e-4, fluid_model->getdValue(FluidPropertyType::Density, vars, Fluid::PropertyVariableType::T), 1.e-10); @@ -86,7 +86,7 @@ TEST(MaterialFluidProperties, checkFluidPropertiesWithDensityDependentModels_T) " <density>" " <type>TemperatureDependent</type>" " <temperature0> 293.0 </temperature0> " - " <beta> 2.5003219164466073e-05 </beta> " + " <beta> -2.5003219164466073e-05 </beta> " " <rho0> 998.</rho0>" " </density>" " <viscosity>"