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());
90 template <
typename number>
91 template <
typename ValueType>
94 const ValueType &mass_flux,
95 [[maybe_unused]]
const ValueType &temperature)
const
97 ValueType specific_enthalpy(0.0);
98 if (do_phenomenological_recoil_pressure)
99 specific_enthalpy = compute_phenomenological_specific_enthalpy(temperature);
101 return -(latent_heat_of_evaporation + specific_enthalpy) * mass_flux;
105 template <
typename number>
109 Assert(mass_flux_operator,
110 dealii::ExcMessage(
"To use this function, the class must be constructed with "
111 "setup_internal_mass_flux_operator = true."));
113 if (temperature < activation_temperature)
115 else if (temperature >= boiling_temperature or not ramp_enabled)
116 return compute_evaporative_cooling(
117 mass_flux_operator->local_compute_evaporative_mass_flux(temperature), temperature);
120 return activation_ramp_derivative * (temperature - activation_temperature);
124 template <
typename number>
125 dealii::VectorizedArray<number>
127 const dealii::VectorizedArray<number> &temperature)
const
129 Assert(mass_flux_operator,
130 dealii::ExcMessage(
"To use this function, the class must be constructed with "
131 "setup_internal_mass_flux_operator = true."));
133 return dealii::compare_and_apply_mask<dealii::SIMDComparison::less_than>(
135 activation_temperature,
137 dealii::compare_and_apply_mask<dealii::SIMDComparison::greater_than_or_equal>(
139 ramp_enabled ? boiling_temperature : activation_temperature,
140 compute_evaporative_cooling(
141 mass_flux_operator->local_compute_evaporative_mass_flux_vec(temperature), temperature),
142 activation_ramp_derivative * (temperature - activation_temperature)));
146 template <
typename number>
147 template <
typename ValueType>
150 [[maybe_unused]]
const ValueType &mass_flux)
const
152 if (do_phenomenological_recoil_pressure)
153 return -specific_heat_capacity * mass_flux;
159 template <
typename number>
163 const number temperature)
const
165 Assert(mass_flux_operator,
166 dealii::ExcMessage(
"To use this function, the class must be constructed with "
167 "setup_internal_mass_flux_operator = true."));
169 if (temperature < activation_temperature)
171 else if (temperature >= boiling_temperature or not ramp_enabled)
173 const auto mass_flux_derivative =
174 mass_flux_operator->local_compute_evaporative_mass_flux_derivative(temperature);
175 if (do_phenomenological_recoil_pressure)
176 return -specific_heat_capacity *
177 mass_flux_operator->local_compute_evaporative_mass_flux(temperature) -
178 (latent_heat_of_evaporation +
179 compute_phenomenological_specific_enthalpy(temperature)) *
180 mass_flux_derivative;
182 return -specific_heat_capacity * mass_flux_derivative;
185 return activation_ramp_derivative;
189 template <
typename number>
190 dealii::VectorizedArray<number>
193 const dealii::VectorizedArray<number> &temperature)
const
195 Assert(mass_flux_operator,
196 dealii::ExcMessage(
"To use this function, the class must be constructed with "
197 "setup_internal_mass_flux_operator = true."));
199 return dealii::compare_and_apply_mask<dealii::SIMDComparison::less_than>(
201 activation_temperature,
203 dealii::compare_and_apply_mask<dealii::SIMDComparison::greater_than_or_equal>(
205 ramp_enabled ? boiling_temperature : activation_temperature,
206 (do_phenomenological_recoil_pressure) ?
207 -specific_heat_capacity *
208 mass_flux_operator->local_compute_evaporative_mass_flux_vec(temperature) -
209 (latent_heat_of_evaporation + compute_phenomenological_specific_enthalpy(temperature)) *
210 mass_flux_operator->local_compute_evaporative_mass_flux_vec_derivative(temperature) :
211 -specific_heat_capacity *
212 mass_flux_operator->local_compute_evaporative_mass_flux_vec_derivative(temperature),
213 activation_ramp_derivative));
216 template <
typename number>
217 template <
typename ValueType>
220 const ValueType &temperature)
const
222 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:162
ValueType compute_phenomenological_specific_enthalpy(const ValueType &temperature) const
Definition evaporative_cooling.templates.hpp:219
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:149
ValueType compute_evaporative_cooling(const ValueType &mass_flux, const ValueType &temperature) const
Definition evaporative_cooling.templates.hpp:93
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:19
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