Lethe Open-Source Library
version 1.2.0
Developer Guide
Loading...
Searching...
No Matches
include
core
phase_change.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) 2022-2025 The Lethe Authors
2
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
3
4
#ifndef lethe_phase_change_h
5
#define lethe_phase_change_h
6
7
#include <
core/parameters.h
>
8
9
using namespace
dealii
;
10
11
/**
12
* @brief calculate_liquid_fraction Calculates the liquid fraction of a phase change material at
13
* a temperature T
14
*
15
* @param T temperature at which to calculate the liquid fraction
16
* @param phase_change_parameters
17
* @return value of the liquid_fraction
18
*
19
*/
20
inline
double
21
calculate_liquid_fraction
(
22
const
double
&T,
23
const
Parameters::PhaseChange
&phase_change_parameters)
24
{
25
return
std::min(std::max((T - phase_change_parameters.
T_solidus
) /
26
(phase_change_parameters.
T_liquidus
-
27
phase_change_parameters.
T_solidus
),
28
0.),
29
1.);
30
}
31
32
/**
33
* @brief calculate_liquid_fraction Calculates the liquid fraction of a phase change material at
34
* a temperature T
35
*
36
* @param T temperature at which to calculate the liquid fraction
37
* @param T_solidus temperature
38
* @param T_liquidus temperature
39
* @return value of the liquid_fraction
40
*
41
*/
42
inline
double
43
calculate_liquid_fraction
(
const
double
&T,
44
const
double
T_solidus,
45
const
double
T_liquidus)
46
{
47
return
std::min(std::max((T - T_solidus) / (T_liquidus - T_solidus), 0.), 1.);
48
}
49
50
#endif
dealii
Definition
fluid_dynamics_matrix_free.h:34
parameters.h
calculate_liquid_fraction
double calculate_liquid_fraction(const double &T, const Parameters::PhaseChange &phase_change_parameters)
calculate_liquid_fraction Calculates the liquid fraction of a phase change material at a temperature ...
Definition
phase_change.h:21
Parameters::PhaseChange
Phase change model for melting/freezing liquids The model assumes that the phase change occurs betwee...
Definition
parameters.h:264
Parameters::PhaseChange::T_liquidus
double T_liquidus
Liquidus temperature - Units in K.
Definition
parameters.h:269
Parameters::PhaseChange::T_solidus
double T_solidus
Solidus temperature - Units in K.
Definition
parameters.h:266
Generated by
1.15.0