Commit 2358d070 authored by Christian Silbermann's avatar Christian Silbermann
Browse files

Renaming phase_change_spread > steepness, latent_melting_heat > specific_latent_heat

parent c2bdbe43
/**
* \file
* \copyright
* Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
* Copyright (c) 2012-2022, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
......@@ -28,12 +28,12 @@ createSpecificHeatCapacityWithLatentHeat(BaseLib::ConfigTree const& config)
DBUG("Create temperature dependent specific heat capacity {:s}.",
property_name);
auto const L =
//! \ogs_file_param{properties__property__SpecificHeatCapacityWithLatentHeat__latent_melting_heat}
config.getConfigParameter<double>("latent_melting_heat");
auto const l =
//! \ogs_file_param{properties__property__SpecificHeatCapacityWithLatentHeat__specific_latent_heat}
config.getConfigParameter<double>("specific_latent_heat");
return std::make_unique<
MaterialPropertyLib::SpecificHeatCapacityWithLatentHeat>(
std::move(property_name), L);
std::move(property_name), l);
}
} // namespace MaterialPropertyLib
/**
* \file
* \copyright
* Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
* Copyright (c) 2012-2022, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
......
/**
* \file
* \copyright
* Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
* Copyright (c) 2012-2022, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
......@@ -26,8 +26,8 @@ createTemperatureDependentFraction(BaseLib::ConfigTree const& config)
property_name);
auto const k =
//! \ogs_file_param{properties__property__TemperatureDependentFraction__phase_change_spread}
config.getConfigParameter<double>("phase_change_spread");
//! \ogs_file_param{properties__property__TemperatureDependentFraction__steepness}
config.getConfigParameter<double>("steepness");
auto const T_c =
//! \ogs_file_param{properties__property__TemperatureDependentFraction__characteristic_temperature}
......
/**
* \file
* \copyright
* Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
* Copyright (c) 2012-2022, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
......
/**
* \file
* \copyright
* Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
* Copyright (c) 2012-2022, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
......
/**
* \file
* \copyright
* Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
* Copyright (c) 2012-2022, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
......
......@@ -16,8 +16,8 @@
namespace MaterialPropertyLib
{
SpecificHeatCapacityWithLatentHeat::SpecificHeatCapacityWithLatentHeat(
std::string name, double const L)
: L_(L)
std::string name, double const l)
: l_(l)
{
name_ = std::move(name);
}
......@@ -69,7 +69,7 @@ void SpecificHeatCapacityWithLatentHeat::setProperties(
}
}
double SpecificHeatCapacityWithLatentHeat::mixtureVolumetricHeatCapacity(
double SpecificHeatCapacityWithLatentHeat::effectiveVolumetricHeatCapacity(
VariableArray const& variable_array,
ParameterLib::SpatialPosition const& pos, double const t,
double const dt) const
......@@ -120,8 +120,10 @@ PropertyDataType SpecificHeatCapacityWithLatentHeat::value(
auto const dpfr_dT = frozen_fraction_property.template dValue<double>(
variable_array, Variable::temperature, pos, t, dt);
auto const Cvol = mixtureVolumetricHeatCapacity(variable_array, pos, t, dt);
auto const Cvol_app = Cvol - L_ * rho_ef * dpfr_dT;
auto const Cvol =
effectiveVolumetricHeatCapacity(variable_array, pos, t, dt);
auto const Lvol = l_ * rho_ef;
auto const Cvol_app = Cvol - Lvol * dpfr_dT;
// divide volumetric quantity by density in order to obtain specific value
return Cvol_app / rho_ef;
}
......@@ -158,11 +160,12 @@ PropertyDataType SpecificHeatCapacityWithLatentHeat::dValue(
auto const d2pfr_dT2 = frozen_fraction_property.template d2Value<double>(
variable_array, Variable::temperature, Variable::temperature, pos, t,
dt);
auto const Cvol = mixtureVolumetricHeatCapacity(variable_array, pos, t, dt);
auto const Cvol =
effectiveVolumetricHeatCapacity(variable_array, pos, t, dt);
// TODO: avoid duplicate code, call value()?
auto const C_app = (Cvol - L_ * rho_ef * dpfr_dT) / rho_ef;
auto const C_app = (Cvol - l_ * rho_ef * dpfr_dT) / rho_ef;
auto const dCvol_dpfr = rho_fr * c_fr - rho_li * c_li;
auto const dCvol_app_dT = dCvol_dpfr * dpfr_dT - L_ * rho_ef * d2pfr_dT2;
auto const dCvol_app_dT = dCvol_dpfr * dpfr_dT - l_ * rho_ef * d2pfr_dT2;
return (dCvol_app_dT - drho_dT / rho_ef * C_app) / rho_ef;
}
......
......@@ -25,6 +25,7 @@ namespace MaterialPropertyLib
* \f[
* C_{\mathrm{app}} = \left[C - \varrho \ell \frac{\partial
* \phi_\mathrm{f}}{\partial T} \right]
* \quad\rightarrow\quad c_{\mathrm{app}} = \frac{C_{\mathrm{app}}}{\varrho}
* \f]
*
* with \f$\ell\f$ as specific enthalpy of melting, \f$C\f$ as effective
......@@ -42,7 +43,7 @@ class SpecificHeatCapacityWithLatentHeat final : public Property
};
public:
SpecificHeatCapacityWithLatentHeat(std::string name, double const L);
SpecificHeatCapacityWithLatentHeat(std::string name, double const l);
void checkScale() const override;
......@@ -50,7 +51,7 @@ public:
void setProperties(
std::vector<std::unique_ptr<Phase>> const& phases) override;
double mixtureVolumetricHeatCapacity(
double effectiveVolumetricHeatCapacity(
VariableArray const& variable_array,
ParameterLib::SpatialPosition const& pos,
double const t,
......@@ -68,8 +69,7 @@ public:
double const dt) const override;
private:
double const L_; //< Latent heat of melting (enthalpy of the first order
// phase change).
double const l_; //< specific latent heat of melting
/// Pointers to the properties in each phase.
PhaseProperties densities_;
......
......@@ -32,9 +32,10 @@ namespace MaterialPropertyLib
* \frac{\phi}{1 + \exp(k(T - T_\mathrm{c}))}
* \f]
*
* Parameter \f$k\f$ controlling the temperature spreading of the phase change
* and \f$T_\mathrm{c}\f$ as the characteristic temperature of the phase change
* (melting temperature) are forwarded to a sigmoid function.
* Parameter \f$k\f$ controlling the steepness of the phase change
* and \f$T_\mathrm{c}\f$ as the characteristic temperature where
* the phase change is centered around (melting temperature)
* are forwarded to a sigmoid function.
*
**/
class TemperatureDependentFraction final : public Property
......
......@@ -28,8 +28,9 @@ namespace MaterialPropertyLib
* \f]
*
* where \f$T_\mathrm{c}\f$ is the critical value (e.g. a phase change
* temperature). Letting the slope parameter \f$k\f$ go to infinity,
* the heaviside step function is obtained.
* temperature). The parameter \f$k\f$ is proportional to the slope at
* the characteristic value and controls thus the steepness. Letting
* \f$k\f$ go to infinity, the heaviside step function is obtained.
*
*/
class SigmoidFunction final
......@@ -44,7 +45,7 @@ public:
double d2Value(double const& T) const;
private:
double const k_; //< factor controlling the spreading
double const k_; //< steepness (slope parameter)
double const T_c_; //< characteristic value
// (location of the step)
};
......
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--units: kg, m, s, K and derived units: N, Pa=N/m, Da=m -->
<!--units: kg, m, s, K and derived units: N, Pa=N/m, Da=m -->
<OpenGeoSysProject>
<meshes>
<mesh>mesh.vtu</mesh>
......@@ -39,7 +39,7 @@
<property>
<name>density</name>
<type>Constant</type>
<value>1000</value> <!--kg/m-->
<value>1000</value> <!--kg/m-->
</property>
</properties>
</phase>
......@@ -60,7 +60,7 @@
<property>
<name>density</name>
<type>Constant</type>
<value>900</value> <!--kg/m-->
<value>900</value> <!--kg/m-->
</property>
</properties>
</phase>
......@@ -81,7 +81,7 @@
<property>
<name>density</name>
<type>Constant</type>
<value>0</value> <!--kg/m-->
<value>0</value> <!--kg/m-->
</property>
</properties>
</phase>
......@@ -95,7 +95,7 @@
<property>
<name>volume_fraction</name>
<type>TemperatureDependentFraction</type>
<phase_change_spread>5</phase_change_spread> <!-- 1/K -->
<steepness>5</steepness> <!-- 1/K -->
<characteristic_temperature>273.15</characteristic_temperature> <!-- K -->
</property>
<property>
......@@ -109,7 +109,7 @@
<property>
<name>specific_heat_capacity</name>
<type>SpecificHeatCapacityWithLatentHeat</type>
<latent_melting_heat>334000</latent_melting_heat> <!-- J/kg-->
<specific_latent_heat>334000</specific_latent_heat> <!-- J/kg-->
</property>
</properties>
</medium>
......
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--units: kg, m, s, K and derived units: N, Pa=N/m, Da=m -->
<!--units: kg, m, s, K and derived units: N, Pa=N/m, Da=m -->
<OpenGeoSysProject>
<meshes>
<mesh>mesh1FE.vtu</mesh>
......@@ -41,7 +41,7 @@
<property>
<name>density</name>
<type>Constant</type>
<value>1000</value> <!--kg/m-->
<value>1000</value> <!--kg/m-->
</property>
</properties>
</phase>
......@@ -62,7 +62,7 @@
<property>
<name>density</name>
<type>Constant</type>
<value>900</value> <!--kg/m-->
<value>900</value> <!--kg/m-->
</property>
</properties>
</phase>
......@@ -83,7 +83,7 @@
<property>
<name>density</name>
<type>Constant</type>
<value>0</value> <!--kg/m-->
<value>0</value> <!--kg/m-->
</property>
</properties>
</phase>
......@@ -97,13 +97,13 @@
<property>
<name>volume_fraction</name>
<type>TemperatureDependentFraction</type>
<phase_change_spread>7</phase_change_spread> <!-- 1/K -->
<steepness>7</steepness> <!-- 1/K -->
<characteristic_temperature>273.15</characteristic_temperature> <!-- K -->
</property>
<property>
<name>density</name>
<type>Constant</type>
<value>1000</value> <!--kg/m-->
<value>1000</value> <!--kg/m-->
<!--<type>VolumeFractionAverage</type>-->
</property>
<property>
......@@ -113,7 +113,7 @@
<property>
<name>specific_heat_capacity</name>
<type>SpecificHeatCapacityWithLatentHeat</type>
<latent_melting_heat>700000</latent_melting_heat> <!-- J/kg-->
<specific_latent_heat>700000</specific_latent_heat> <!-- J/kg-->
</property>
</properties>
</medium>
......@@ -127,7 +127,7 @@
<parameter>
<name>HeatSource</name>
<type>Constant</type>
<value>1</value> <!-- W/m-->
<value>1</value> <!-- W/m-->
</parameter>
</parameters>
<process_variables>
......@@ -166,8 +166,8 @@
<t_initial>0.0</t_initial>
<t_end>700e6</t_end> <!--s-->
<!-- for sufficient heat input: -->
<!-- dE = 1 W/m * 10 m * 700e6 s = 7e9 J -->
<!-- dQ =700 000 J/kg * 10 m * 1000 kg / m = 7e9 J -->
<!-- dE = 1 W/m * 10 m * 700e6 s = 7e9 J -->
<!-- dQ =700 000 J/kg * 10 m * 1000 kg / m = 7e9 J -->
<timesteps>
<pair>
<repeat>350</repeat>
......
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--units: kg, m, s, K and derived units: N, Pa=N/m, Da=m -->
<!--units: kg, m, s, K and derived units: N, Pa=N/m, Da=m -->
<OpenGeoSysProject>
<meshes>
<mesh>fullCircle_domain.vtu</mesh>
......@@ -38,7 +38,7 @@
<property>
<name>density</name>
<type>Constant</type>
<value>1000</value> <!--kg/m-->
<value>1000</value> <!--kg/m-->
</property>
</properties>
</phase>
......@@ -59,7 +59,7 @@
<property>
<name>density</name>
<type>Constant</type>
<value>900</value> <!--kg/m-->
<value>900</value> <!--kg/m-->
</property>
</properties>
</phase>
......@@ -80,7 +80,7 @@
<property>
<name>density</name>
<type>Constant</type>
<value>1030</value> <!--kg/m-->
<value>1030</value> <!--kg/m-->
</property>
</properties>
</phase>
......@@ -94,7 +94,7 @@
<property>
<name>volume_fraction</name>
<type>TemperatureDependentFraction</type>
<phase_change_spread>1</phase_change_spread> <!-- 1/K -->
<steepness>1</steepness> <!-- 1/K -->
<characteristic_temperature>273.15</characteristic_temperature> <!-- K -->
</property>
<property>
......@@ -108,7 +108,7 @@
<property>
<name>specific_heat_capacity</name>
<type>SpecificHeatCapacityWithLatentHeat</type>
<latent_melting_heat>334000</latent_melting_heat> <!-- J/kg-->
<specific_latent_heat>334000</specific_latent_heat> <!-- J/kg-->
</property>
</properties>
</medium>
......
......@@ -11,8 +11,7 @@
#include <gtest/gtest.h>
#include <fstream>
#include <iostream>
#include <sstream>
#include "TestMPL.h"
#include "Tests/TestTools.h"
......@@ -110,8 +109,7 @@ std::unique_ptr<MaterialPropertyLib::Medium> createMyMedium(double L_IW, double
prj << " <property>\n";
prj << " <name>volume_fraction</name>\n";
prj << " <type>TemperatureDependentFraction</type>\n";
prj << " <phase_change_spread>" << water_ice_rock.k
<< "</phase_change_spread>\n";
prj << " <steepness>" << water_ice_rock.k << "</steepness>\n";
prj << " <characteristic_temperature>" << water_ice_rock.T_c
<< "</characteristic_temperature>\n";
prj << " </property>\n";
......@@ -126,7 +124,8 @@ std::unique_ptr<MaterialPropertyLib::Medium> createMyMedium(double L_IW, double
prj << " <property>\n";
prj << " <name>specific_heat_capacity</name>\n";
prj << " <type>SpecificHeatCapacityWithLatentHeat</type>\n";
prj << " <latent_melting_heat>" << L_IW << "</latent_melting_heat>\n";
prj << " <specific_latent_heat>" << L_IW
<< "</specific_latent_heat>\n";
prj << " </property>\n";
prj << " </properties>\n";
prj << "</medium>\n";
......
......@@ -11,8 +11,11 @@
#include <gtest/gtest.h>
#include <sstream>
/* Keep for debugging
#include <iostream>
#include <fstream>
*/
#include "MaterialLib/MPL/Properties/TemperatureDependentFraction.h"
......@@ -40,8 +43,7 @@ std::unique_ptr<MaterialPropertyLib::Medium> createMyMedium()
prj << " <property>\n";
prj << " <name>volume_fraction</name>\n";
prj << " <type>TemperatureDependentFraction</type>\n";
prj << " <phase_change_spread>" << water_ice.k
<< "</phase_change_spread>\n";
prj << " <steepness>" << water_ice.k << "</steepness>\n";
prj << " <characteristic_temperature>" << water_ice.T_c
<< "</characteristic_temperature>\n";
prj << " </property>\n";
......
......@@ -10,9 +10,6 @@
*/
#include <gtest/gtest.h>
#include <fstream>
#include <iostream>
#include <sstream>
#include "MaterialLib/MPL/Utils/FormEigenTensor.h"
......@@ -80,8 +77,7 @@ TEST(MaterialPropertyLib, VolumeFractionAverage_Density)
prj << " <property>\n";
prj << " <name>volume_fraction</name>\n";
prj << " <type>TemperatureDependentFraction</type>\n";
prj << " <phase_change_spread>" << water_ice_rock.k
<< "</phase_change_spread>\n";
prj << " <steepness>" << water_ice_rock.k << "</steepness>\n";
prj << " <characteristic_temperature>" << water_ice_rock.T_c
<< "</characteristic_temperature>\n";
prj << " </property>\n";
......@@ -195,8 +191,7 @@ TEST(MaterialPropertyLib, VolumeFractionAverage_ThermalConductivity)
prj << " <property>\n";
prj << " <name>volume_fraction</name>\n";
prj << " <type>TemperatureDependentFraction</type>\n";
prj << " <phase_change_spread>" << water_ice_rock.k
<< "</phase_change_spread>\n";
prj << " <steepness>" << water_ice_rock.k << "</steepness>\n";
prj << " <characteristic_temperature>" << water_ice_rock.T_c
<< "</characteristic_temperature>\n";
prj << " </property>\n";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment