svMultiPhysics
Loading...
Searching...
No Matches
darcy.h
1#ifndef DARCY_H
2#define DARCY_H
3
4#include "ComMod.h"
5#include "SolutionStates.h"
6
7/**
8 * @brief Pressure-based Darcy flow in porous media.
9 *
10 * This namespace implements the Darcy equation for perfusion of porous media
11 * with intrinsic dimensions 2 and 3. Material coefficients are homogeneous
12 * within each solver domain, permeability is isotropic, and Stokes-flow
13 * assumptions apply. The assembled pressure strong form is
14 * \f[
15 * \rho \beta \frac{\partial p}{\partial t}
16 * - \nabla \cdot \left(\frac{\rho K}{\mu}\nabla p\right)
17 * = \rho s.
18 * \f]
19 *
20 * This discretizes the pressure-only strong form.
21 * Velocity is not an independent unknown.
22 * After pressure is solved, Darcy velocity is
23 * evaluated as the derived field
24 * \f[
25 * \boldsymbol{q} = -\frac{K}{\mu}\nabla p.
26 * \f]
27 *
28 * The model quantities and their admissible ranges are:
29 * - \f$p\f$: pressure unknown [M/L/T^2].
30 * - \f$\boldsymbol{q}\f$: derived Darcy velocity [L/T].
31 * - \f$K\f$: configured intrinsic scalar permeability [L^2]. `Darcy_permeability`
32 * defaults to \f$10^{-15}\f$ and must satisfy \f$K > 0\f$.
33 * - \f$\mu\f$: configured dynamic viscosity [M/L/T]. `Darcy_fluid_viscosity` defaults
34 * to 1 and must satisfy \f$\mu > 0\f$.
35 * - \f$\rho\f$: configured reference fluid density [M/L^3]. `Fluid_density` defaults
36 * to 0.5 and must satisfy \f$\rho > 0\f$.
37 * - \f$\beta\f$: configured storage/compressibility [L*T^2/M].
38 * `Darcy_compressibility` defaults to 0 and must satisfy
39 * \f$\beta \ge 0\f$.
40 * - \f$s\f$: configured volumetric source provided by `Source_term` [1/T]; it
41 * defaults to 0 and is constant within each configured domain.
42 *
43 * @par Darcy flux output
44 * On supported two- and three-dimensional meshes, the pressure gradient is
45 * reconstructed in the mesh coordinates and the derived Darcy flux is
46 * \f[
47 * \boldsymbol{q} = -\frac{K}{\mu}\nabla p.
48 * \f]
49 *
50 * @par Cardiovascular porous-flow context
51 * The following works describe future multi-compartment and microcirculation
52 * model extensions than the single-compartment formulation implemented here:
53 * - C. Michler et al., "A computationally efficient framework for the
54 * simulation of cardiac perfusion using a multi-compartment Darcy
55 * porous-media flow model," DOI
56 * <a href="https://doi.org/10.1002/cnm.2520">10.1002/cnm.2520</a>.
57 * - G. Montino Pelagi et al., "Modeling cardiac microcirculation for the
58 * simulation of coronary flow and 3D myocardial perfusion," DOI
59 * <a href="https://doi.org/10.1007/s10237-024-01873-z">10.1007/s10237-024-01873-z</a>.
60 */
61namespace darcy {
62
63 /// Validate the configured Darcy material coefficients for a domain.
64 /// @param[in] domain Solver domain whose material properties are checked.
65 void validate_material_properties(const dmnType& domain);
66
67 /// Reject mesh types that Darcy assembly and flux output do not implement.
68 /// @param[in] mesh Mesh whose element type is checked.
69 /// @note `mshType::lFib` denotes a one-dimensional mesh embedded in the
70 /// ambient geometry, not a myocardial material fiber direction. Darcy is
71 /// currently limited to intrinsic dimensions 2 and 3.
72 void validate_element_support(const mshType& mesh);
73
74 /// Assemble a Darcy boundary contribution into the element residual.
75 /// @param[in] com_mod Common solver state retained for the common assembly interface.
76 /// @param[in] eNoN Number of element nodes.
77 /// @param[in] w Weighted boundary quadrature measure.
78 /// @param[in] N Shape-function values at the quadrature point.
79 /// @param[in] h Prescribed boundary flux contribution.
80 /// @param[in,out] lR Element residual.
81 void b_darcy(ComMod& com_mod, const int eNoN, const double w, const Vector<double>& N, const double h, Array<double>& lR);
82
83 /// Assemble Darcy volume contributions for all supported elements in a mesh.
84 /// @param[in,out] com_mod Common solver state and assembly interface.
85 /// @param[in] lM Mesh whose Darcy elements are assembled.
86 /// @param[in] solutions Solution states used for element-local fields.
87 void construct_darcy(ComMod& com_mod, const mshType& lM, const SolutionStates& solutions);
88
89 /// Assemble the residual and tangent for an intrinsic two-dimensional element.
90 /// @param[in] com_mod Common solver state.
91 /// @param[in] eNoN Number of element nodes.
92 /// @param[in] w Weighted volume quadrature measure.
93 /// @param[in] N Shape-function values at the quadrature point.
94 /// @param[in] Nx Mapped spatial shape-function derivatives.
95 /// @param[in] al Element-local pressure rates.
96 /// @param[in] yl Element-local pressure state.
97 /// @param[in,out] lR Element residual.
98 /// @param[in,out] lK Element tangent matrix.
99 void darcy_2d(ComMod& com_mod, const int eNoN, const double w, const Vector<double>& N, const Array<double>& Nx,
100 const Array<double>& al, const Array<double>& yl, Array<double>& lR, Array3<double>& lK);
101
102 /// Assemble the residual and tangent for an intrinsic three-dimensional element.
103 /// @param[in] com_mod Common solver state.
104 /// @param[in] eNoN Number of element nodes.
105 /// @param[in] w Weighted volume quadrature measure.
106 /// @param[in] N Shape-function values at the quadrature point.
107 /// @param[in] Nx Mapped spatial shape-function derivatives.
108 /// @param[in] al Element-local pressure rates.
109 /// @param[in] yl Element-local pressure state.
110 /// @param[in,out] lR Element residual.
111 /// @param[in,out] lK Element tangent matrix.
112 void darcy_3d(ComMod& com_mod, const int eNoN, const double w, const Vector<double>& N, const Array<double>& Nx,
113 const Array<double>& al, const Array<double>& yl, Array<double>& lR, Array3<double>& lK);
114}
115
116#endif //DARCY_H
The Array3 template class implements a simple interface to 3D arrays.
Definition Array3.h:25
The ComMod class duplicates the data structures in the Fortran COMMOD module defined in MOD....
Definition ComMod.h:1597
The Vector template class is used for storing int and double data.
Definition Vector.h:26
Domain type is to keep track with element belong to which domain and also different physical quantiti...
Definition ComMod.h:374
This is the container for a mesh or NURBS patch, those specific to NURBS are noted.
Definition ComMod.h:878
Pressure-based Darcy flow in porous media.
Definition darcy.cpp:13
void darcy_2d(ComMod &com_mod, const int eNoN, const double w, const Vector< double > &N, const Array< double > &Nx, const Array< double > &al, const Array< double > &yl, Array< double > &lR, Array3< double > &lK)
Definition darcy.cpp:157
void b_darcy(ComMod &com_mod, const int eNoN, const double w, const Vector< double > &N, const double h, Array< double > &lR)
Definition darcy.cpp:63
void validate_material_properties(const dmnType &domain)
Definition darcy.cpp:15
void validate_element_support(const mshType &mesh)
Definition darcy.cpp:54
void construct_darcy(ComMod &com_mod, const mshType &lM, const SolutionStates &solutions)
Definition darcy.cpp:70
void darcy_3d(ComMod &com_mod, const int eNoN, const double w, const Vector< double > &N, const Array< double > &Nx, const Array< double > &al, const Array< double > &yl, Array< double > &lR, Array3< double > &lK)
Definition darcy.cpp:216
Holds solution state at old, current, and intermediate time levels.
Definition SolutionStates.h:39