Lethe Open-Source Library version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
evaporation_model.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) 2023-2026 The Lethe Authors
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4#ifndef lethe_evaporation_model_h
5#define lethe_evaporation_model_h
6
7#include <core/parameters.h>
9
10#include <algorithm>
11
12using namespace dealii;
13
14/**
15 * @brief EvaporationModel. Abstract class that allows to calculate the
16 * evaporation mass, heat and momentum fluxes. This model computes all the terms
17 * required for the assembly of the governing equations, i.e., Navier-Stokes
18 * momentum and energy, when evaporation is considered. The former terms are
19 * the momentum flux (i.e., pressure) acting on the evaporative front in the
20 * normal direction, the heat flux, acting at the same location as a cooling
21 * term, and the fluxes' jacobian, if required.
22 *
23 * The EvaporativeModel is the parent class, and its children are specific
24 * types of evaporative models, e.g., constant, temperature dependent. The
25 * selected model is instantiated in the assemblers' constructor
26 * (NavierStokesCLSAssemblerEvaporation and/or
27 * HeatTransferAssemblerCLSEvaporation), using the model_cast method according
28 * to the evaporation model parameters.
29 *
30 * The assemblers call the required method of the EvaporationModel for either
31 * the assembly of the rhs or matrix terms. Hence, no matter the selected
32 * evaporation model, the same assembler is called, avoiding repetitions of
33 * the assembler classes.
34 *
35 */
37{
38public:
39 EvaporationModel() = default;
40
41 /**
42 * @brief Default virual destructor. Does not do anything.
43 */
44 virtual ~EvaporationModel() = default;
45
46 /**
47 * @brief Instantiates and returns a pointer to an EvaporationModel
48 * object by casting it to the proper child class.
49 *
50 * @param evaporation_parameters Evaporation model parameters.
51 * @return Pointer to the instantiated EvaporationModel.
52 */
53 static std::shared_ptr<EvaporationModel>
54 model_cast(const Parameters::Evaporation &evaporation_parameters);
55
56 /**
57 * @brief Returns true if the EvaporationModel depends on a field, false if not.
58 * @param id Identifier of the field for which the function is called.
59 * @return Boolean stating if the EvaporationModel depends on the field.
60 */
61 inline bool
62 depends_on(const field &id)
63 {
64 return model_depends_on[id];
65 }
66
67 /**
68 * @brief mass_flux Calculates the value of the evaporation mass flux.
69 * @param field_values Map storing the values of the various fields on which the
70 * mass flux may depend.
71 * @return Value of the flux calculated with the field_values.
72 */
73 virtual double
74 mass_flux(const std::map<field, double> &field_values) = 0;
75
76 /**
77 * @brief mass_flux Calculates the values of the evaporation mass flux
78 * for multiple points.
79 * @param field_vectors Map storing the vectors of the values for each field
80 * on which the mass flux may depend. Each vector contains the field values at
81 * the points of interest.
82 * @param mass_flux_vector Vector of mass flux values.
83 */
84 virtual void
85 mass_flux(const std::map<field, std::vector<double>> &field_vectors,
86 std::vector<double> &mass_flux_vector) = 0;
87
88 /**
89 * @brief heat_flux Calculates the value of the evaporation heat flux.
90 * @param field_values Map storing the values of the various fields on which
91 * the heat flux may depend.
92 * @return Value of the heat flux calculated with the field_values
93 */
94 virtual double
95 heat_flux(const std::map<field, double> &field_values) = 0;
96
97 /**
98 * @brief heat_flux Calculates the values of the evaporation heat flux
99 * for multiple points.
100 * @param field_vectors Map storing the vectors of the values for each field
101 * on which the heat flux may depend. Each vector contains the field values at
102 * the points of interest.
103 * @param heat_flux_vector Vector of heat flux values.
104 */
105 virtual void
106 heat_flux(const std::map<field, std::vector<double>> &field_vectors,
107 std::vector<double> &heat_flux_vector) = 0;
108
109 /**
110 * @brief heat_flux_jacobian Calculates the jacobian (the partial derivative)
111 * of the evaporation heat flux with respect to a field.
112 * @param field_values Map storing the values of the various fields on which the
113 * heat flux evaluated at a point may depend.
114 * @param id Identifier of the field with respect to which the jacobian
115 * should be calculated.
116 * @return Value of the partial derivative of the heat flux with respect to
117 * the field.
118 */
119 virtual double
120 heat_flux_jacobian(const std::map<field, double> &field_values,
121 const field id) = 0;
122
123 /**
124 * @brief heat_flux_jacobian Calculates the derivative of the evaporation
125 * heat flux with respect to a field for multiple points.
126 * @param field_vectors Map storing the vectors of the values for each field
127 * on which the heat flux may depend. Each vector contains the field values at
128 * the points of interest.
129 * @param id Identifier of the field with respect to which a derivative should
130 * be calculated.
131 * @param jacobian_vector Vector of the values of the derivative of the heat
132 * flux with respect to the field.
133 */
134 virtual void
135 heat_flux_jacobian(const std::map<field, std::vector<double>> &field_vectors,
136 const field id,
137 std::vector<double> &jacobian_vector) = 0;
138
139 /**
140 * @brief momentum_flux Calculates the value of the evaporation momentum flux.
141 * @param field_values Map storing the values of the various fields on which the
142 * momentum flux may depend.
143 * @return Value of the momentum flux calculated with the field_values.
144 */
145 virtual double
146 momentum_flux(const std::map<field, double> &field_values) = 0;
147
148 /**
149 * @brief momentum_flux Calculates the values of the evaporation momentum
150 * flux for multiple points.
151 * @param field_vectors Map storing the vectors of the values for each field
152 * on which the evaporation momentum flux may depend. Each vector contains the
153 * field values at the points of interest.
154 * @param momentum_flux_vector Vector of momentum flux values.
155 */
156 virtual void
157 momentum_flux(const std::map<field, std::vector<double>> &field_vectors,
158 std::vector<double> &momentum_flux_vector) = 0;
159
160 /**
161 * @brief momentum_flux_jacobian Calculates the jacobian (the partial derivative)
162 * of the evaporation momentum flux with respect to a field.
163 * @param field_values Map storing the values of the various fields on which the
164 * momentum flux may depend.
165 * @param id Identifier of the field with respect to which the jacobian
166 * should be calculated.
167 * @return Value of the partial derivative of the momentum flux with respect
168 * to the field.
169 */
170 virtual double
171 momentum_flux_jacobian(const std::map<field, double> &field_values,
172 const field id) = 0;
173
174 /**
175 * @brief momentum_flux_jacobian Calculates the derivative of the
176 * evaporation momentum flux with respect to a field for multiple points.
177 * @param field_vectors Map storing the vectors of the values for each field
178 * on which the momentum flux may depend. Each vector contains the field
179 * values at the points of interest.
180 * @param id Identifier of the field with respect to which a derivative should
181 * be calculated.
182 * @param jacobian_vector Vector of the value of the derivative of the momentum
183 * flux with respect to the field.
184 */
185 virtual void
187 const std::map<field, std::vector<double>> &field_vectors,
188 const field id,
189 std::vector<double> &jacobian_vector) = 0;
190
191protected:
192 // Map that indicates on which fields the model depends on
193 std::map<field, bool> model_depends_on;
194};
195
196/**
197 * @brief EvaporationModelConstant. Class that allows to calculate the
198 * evaporation mass, heat, and momentum fluxes when a constant mass flux is
199 * considered.
200 *
201 * @param p_evaporation Evaporation model parameters.
202 */
204{
205public:
209 , ambient_gas_density_inv(1.0 / p_evaporation.ambient_gas_density)
210 , liquid_density_inv(1.0 / p_evaporation.liquid_density)
211 {
213 }
214
215
216 /**
217 * @brief mass_flux Calculates the value of the evaporation mass flux.
218 * @param field_values Map storing the values of the various fields on which the
219 * mass flux may depend.
220 * @return Value of the flux calculated with the field_values.
221 */
222 double
223 mass_flux(const std::map<field, double> & /*field_values*/) override
224 {
226 }
227
228 /**
229 * @brief mass_flux Calculates the values of the evaporation mass flux
230 * for multiple points.
231 * @param field_vectors Map storing the vectors of the values for each field
232 * on which the mass flux may depend. Each vector contains the field values at
233 * the points of interest.
234 * @param mass_flux_vector Vector of mass flux values.
235 */
236 void
237 mass_flux(const std::map<field, std::vector<double>> & /*field_vectors*/,
238 std::vector<double> &mass_flux_vector) override
239 {
240 std::ranges::fill(mass_flux_vector, evaporation_mass_flux);
241 }
242
243 /**
244 * @brief heat_flux Calculates the value of the evaporation heat flux.
245 * @param field_values Map storing the values of the various fields on which the
246 * heat flux may depend.
247 * @return Value of the heat flux calculated with the field_values.
248 */
249 double
250 heat_flux(const std::map<field, double> & /*field_values*/) override
251 {
253 }
254
255 /**
256 * @brief heat_flux Calculates the values of the evaporation heat flux
257 * for multiple points.
258 * @param field_vectors Map storing the vectors of the values for each field
259 * on which the heat flux may depend. Each vector contains the field values at
260 * the points of interest.
261 * @param heat_flux_vector Vectors of the heat flux values.
262 */
263 void
264 heat_flux(const std::map<field, std::vector<double>> & /*field_vectors*/,
265 std::vector<double> &heat_flux_vector) override
266 {
267 std::ranges::fill(heat_flux_vector,
269 }
270
271 /**
272 * @brief heat_flux_jacobian Calculates the jacobian (the partial derivative)
273 * of the evaporation heat flux with respect to a field.
274 * @param field_values Map storing the values of the various fields on which the
275 * heat flux evaluated at a point may depend.
276 * @param id Identifier of the field with respect to which the jacobian
277 * should be calculated.
278 * @return Value of the partial derivative of the heat flux with respect to
279 * the field.
280 */
281 double
282 heat_flux_jacobian(const std::map<field, double> & /*field_values*/,
283 const field /*id*/) override
284 {
285 return 0.0;
286 }
287
288 /**
289 * @brief heat_flux_jacobian Calculates the derivative of the evaporation
290 * heat flux with respect to a field.
291 * @param field_vectors Vector for the values of the fields on which the heat
292 * flux may depend. Each vector contains the field values at the points of
293 * interest.
294 * @param id Identifier of the field with respect to which a derivative should
295 * be calculated.
296 * @param jacobian_vector Vector of the values of the derivative of the heat
297 * flux with respect to the field.
298 */
299 void
301 const std::map<field, std::vector<double>> & /*field_vectors*/,
302 const field /*id*/,
303 std::vector<double> &jacobian_vector) override
304 {
305 std::ranges::fill(jacobian_vector, 0);
306 }
307
308 /**
309 * @brief momentum_flux Calculates the value of the evaporation momentum flux.
310 * @param field_values Map storing the values of the various fields on which the
311 * momentum flux may depend.
312 * @return Value of the momentum flux calculated with the field_values
313 */
314 double
315 momentum_flux(const std::map<field, double> & /*field_values*/) override
316 {
319 }
320
321 /**
322 * @brief momentum_flux Calculates the values of the evaporation momentum
323 * flux for multiple points.
324 * @param field_vectors Map storing the vectors of the values for each field
325 * on which the momentum flux may depend. Each vector contains the field
326 * values at the points of interest.
327 * @param momentum_flux_vector Vector of momentum flux values.
328 */
329 void
330 momentum_flux(const std::map<field, std::vector<double>> & /*field_vectors*/,
331 std::vector<double> &momentum_flux_vector) override
332 {
333 const double momentum_flux_value =
336
337 std::ranges::fill(momentum_flux_vector, momentum_flux_value);
338 }
339
340 /**
341 * @brief momentum_flux_jacobian Calculates the jacobian (the partial derivative)
342 * of the evaporation momentum flux with respect to a field.
343 * @param field_values Map storing the values of the various fields on which the
344 * momentum flux may depend.
345 * @param id Identifier of the field with respect to which the jacobian
346 * should be calculated
347 * @return Value of the partial derivative of the momentum flux with respect
348 * to the field.
349 */
350 double
351 momentum_flux_jacobian(const std::map<field, double> & /*field_values*/,
352 const field /*id*/) override
353 {
354 return 0.0;
355 }
356
357 /**
358 * @brief momentum_flux_jacobian Calculates the derivative of the
359 * evaporation momentum flux with respect to a field
360 * @param field_vectors Map storing the vectors of the values for each field
361 * on which the momentum flux may depend. Each vector contains the field
362 * values at the points of interest.
363 * @param id Identifier of the field with respect to which a derivative should
364 * be calculated.
365 * @param jacobian_vector Vector of the values of the derivative of the momentum
366 * flux with respect to the field.
367 */
368 void
370 const std::map<field, std::vector<double>> & /*field_vectors*/,
371 const field /*id*/,
372 std::vector<double> &jacobian_vector) override
373 {
374 std::ranges::fill(jacobian_vector, 0);
375 }
376
377private:
381 const double liquid_density_inv;
382};
383
384/**
385 * @brief EvaporationModelTemperature. Class that allows to calculate the
386 * evaporation mass, heat, and momentum fluxes when a temperature-dependent
387 * mass flux is considered.
388 *
389 * @param p_evaporation Evaporation model parameters.
390 */
392{
393public:
397 , molar_mass(p_evaporation.molar_mass)
398 , boiling_temperature_inv(1.0 / p_evaporation.boiling_temperature)
400 , ambient_pressure(p_evaporation.ambient_pressure)
402 {
404 }
405
406 /**
407 * @brief saturation_pressure Calculates the value of the saturation pressure.
408 * @param field_values Map storing the values of the various field on which the
409 * saturated vapor pressure evaluated at a point may depend.
410 * @return Value of the saturation pressure calculated with the field_values.
411 */
412 double
413 saturation_pressure(const std::map<field, double> &field_values)
414 {
415 Assert(field_values.find(field::temperature) != field_values.end(),
416 PhysicialPropertyModelFieldUndefined("EvaporationModelTemperature",
417 "temperature"));
418 const double temperature_inv =
419 1.0 / (field_values.at(field::temperature) + 1e-16);
420
421 const double R_inv = 1.0 / universal_gas_constant;
422
423 const double L_vap_x_M_x_R_inv =
425
426 return ambient_pressure *
427 std::exp(-L_vap_x_M_x_R_inv *
428 (temperature_inv - boiling_temperature_inv));
429 }
430
431 /**
432 * @brief mass_flux Calculates the values of the saturation pressure
433 * for multiple points.
434 * @param field_vectors Map storing the vectors of the values for each field
435 * on which the saturated vapor pressure may depend. Each vector contains the
436 * field values at the points of interest.
437 * @param saturation_pressure_vector Vector of the saturation pressure values.
438 */
439 void
440 saturation_pressure(const std::map<field, std::vector<double>> &field_vectors,
441 std::vector<double> &saturation_pressure_vector)
442 {
443 Assert(field_vectors.find(field::temperature) != field_vectors.end(),
444 PhysicialPropertyModelFieldUndefined("EvaporationModelTemperature",
445 "temperature"));
446 const std::vector<double> &temperature =
447 field_vectors.at(field::temperature);
448
449 const double R_inv = 1.0 / universal_gas_constant;
450
451 const double L_vap_x_M_x_R_inv =
453
454 const unsigned int n_pts = saturation_pressure_vector.size();
455
456 for (unsigned int i = 0; i < n_pts; ++i)
457 {
458 const double temperature_inv = 1.0 / (temperature[i] + 1e-16);
459
460 saturation_pressure_vector[i] =
462 std::exp(-L_vap_x_M_x_R_inv *
463 (temperature_inv - boiling_temperature_inv));
464 }
465 }
466
467 /**
468 * @brief mass_flux Calculates the value of the evaporation mass flux.
469 * @param field_values Map storing the values of the various fields on which the
470 * evaporation mass flux may depend.
471 * @return Value of the evaporation mass flux calculated with the field_values.
472 */
473 double
474 mass_flux(const std::map<field, double> &field_values) override
475 {
476 const double saturation_pressure_value = saturation_pressure(field_values);
477 const double temperature_inv =
478 1.0 / (field_values.at(field::temperature) + 1e-16);
479
480 const double R_inv = 1.0 / universal_gas_constant;
481 const double M_x_2PI_inv_x_R_inv = molar_mass / (2.0 * M_PI) * R_inv;
482
483 const double mass_flux_value =
484 evaporation_coefficient * saturation_pressure_value *
485 std::sqrt(M_x_2PI_inv_x_R_inv * temperature_inv);
486
487 return mass_flux_value;
488 }
489
490 /**
491 * @brief mass_flux Calculates the values of the evaporation mass flux
492 * for multiple points.
493 * @param field_vectors Map storing the vectors of the values for each field
494 * on which the evaporation mass flux may depend. Each vector contains the
495 * field values at the points of interest.
496 * @param mass_flux_vector Vector of mass flux values.
497 */
498 void
499 mass_flux(const std::map<field, std::vector<double>> &field_vectors,
500 std::vector<double> &mass_flux_vector) override
501 {
502 Assert(field_vectors.find(field::temperature) != field_vectors.end(),
503 PhysicialPropertyModelFieldUndefined("EvaporationModelTemperature",
504 "temperature"));
505 const std::vector<double> &temperature =
506 field_vectors.at(field::temperature);
507
508 const double R_inv = 1.0 / universal_gas_constant;
509 const double M_x_2PI_inv_x_R_inv = molar_mass / (2.0 * M_PI) * R_inv;
510
511 const unsigned int n_pts = mass_flux_vector.size();
512
513 std::vector<double> saturation_pressure_vector(n_pts);
514 saturation_pressure(field_vectors, saturation_pressure_vector);
515
516 for (unsigned int i = 0; i < n_pts; ++i)
517 {
518 const double temperature_inv = 1.0 / (temperature[i] + 1e-16);
519
520 mass_flux_vector[i] = evaporation_coefficient *
521 saturation_pressure_vector[i] *
522 std::sqrt(M_x_2PI_inv_x_R_inv * temperature_inv);
523 }
524 }
525
526 /**
527 * @brief heat_flux Calculates the value of the evaporation heat flux.
528 * @param field_values Map storing the values of the various fields on which the
529 * heat flux may depend.
530 * @return Value of the heat flux calculated with the field_values.
531 */
532 double
533 heat_flux(const std::map<field, double> &field_values) override
534 {
535 const double mass_flux_value = mass_flux(field_values);
536
537 return mass_flux_value * latent_heat_evaporation;
538 }
539
540 /**
541 * @brief heat_flux Calculates the values of the evaporation heat flux
542 * for multiple points.
543 * @param field_vectors Map storing the vectors of the values for each field
544 * on which the heat flux may depend. Each vector contains the field values at
545 * the points of interest.
546 * @param heat_flux_vector Vector of heat flux values.
547 */
548 void
549 heat_flux(const std::map<field, std::vector<double>> &field_vectors,
550 std::vector<double> &heat_flux_vector) override
551 {
552 const unsigned int n_pts = heat_flux_vector.size();
553
554 std::vector<double> mass_flux_vector(n_pts);
555 mass_flux(field_vectors, mass_flux_vector);
556
557 for (unsigned int i = 0; i < n_pts; ++i)
558 {
559 heat_flux_vector[i] = mass_flux_vector[i] * latent_heat_evaporation;
560 }
561 }
562
563 /**
564 * @brief heat_flux_jacobian Calculates the jacobian (the partial derivative)
565 * of the evaporation heat flux with respect to a field.
566 * @param field_values Map storing the values of the various fields on which the
567 * heat flux evaluated at a point may depend.
568 * @param id Identifier of the field with respect to which the jacobian
569 * should be calculated.
570 * @return Value of the partial derivative of the heat flux with respect to
571 * the field.
572 */
573 double
574 heat_flux_jacobian(const std::map<field, double> &field_values,
575 const field id) override
576 {
577 Assert(field_values.find(field::temperature) != field_values.end(),
578 PhysicialPropertyModelFieldUndefined("EvaporationModelTemperature",
579 "temperature"));
580 const double temperature_inv =
581 1.0 / (field_values.at(field::temperature) + 1e-16);
582
583 const double R_inv = 1.0 / universal_gas_constant;
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;
587
588 if (id == field::temperature)
590 evaporation_coefficient * temperature_inv *
591 std::sqrt(M_x_2PI_inv_x_R_inv * temperature_inv) *
592 std::exp(-L_vap_x_M_x_R_inv *
593 (temperature_inv - boiling_temperature_inv)) *
594 (L_vap_x_M_x_R_inv * temperature_inv - 0.5);
595 else
596 return 0.0;
597 }
598
599 /**
600 * @brief heat_flux_jacobian Calculates the derivative of the evaporation
601 * heat flux with respect to a field.
602 * @param field_vectors Map storing the vectors of the values for each field
603 * on which heat flux evaluated at a point may depend. Each vector contains
604 * the field values at the points of interest.
605 * @param id Identifier of the field with respect to which a derivative should
606 * be calculated.
607 * @param jacobian_vector Vector of the values of the derivative of the heat flux
608 * with respect to the field.
609 */
610 void
611 heat_flux_jacobian(const std::map<field, std::vector<double>> &field_vectors,
612 const field id,
613 std::vector<double> &jacobian_vector) override
614 {
615 const double R_inv = 1.0 / universal_gas_constant;
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;
619
620 if (id == field::temperature)
621 {
622 Assert(field_vectors.find(field::temperature) != field_vectors.end(),
623 PhysicialPropertyModelFieldUndefined(
624 "EvaporationModelTemperature", "temperature"));
625 const std::vector<double> &temperature =
626 field_vectors.at(field::temperature);
627
628 const unsigned int n_pts = jacobian_vector.size();
629
630 for (unsigned int i = 0; i < n_pts; ++i)
631 {
632 const double temperature_inv = 1.0 / (temperature[i] + 1e-16);
633 jacobian_vector[i] =
635 evaporation_coefficient * temperature_inv *
636 std::sqrt(M_x_2PI_inv_x_R_inv * temperature_inv) *
637 std::exp(-L_vap_x_M_x_R_inv *
638 (temperature_inv - boiling_temperature_inv)) *
639 (L_vap_x_M_x_R_inv * temperature_inv - 0.5);
640 }
641 }
642 else
643 std::ranges::fill(jacobian_vector, 0);
644 }
645
646 /**
647 * @brief momentum_flux Calculates the value of the evaporation momentum flux.
648 * @param field_values Map storing the values of the various fields on which the
649 * momentum flux may depend.
650 * @return Value of the momentum flux calculated with the field_values
651 */
652 double
653 momentum_flux(const std::map<field, double> &field_values) override
654 {
655 const double saturation_pressure_value = saturation_pressure(field_values);
656
657 double pressure = recoil_pressure_coefficient * saturation_pressure_value;
658
659 return std::max(pressure - ambient_pressure, 0.0);
660 }
661
662 /**
663 * @brief momentum_flux Calculates the values of the evaporation momentum
664 * flux for multiple points.
665 * @param field_vectors Map storing the vectors of the values for each field
666 * on which the momentum flux may depend. Each vector contains the field
667 * values at the points of interest.
668 * @param momentum_flux_vector Vectors of the momentum flux values.
669 */
670 void
671 momentum_flux(const std::map<field, std::vector<double>> &field_vectors,
672 std::vector<double> &momentum_flux_vector) override
673 {
674 const unsigned int n_pts = momentum_flux_vector.size();
675
676 std::vector<double> saturation_pressure_vector(n_pts);
677 saturation_pressure(field_vectors, saturation_pressure_vector);
678
679 for (unsigned int i = 0; i < n_pts; ++i)
680 momentum_flux_vector[i] =
681 std::max(recoil_pressure_coefficient * saturation_pressure_vector[i] -
683 0.0);
684 }
685
686 /**
687 * @brief momentum_flux_jacobian Calculates the jacobian (the partial derivative)
688 * of the evaporation momentum flux with respect to a field.
689 * @param field_values Map storing the values of the various fields on which the
690 * momentum flux may depend.
691 * @param id Identifier of the field with respect to which the jacobian
692 * should be calculated
693 * @return Value of the partial derivative of the momentum flux with respect
694 * to the field.
695 */
696 double
697 momentum_flux_jacobian(const std::map<field, double> & /*field_values*/,
698 const field /*id*/) override
699 {
700 return 0.0;
701 }
702
703 /**
704 * @brief momentum_flux_jacobian Calculates the derivative of the
705 * evaporation momentum flux with respect to a field.
706 * @param field_vectors Map storing the vectors of the values for each field
707 * flux may depend. Each vector contains the field values at the points of
708 * interest.
709 * @param id Identifier of the field with respect to which a derivative should
710 * be calculated.
711 * @param jacobian_vector Vector of the values of the derivative of the momentum
712 * flux with respect to the field.
713 */
714 void
716 const std::map<field, std::vector<double>> & /*field_vectors*/,
717 const field /*id*/,
718 std::vector<double> &jacobian_vector) override
719 {
720 std::ranges::fill(jacobian_vector, 0);
721 }
722
723private:
726
727 const double molar_mass;
730 const double ambient_pressure;
731
733};
734
735#endif
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.
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.
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.
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...
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.
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...
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.
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.
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...