Skip to content
Snippets Groups Projects
Commit 0c0a9c33 authored by Timo Koch's avatar Timo Koch
Browse files

Merge branch 'fix/const-comp-enth' into 'master'

[constantcomponent] Fix liquidEnthalpy

See merge request !2423
parents c8dbc852 7ebb2373
No related branches found
No related tags found
1 merge request!2423[constantcomponent] Fix liquidEnthalpy
...@@ -154,6 +154,19 @@ public: ...@@ -154,6 +154,19 @@ public:
return thermalConductivity; return thermalConductivity;
} }
/*!
* \brief Specific internal energy of the component \f$\mathrm{[J/kg]}\f$ as a liquid.
* \param temperature temperature of phase in \f$\mathrm{[K]}\f$
* \param pressure pressure of phase in \f$\mathrm{[Pa]}\f$
*/
static Scalar liquidInternalEnergy(Scalar temperature, Scalar pressure)
{
// u = c * dT for incompressible fluids
const Scalar heatCapacity = liquidHeatCapacity(temperature, pressure);
static const Scalar tRef = getParamFromGroup<Scalar>(std::to_string(id), "Component.ReferenceTemperature", 293.15);
return heatCapacity * (temperature - tRef);
}
/*! /*!
* \brief Specific enthalpy of the component \f$\mathrm{[J/kg]}\f$ as a liquid. * \brief Specific enthalpy of the component \f$\mathrm{[J/kg]}\f$ as a liquid.
* *
...@@ -162,8 +175,9 @@ public: ...@@ -162,8 +175,9 @@ public:
*/ */
static Scalar liquidEnthalpy(Scalar temperature, Scalar pressure) static Scalar liquidEnthalpy(Scalar temperature, Scalar pressure)
{ {
static const Scalar enthalpy = getParamFromGroup<Scalar>(std::to_string(id), "Component.LiquidEnthalpy"); const Scalar u = liquidInternalEnergy(temperature, pressure);
return enthalpy; const Scalar rho = liquidDensity(temperature, pressure);
return u + pressure / rho;
} }
/*! /*!
......
...@@ -64,6 +64,12 @@ dumux_add_test(NAME plot_ch4 ...@@ -64,6 +64,12 @@ dumux_add_test(NAME plot_ch4
CMD_ARGS "CH4" CMD_ARGS "CH4"
LABELS unit material) LABELS unit material)
dumux_add_test(NAME plot_constantcomponent
TARGET plot_component
COMMAND ./plot_component
CMD_ARGS "Constant"
LABELS unit material)
dumux_add_test(NAME plot_chlorideion dumux_add_test(NAME plot_chlorideion
TARGET plot_component TARGET plot_component
COMMAND ./plot_component COMMAND ./plot_component
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <dumux/material/components/carbonateion.hh> #include <dumux/material/components/carbonateion.hh>
#include <dumux/material/components/ch4.hh> #include <dumux/material/components/ch4.hh>
#include <dumux/material/components/chlorideion.hh> #include <dumux/material/components/chlorideion.hh>
#include <dumux/material/components/constant.hh>
#include <dumux/material/components/co2.hh> #include <dumux/material/components/co2.hh>
#include <dumux/material/components/glucose.hh> #include <dumux/material/components/glucose.hh>
#include <dumux/material/components/granite.hh> #include <dumux/material/components/granite.hh>
...@@ -365,6 +366,21 @@ int main(int argc, char *argv[]) ...@@ -365,6 +366,21 @@ int main(int argc, char *argv[])
plotStuff< Components::CH4<double> >(openPlotWindow); plotStuff< Components::CH4<double> >(openPlotWindow);
else if (compName == "ChlorideIon") else if (compName == "ChlorideIon")
plotStuff< Components::ChlorideIon<double> >(openPlotWindow); plotStuff< Components::ChlorideIon<double> >(openPlotWindow);
else if (compName == "Constant")
{
Parameters::init([](auto& params){
params["Component.LiquidDensity"] = "1e3";
params["Component.LiquidKinematicViscosity"] = "1e-3";
params["Component.LiquidThermalConductivity"] = "0.679";
params["Component.LiquidHeatCapacity"] = "4.2e3";
params["Component.GasDensity"] = "1";
params["Component.GasKinematicViscosity"] = "1";
params["Component.SolidDensity"] = "1e3";
params["Component.SolidThermalConductivity"] = "0.679";
params["Component.SolidHeatCapacity"] = "4.2e3";
});
plotStuff< Components::Constant<1, double> >(openPlotWindow);
}
else if (compName == "Glucose") else if (compName == "Glucose")
plotStuff< Components::Glucose<double> >(openPlotWindow); plotStuff< Components::Glucose<double> >(openPlotWindow);
else if (compName == "Granite") else if (compName == "Granite")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment