-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26279 from cpgr/fvenergy
FV heat energy capability in porous flow module
- Loading branch information
Showing
37 changed files
with
1,368 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...es/porous_flow/doc/content/source/fvkernels/FVPorousFlowEnergyTimeDerivative.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# FVPorousFlowEnergyTimeDerivative | ||
|
||
!syntax description /FVKernels/FVPorousFlowEnergyTimeDerivative | ||
|
||
This `FVKernel` implements the strong form of | ||
\begin{equation*} | ||
\frac{\partial}{\partial t}\left((1-\phi)\rho_{R}C_{R}T + \phi\sum_{\beta}S_{\beta}\rho_{\beta}\mathcal{E}_{\beta}\right) | ||
\end{equation*} | ||
where all parameters are defined in the [nomenclature](/nomenclature.md). | ||
|
||
!alert note | ||
Presently, a first-order accurate implicit Euler time derivative is hard-coded. | ||
|
||
!syntax parameters /FVKernels/FVPorousFlowEnergyTimeDerivative | ||
|
||
!syntax inputs /FVKernels/FVPorousFlowEnergyTimeDerivative | ||
|
||
!syntax children /FVKernels/FVPorousFlowEnergyTimeDerivative |
15 changes: 15 additions & 0 deletions
15
modules/porous_flow/doc/content/source/fvkernels/FVPorousFlowHeatAdvection.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# FVPorousFlowHeatAdvection | ||
|
||
!syntax description /FVKernels/FVPorousFlowHeatAdvection | ||
|
||
This `FVKernel` implements the strong form of | ||
\begin{equation*} | ||
-\nabla\cdot \sum_{\beta}h_{\beta} \rho_{\beta}\frac{k\,k_{\mathrm{r,}\beta}}{\mu_{\beta}}(\nabla P_{\beta} - \rho_{\beta} \mathbf{g}) | ||
\end{equation*} | ||
where all parameters are defined in the [nomenclature](/nomenclature.md). | ||
|
||
!syntax parameters /FVKernels/FVPorousFlowHeatAdvection | ||
|
||
!syntax inputs /FVKernels/FVPorousFlowHeatAdvection | ||
|
||
!syntax children /FVKernels/FVPorousFlowHeatAdvection |
15 changes: 15 additions & 0 deletions
15
modules/porous_flow/doc/content/source/fvkernels/FVPorousFlowHeatConduction.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# FVPorousFlowHeatConduction | ||
|
||
!syntax description /FVKernels/FVPorousFlowHeatConduction | ||
|
||
This `FVKernel` implements the strong form of | ||
\begin{equation*} | ||
-\nabla\cdot \left(\lambda \nabla T\right) | ||
\end{equation*} | ||
where all parameters are defined in the [nomenclature](/nomenclature.md). | ||
|
||
!syntax parameters /FVKernels/FVPorousFlowHeatConduction | ||
|
||
!syntax inputs /FVKernels/FVPorousFlowHeatConduction | ||
|
||
!syntax children /FVKernels/FVPorousFlowHeatConduction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
modules/porous_flow/include/fvkernels/FVPorousFlowEnergyTimeDerivative.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
#include "FVTimeKernel.h" | ||
|
||
class PorousFlowDictator; | ||
|
||
/** | ||
* Time derivative of energy | ||
*/ | ||
class FVPorousFlowEnergyTimeDerivative : public FVTimeKernel | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
FVPorousFlowEnergyTimeDerivative(const InputParameters & parameters); | ||
|
||
protected: | ||
ADReal computeQpResidual() override; | ||
|
||
/// UserObject that holds information (number of phases, components, etc) | ||
const PorousFlowDictator & _dictator; | ||
/// Number of fluid phases | ||
const unsigned int _num_phases; | ||
/// Whether fluid is present | ||
const bool _fluid_present; | ||
|
||
/// Porosity | ||
const ADMaterialProperty<Real> & _porosity; | ||
const MaterialProperty<Real> & _porosity_old; | ||
|
||
/// Fluid density | ||
const ADMaterialProperty<std::vector<Real>> * const _density; | ||
const MaterialProperty<std::vector<Real>> * const _density_old; | ||
|
||
/// Internal energy of porous matrix | ||
const ADMaterialProperty<Real> & _rock_energy; | ||
const MaterialProperty<Real> & _rock_energy_old; | ||
|
||
/// Internal energy of fluid | ||
const ADMaterialProperty<std::vector<Real>> * const _energy; | ||
const MaterialProperty<std::vector<Real>> * const _energy_old; | ||
|
||
/// Fluid phase saturation | ||
const ADMaterialProperty<std::vector<Real>> * const _saturation; | ||
const MaterialProperty<std::vector<Real>> * const _saturation_old; | ||
}; |
60 changes: 60 additions & 0 deletions
60
modules/porous_flow/include/fvkernels/FVPorousFlowHeatAdvection.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
#include "FVFluxKernel.h" | ||
|
||
class PorousFlowDictator; | ||
|
||
/** | ||
* Advective flux of heat energy | ||
*/ | ||
class FVPorousFlowHeatAdvection : public FVFluxKernel | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
FVPorousFlowHeatAdvection(const InputParameters & params); | ||
|
||
protected: | ||
virtual ADReal computeQpResidual() override; | ||
|
||
/// UserObject that holds information (number of phases, components, etc) | ||
const PorousFlowDictator & _dictator; | ||
/// Number of fluid phases present | ||
const unsigned int _num_phases; | ||
|
||
/// Fluid density | ||
const ADMaterialProperty<std::vector<Real>> & _density; | ||
const ADMaterialProperty<std::vector<Real>> & _density_neighbor; | ||
|
||
/// Fluid viscosity | ||
const ADMaterialProperty<std::vector<Real>> & _viscosity; | ||
const ADMaterialProperty<std::vector<Real>> & _viscosity_neighbor; | ||
|
||
/// Fluid enthalpy | ||
const ADMaterialProperty<std::vector<Real>> & _enthalpy; | ||
const ADMaterialProperty<std::vector<Real>> & _enthalpy_neighbor; | ||
|
||
/// Relative permeability | ||
const ADMaterialProperty<std::vector<Real>> & _relperm; | ||
const ADMaterialProperty<std::vector<Real>> & _relperm_neighbor; | ||
|
||
/// Permeability | ||
const ADMaterialProperty<RealTensorValue> & _permeability; | ||
const ADMaterialProperty<RealTensorValue> & _permeability_neighbor; | ||
|
||
/// Fluid pressure | ||
const ADMaterialProperty<std::vector<Real>> & _pressure; | ||
const ADMaterialProperty<std::vector<Real>> & _pressure_neighbor; | ||
const ADMaterialProperty<std::vector<RealGradient>> & _grad_p; | ||
|
||
/// Gravity vector | ||
const RealVectorValue & _gravity; | ||
}; |
Oops, something went wrong.