6#include <deal.II/base/exceptions.h>
15 template <
typename number>
18 const bool setup_internal_mass_flux_operator)
19 : do_phenomenological_recoil_pressure(
20 evapor_data.evaporative_cooling.consider_enthalpy_transport_vapor_mass_flux ==
"true")
21 , latent_heat_of_evaporation(material_data.latent_heat_of_evaporation)
22 , specific_heat_capacity(material_data.
liquid.specific_heat_capacity)
23 , specific_enthalpy_reference_temperature(material_data.specific_enthalpy_reference_temperature)
24 , boiling_temperature(material_data.boiling_temperature)
25 , ramp_enabled(evapor_data.evaporative_cooling.enable_linear_activation_ramp)
30 "For the phenomenological recoil pressure model, the reference temperature "
31 "for computing the specific enthalpy must be specified. Abort..."));
33 if (setup_internal_mass_flux_operator)
35 if (evapor_data.evaporative_mass_flux_model == EvaporationModelType::recoil_pressure)
43 else if (evapor_data.evaporative_mass_flux_model ==
44 EvaporationModelType::saturated_vapor_pressure)
52 else if (evapor_data.evaporative_mass_flux_model == EvaporationModelType::pressure_aware)
55 evapor_data.pressure_aware,
61 AssertThrow(
false, dealii::ExcNotImplemented());
86 template <
typename number>
87 template <
typename ValueType>
90 const ValueType &mass_flux,
91 [[maybe_unused]]
const ValueType &temperature)
const
93 ValueType specific_enthalpy(0.0);
94 if (do_phenomenological_recoil_pressure)
95 specific_enthalpy = compute_phenomenological_specific_enthalpy(temperature);
97 return -(latent_heat_of_evaporation + specific_enthalpy) * mass_flux;
101 template <
typename number>
105 Assert(mass_flux_operator,
106 dealii::ExcMessage(
"To use this function, the class must be constructed with "
107 "setup_internal_mass_flux_operator = true."));
109 if (temperature < activation_temperature)
111 else if (temperature >= boiling_temperature or not ramp_enabled)
112 return compute_evaporative_cooling(
113 mass_flux_operator->local_compute_evaporative_mass_flux(temperature), temperature);
116 return activation_ramp_derivative * (temperature - activation_temperature);
120 template <
typename number>
121 dealii::VectorizedArray<number>
123 const dealii::VectorizedArray<number> &temperature)
const
125 Assert(mass_flux_operator,
126 dealii::ExcMessage(
"To use this function, the class must be constructed with "
127 "setup_internal_mass_flux_operator = true."));
129 return dealii::compare_and_apply_mask<dealii::SIMDComparison::less_than>(
131 activation_temperature,
133 dealii::compare_and_apply_mask<dealii::SIMDComparison::greater_than_or_equal>(
135 ramp_enabled ? boiling_temperature : activation_temperature,
136 compute_evaporative_cooling(
137 mass_flux_operator->local_compute_evaporative_mass_flux_vec(temperature), temperature),
138 activation_ramp_derivative * (temperature - activation_temperature)));
142 template <
typename number>
143 template <
typename ValueType>
146 [[maybe_unused]]
const ValueType &mass_flux)
const
148 if (do_phenomenological_recoil_pressure)
149 return -specific_heat_capacity * mass_flux;
155 template <
typename number>
159 const number temperature)
const
161 Assert(mass_flux_operator,
162 dealii::ExcMessage(
"To use this function, the class must be constructed with "
163 "setup_internal_mass_flux_operator = true."));
165 if (temperature < activation_temperature)
167 else if (temperature >= boiling_temperature or not ramp_enabled)
169 const auto mass_flux_derivative =
170 mass_flux_operator->local_compute_evaporative_mass_flux_derivative(temperature);
171 if (do_phenomenological_recoil_pressure)
172 return -specific_heat_capacity *
173 mass_flux_operator->local_compute_evaporative_mass_flux(temperature) -
174 (latent_heat_of_evaporation +
175 compute_phenomenological_specific_enthalpy(temperature)) *
176 mass_flux_derivative;
178 return -specific_heat_capacity * mass_flux_derivative;
181 return activation_ramp_derivative;
185 template <
typename number>
186 dealii::VectorizedArray<number>
189 const dealii::VectorizedArray<number> &temperature)
const
191 Assert(mass_flux_operator,
192 dealii::ExcMessage(
"To use this function, the class must be constructed with "
193 "setup_internal_mass_flux_operator = true."));
195 return dealii::compare_and_apply_mask<dealii::SIMDComparison::less_than>(
197 activation_temperature,
199 dealii::compare_and_apply_mask<dealii::SIMDComparison::greater_than_or_equal>(
201 ramp_enabled ? boiling_temperature : activation_temperature,
202 (do_phenomenological_recoil_pressure) ?
203 -specific_heat_capacity *
204 mass_flux_operator->local_compute_evaporative_mass_flux_vec(temperature) -
205 (latent_heat_of_evaporation + compute_phenomenological_specific_enthalpy(temperature)) *
206 mass_flux_operator->local_compute_evaporative_mass_flux_vec_derivative(temperature) :
207 -specific_heat_capacity *
208 mass_flux_operator->local_compute_evaporative_mass_flux_vec_derivative(temperature),
209 activation_ramp_derivative));
212 template <
typename number>
213 template <
typename ValueType>
216 const ValueType &temperature)
const
218 return specific_heat_capacity * (temperature - specific_enthalpy_reference_temperature);
const bool do_phenomenological_recoil_pressure
Definition evaporative_cooling.hpp:132
number activation_temperature
Definition evaporative_cooling.hpp:137
EvaporativeCooling(const EvaporationData< number > &evapor_data, const MaterialData< number > &material_data, const bool setup_internal_mass_flux_operator=false)
Definition evaporative_cooling.templates.hpp:16
number compute_evaporative_cooling_derivative_with_temperature_dependent_mass_flux(const number temperature) const
Definition evaporative_cooling.templates.hpp:158
ValueType compute_phenomenological_specific_enthalpy(const ValueType &temperature) const
Definition evaporative_cooling.templates.hpp:215
number activation_ramp_derivative
Definition evaporative_cooling.hpp:139
std::unique_ptr< EvaporationModelBase< number > > mass_flux_operator
Definition evaporative_cooling.hpp:140
ValueType compute_evaporative_cooling_derivative_constant_mass_flux(const ValueType &mass_flux) const
Definition evaporative_cooling.templates.hpp:145
ValueType compute_evaporative_cooling(const ValueType &mass_flux, const ValueType &temperature) const
Definition evaporative_cooling.templates.hpp:89
const number specific_enthalpy_reference_temperature
Definition evaporative_cooling.hpp:135
bool ramp_enabled
Definition evaporative_cooling.hpp:138
Definition evaporation_data.hpp:15
bool is_invalid(const double &number)
Definition numbers.hpp:16
Definition material_data.hpp:84
number molar_mass
Definition material_data.hpp:109
number boiling_temperature
Definition material_data.hpp:107
number latent_heat_of_evaporation
Definition material_data.hpp:108