-
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 #28952 from freiler/linearFV-add-ons
Linear FV Fluid Energy equation
- Loading branch information
Showing
16 changed files
with
980 additions
and
15 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
23 changes: 23 additions & 0 deletions
23
...les/navier_stokes/doc/content/source/linearfvkernels/LinearFVEnergyAdvection.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,23 @@ | ||
# LinearFVEnergyAdvection | ||
|
||
This kernel adds the contributions of the energy advection term to the matrix and right hand side of the energy equation system for the finite volume SIMPLE segregated solver [SIMPLE.md]. | ||
|
||
This term is described by $\nabla \cdot \left(\rho\vec{u} c_p T \right)$ present in the energy equation conservation for an incompressible/weakly-compressible formulation. Currently, the kernel only supports +constant specific heat values+ for $c_p$ and solves for a temperature variable. The specific heat value needs to be prescribed, otherwise it will default to its default value of $c_p=1$. | ||
|
||
For FV, the integral of the advection term over a cell can be expressed as: | ||
|
||
\begin{equation} | ||
\int\limits_{V_C} \nabla \cdot \left(\rho\vec{u} c_p T \right) dV \approx \sum\limits_f (\rho \vec{u}\cdot \vec{n})_{RC} c_p T_f |S_f| \, | ||
\end{equation} | ||
|
||
where $T_f$ is a face temperature. The temperature acts as the advected quantity and an interpolation scheme (e.g. upwind) can be used to compute the face value. This kernel adds the face contribution for each face $f$ to the right hand side and matrix. | ||
|
||
The face mass flux $(\rho \vec{u}\cdot \vec{n})_{RC}$ is provided by the [RhieChowMassFlux.md] object which uses pressure | ||
gradients and the discrete momentum equation to compute face velocities and mass fluxes. | ||
For more information on the expression that is used, see [SIMPLE.md]. | ||
|
||
!syntax parameters /LinearFVKernels/LinearFVEnergyAdvection | ||
|
||
!syntax inputs /LinearFVKernels/LinearFVEnergyAdvection | ||
|
||
!syntax children /LinearFVKernels/LinearFVEnergyAdvection |
14 changes: 14 additions & 0 deletions
14
.../navier_stokes/doc/content/source/linearfvkernels/LinearFVMomentumBoussinesq.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,14 @@ | ||
# LinearFVMomentumBoussinesq | ||
|
||
This kernel adds the contributions of the Boussinesq buoyancy treatment for density through a force/source term to the right hand side of the momentum equation system for the finite volume SIMPLE segregated solver [SIMPLE.md]. The Boussinesq buoyancy treatment is applicable for low changes in density, and assumes constant density value in all other equation terms. | ||
|
||
This term is described by $-\rho_{ref}\alpha\vec{g}(T - T_{ref})$ present in the momentum equation conservation when describing an incompressible fluid, where $\rho_{ref}$ is the reference density, $\alpha$ is the thermal expansion coefficient, $\vec{g}$ is the gravity vector, $T$ is the temperature, and $T_{ref}$ is a reference temperature. The Boussinesq buoyancy model assumes the changes in density as a function of temperature are linear and relevant only in the buoyant force term of the equation system. The Boussinesq kernel allows for modeling natural convection. | ||
|
||
This term deals only with the force due to the variation in density $\Delta \rho \vec{g}$, with the fluid density being $\rho = \rho_{ref}+\Delta\rho$. Thus, with no extra added terms to the conventional incompressible Navier Stokes equations, the system will solve for the total pressure minus the hydrostatic pressure. | ||
For natural convection simulations, it is advisable to compute relevant dimensionless numbers such as the Rayleigh number or the Richardson number to decide on the need for turbulence models, mesh refinement and stability considerations. | ||
|
||
!syntax parameters /LinearFVKernels/LinearFVMomentumBoussinesq | ||
|
||
!syntax inputs /LinearFVKernels/LinearFVMomentumBoussinesq | ||
|
||
!syntax children /LinearFVKernels/LinearFVMomentumBoussinesq |
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
58 changes: 58 additions & 0 deletions
58
modules/navier_stokes/include/linearfvkernels/LinearFVEnergyAdvection.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,58 @@ | ||
//* 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 "LinearFVFluxKernel.h" | ||
#include "RhieChowMassFlux.h" | ||
#include "LinearFVAdvectionDiffusionBC.h" | ||
|
||
/** | ||
* An advection kernel that implements the advection term for the enthalpy in the | ||
* energy equation. | ||
*/ | ||
class LinearFVEnergyAdvection : public LinearFVFluxKernel | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
LinearFVEnergyAdvection(const InputParameters & params); | ||
|
||
virtual Real computeElemMatrixContribution() override; | ||
|
||
virtual Real computeNeighborMatrixContribution() override; | ||
|
||
virtual Real computeElemRightHandSideContribution() override; | ||
|
||
virtual Real computeNeighborRightHandSideContribution() override; | ||
|
||
virtual Real computeBoundaryMatrixContribution(const LinearFVBoundaryCondition & bc) override; | ||
|
||
virtual Real computeBoundaryRHSContribution(const LinearFVBoundaryCondition & bc) override; | ||
|
||
virtual void setupFaceData(const FaceInfo * face_info) override; | ||
|
||
protected: | ||
/// The Rhie-Chow user object that provides us with the face velocity | ||
const RhieChowMassFlux & _mass_flux_provider; | ||
|
||
/// The constant specific heat value | ||
const Real _cp; | ||
|
||
private: | ||
/// Container for the current advected interpolation coefficients on the face to make sure | ||
/// we don't compute it multiple times for different terms. | ||
std::pair<Real, Real> _advected_interp_coeffs; | ||
|
||
/// Container for the mass flux on the face which will be reused in the advection term's | ||
/// matrix and right hand side contribution | ||
Real _face_mass_flux; | ||
|
||
/// The interpolation method to use for the advected quantity | ||
Moose::FV::InterpMethod _advected_interp_method; | ||
}; |
49 changes: 49 additions & 0 deletions
49
modules/navier_stokes/include/linearfvkernels/LinearFVMomentumBoussinesq.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,49 @@ | ||
//* 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 "LinearFVElementalKernel.h" | ||
|
||
/** | ||
* Kernel that adds the component of the Boussinesq term in the momentum | ||
* equations to the right hand side. | ||
*/ | ||
class LinearFVMomentumBoussinesq : public LinearFVElementalKernel | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
|
||
/** | ||
* Class constructor. | ||
* @param params The InputParameters for the kernel. | ||
*/ | ||
LinearFVMomentumBoussinesq(const InputParameters & params); | ||
|
||
virtual Real computeMatrixContribution() override; | ||
|
||
virtual Real computeRightHandSideContribution() override; | ||
|
||
protected: | ||
/// Fluid Temperature | ||
const MooseLinearVariableFV<Real> & getTemperatureVariable(const std::string & vname); | ||
|
||
/// Index x|y|z of the momentum equation component | ||
const unsigned int _index; | ||
/// Pointer to the linear finite volume temperature variable | ||
const MooseLinearVariableFV<Real> & _temperature_var; | ||
/// The gravity vector | ||
const RealVectorValue _gravity; | ||
/// The thermal expansion coefficient | ||
const Moose::Functor<Real> & _alpha; | ||
/// Reference temperature at which the reference value of the density (_rho) was measured | ||
const Real _ref_temperature; | ||
/// the density | ||
const Moose::Functor<Real> & _rho; | ||
}; |
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
Oops, something went wrong.