4#ifndef lethe_evaporation_model_h
5#define lethe_evaporation_model_h
53 static std::shared_ptr<EvaporationModel>
74 mass_flux(
const std::map<field, double> &field_values) = 0;
86 std::vector<double> &mass_flux_vector) = 0;
95 heat_flux(
const std::map<field, double> &field_values) = 0;
107 std::vector<double> &heat_flux_vector) = 0;
137 std::vector<double> &jacobian_vector) = 0;
158 std::vector<double> &momentum_flux_vector) = 0;
187 const std::map<
field, std::vector<double>> &field_vectors,
189 std::vector<double> &jacobian_vector) = 0;
238 std::vector<double> &mass_flux_vector)
override
265 std::vector<double> &heat_flux_vector)
override
267 std::ranges::fill(heat_flux_vector,
283 const field )
override
301 const std::map<
field, std::vector<double>> & ,
303 std::vector<double> &jacobian_vector)
override
305 std::ranges::fill(jacobian_vector, 0);
331 std::vector<double> &momentum_flux_vector)
override
333 const double momentum_flux_value =
337 std::ranges::fill(momentum_flux_vector, momentum_flux_value);
352 const field )
override
370 const std::map<
field, std::vector<double>> & ,
372 std::vector<double> &jacobian_vector)
override
374 std::ranges::fill(jacobian_vector, 0);
416 PhysicialPropertyModelFieldUndefined(
"EvaporationModelTemperature",
418 const double temperature_inv =
423 const double L_vap_x_M_x_R_inv =
427 std::exp(-L_vap_x_M_x_R_inv *
441 std::vector<double> &saturation_pressure_vector)
444 PhysicialPropertyModelFieldUndefined(
"EvaporationModelTemperature",
451 const double L_vap_x_M_x_R_inv =
454 const unsigned int n_pts = saturation_pressure_vector.size();
456 for (
unsigned int i = 0; i < n_pts; ++i)
458 const double temperature_inv = 1.0 / (
temperature[i] + 1e-16);
460 saturation_pressure_vector[i] =
462 std::exp(-L_vap_x_M_x_R_inv *
474 mass_flux(
const std::map<field, double> &field_values)
override
477 const double temperature_inv =
481 const double M_x_2PI_inv_x_R_inv =
molar_mass / (2.0 * M_PI) * R_inv;
483 const double mass_flux_value =
485 std::sqrt(M_x_2PI_inv_x_R_inv * temperature_inv);
487 return mass_flux_value;
500 std::vector<double> &mass_flux_vector)
override
503 PhysicialPropertyModelFieldUndefined(
"EvaporationModelTemperature",
509 const double M_x_2PI_inv_x_R_inv =
molar_mass / (2.0 * M_PI) * R_inv;
511 const unsigned int n_pts = mass_flux_vector.size();
513 std::vector<double> saturation_pressure_vector(n_pts);
516 for (
unsigned int i = 0; i < n_pts; ++i)
518 const double temperature_inv = 1.0 / (
temperature[i] + 1e-16);
521 saturation_pressure_vector[i] *
522 std::sqrt(M_x_2PI_inv_x_R_inv * temperature_inv);
533 heat_flux(
const std::map<field, double> &field_values)
override
535 const double mass_flux_value =
mass_flux(field_values);
550 std::vector<double> &heat_flux_vector)
override
552 const unsigned int n_pts = heat_flux_vector.size();
554 std::vector<double> mass_flux_vector(n_pts);
555 mass_flux(field_vectors, mass_flux_vector);
557 for (
unsigned int i = 0; i < n_pts; ++i)
575 const field id)
override
578 PhysicialPropertyModelFieldUndefined(
"EvaporationModelTemperature",
580 const double temperature_inv =
584 const double L_vap_x_M_x_R_inv =
586 const double M_x_2PI_inv_x_R_inv =
molar_mass / (2.0 * M_PI) * R_inv;
591 std::sqrt(M_x_2PI_inv_x_R_inv * temperature_inv) *
592 std::exp(-L_vap_x_M_x_R_inv *
594 (L_vap_x_M_x_R_inv * temperature_inv - 0.5);
613 std::vector<double> &jacobian_vector)
override
616 const double L_vap_x_M_x_R_inv =
618 const double M_x_2PI_inv_x_R_inv =
molar_mass / (2.0 * M_PI) * R_inv;
623 PhysicialPropertyModelFieldUndefined(
624 "EvaporationModelTemperature",
"temperature"));
628 const unsigned int n_pts = jacobian_vector.size();
630 for (
unsigned int i = 0; i < n_pts; ++i)
632 const double temperature_inv = 1.0 / (
temperature[i] + 1e-16);
636 std::sqrt(M_x_2PI_inv_x_R_inv * temperature_inv) *
637 std::exp(-L_vap_x_M_x_R_inv *
639 (L_vap_x_M_x_R_inv * temperature_inv - 0.5);
643 std::ranges::fill(jacobian_vector, 0);
672 std::vector<double> &momentum_flux_vector)
override
674 const unsigned int n_pts = momentum_flux_vector.size();
676 std::vector<double> saturation_pressure_vector(n_pts);
679 for (
unsigned int i = 0; i < n_pts; ++i)
680 momentum_flux_vector[i] =
698 const field )
override
716 const std::map<
field, std::vector<double>> & ,
718 std::vector<double> &jacobian_vector)
override
720 std::ranges::fill(jacobian_vector, 0);
double mass_flux(const std::map< field, double > &) override
mass_flux Calculates the value of the evaporation mass flux.
double momentum_flux_jacobian(const std::map< field, double > &, const field) override
momentum_flux_jacobian Calculates the jacobian (the partial derivative) of the evaporation momentum f...
void heat_flux_jacobian(const std::map< field, std::vector< double > > &, const field, std::vector< double > &jacobian_vector) override
heat_flux_jacobian Calculates the derivative of the evaporation heat flux with respect to a field.
const double liquid_density_inv
double momentum_flux(const std::map< field, double > &) override
momentum_flux Calculates the value of the evaporation momentum flux.
EvaporationModelConstant(const Parameters::Evaporation &p_evaporation)
void momentum_flux(const std::map< field, std::vector< double > > &, std::vector< double > &momentum_flux_vector) override
momentum_flux Calculates the values of the evaporation momentum flux for multiple points.
const double latent_heat_evaporation
void heat_flux(const std::map< field, std::vector< double > > &, std::vector< double > &heat_flux_vector) override
heat_flux Calculates the values of the evaporation heat flux for multiple points.
const double ambient_gas_density_inv
const double evaporation_mass_flux
double heat_flux(const std::map< field, double > &) override
heat_flux Calculates the value of the evaporation heat flux.
void mass_flux(const std::map< field, std::vector< double > > &, std::vector< double > &mass_flux_vector) override
mass_flux Calculates the values of the evaporation mass flux for multiple points.
double heat_flux_jacobian(const std::map< field, double > &, const field) override
heat_flux_jacobian Calculates the jacobian (the partial derivative) of the evaporation heat flux with...
void momentum_flux_jacobian(const std::map< field, std::vector< double > > &, const field, std::vector< double > &jacobian_vector) override
momentum_flux_jacobian Calculates the derivative of the evaporation momentum flux with respect to a f...
const double recoil_pressure_coefficient
double heat_flux_jacobian(const std::map< field, double > &field_values, const field id) override
heat_flux_jacobian Calculates the jacobian (the partial derivative) of the evaporation heat flux with...
void momentum_flux(const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &momentum_flux_vector) override
momentum_flux Calculates the values of the evaporation momentum flux for multiple points.
double mass_flux(const std::map< field, double > &field_values) override
mass_flux Calculates the value of the evaporation mass flux.
const double boiling_temperature_inv
void saturation_pressure(const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &saturation_pressure_vector)
mass_flux Calculates the values of the saturation pressure for multiple points.
double momentum_flux_jacobian(const std::map< field, double > &, const field) override
momentum_flux_jacobian Calculates the jacobian (the partial derivative) of the evaporation momentum f...
const double latent_heat_evaporation
double momentum_flux(const std::map< field, double > &field_values) override
momentum_flux Calculates the value of the evaporation momentum flux.
void momentum_flux_jacobian(const std::map< field, std::vector< double > > &, const field, std::vector< double > &jacobian_vector) override
momentum_flux_jacobian Calculates the derivative of the evaporation momentum flux with respect to a f...
void mass_flux(const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &mass_flux_vector) override
mass_flux Calculates the values of the evaporation mass flux for multiple points.
const double universal_gas_constant
double heat_flux(const std::map< field, double > &field_values) override
heat_flux Calculates the value of the evaporation heat flux.
EvaporationModelTemperature(const Parameters::Evaporation &p_evaporation)
double saturation_pressure(const std::map< field, double > &field_values)
saturation_pressure Calculates the value of the saturation pressure.
void heat_flux(const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &heat_flux_vector) override
heat_flux Calculates the values of the evaporation heat flux for multiple points.
void heat_flux_jacobian(const std::map< field, std::vector< double > > &field_vectors, const field id, std::vector< double > &jacobian_vector) override
heat_flux_jacobian Calculates the derivative of the evaporation heat flux with respect to a field.
const double evaporation_coefficient
const double ambient_pressure
virtual double mass_flux(const std::map< field, double > &field_values)=0
mass_flux Calculates the value of the evaporation mass flux.
virtual void heat_flux(const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &heat_flux_vector)=0
heat_flux Calculates the values of the evaporation heat flux for multiple points.
bool depends_on(const field &id)
Returns true if the EvaporationModel depends on a field, false if not.
virtual double heat_flux_jacobian(const std::map< field, double > &field_values, const field id)=0
heat_flux_jacobian Calculates the jacobian (the partial derivative) of the evaporation heat flux with...
virtual void heat_flux_jacobian(const std::map< field, std::vector< double > > &field_vectors, const field id, std::vector< double > &jacobian_vector)=0
heat_flux_jacobian Calculates the derivative of the evaporation heat flux with respect to a field for...
virtual double momentum_flux(const std::map< field, double > &field_values)=0
momentum_flux Calculates the value of the evaporation momentum flux.
virtual ~EvaporationModel()=default
Default virual destructor. Does not do anything.
virtual double momentum_flux_jacobian(const std::map< field, double > &field_values, const field id)=0
momentum_flux_jacobian Calculates the jacobian (the partial derivative) of the evaporation momentum f...
virtual void momentum_flux_jacobian(const std::map< field, std::vector< double > > &field_vectors, const field id, std::vector< double > &jacobian_vector)=0
momentum_flux_jacobian Calculates the derivative of the evaporation momentum flux with respect to a f...
static std::shared_ptr< EvaporationModel > model_cast(const Parameters::Evaporation &evaporation_parameters)
Instantiates and returns a pointer to an EvaporationModel object by casting it to the proper child cl...
EvaporationModel()=default
std::map< field, bool > model_depends_on
virtual void mass_flux(const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &mass_flux_vector)=0
mass_flux Calculates the values of the evaporation mass flux for multiple points.
virtual void momentum_flux(const std::map< field, std::vector< double > > &field_vectors, std::vector< double > &momentum_flux_vector)=0
momentum_flux Calculates the values of the evaporation momentum flux for multiple points.
virtual double heat_flux(const std::map< field, double > &field_values)=0
heat_flux Calculates the value of the evaporation heat flux.
@ pressure
Pressure scalar field from fluid dynamics.
@ temperature
Temperature scalar field from heat transfer.
Evaporation - Defines the subparameters for the evaporation cooling and recoil pressure at the free s...