-
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 #29156 from GiudGiud/PR_scalars_sys
Add scalar systems to linearFV version of SIMPLE
- Loading branch information
Showing
53 changed files
with
1,445 additions
and
383 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
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
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
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/LinearFVScalarAdvection.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 @@ | ||
# LinearFVScalarAdvection | ||
|
||
This kernel adds the contributions of the scalar advection term to the matrix and right hand side of the scalar equation system for the finite volume SIMPLE segregated solver [SIMPLE.md]. | ||
|
||
This term is described by $\nabla \cdot \left(\vec{u} C_i \right)$ present in the scalar equation conservation for an incompressible/weakly-compressible formulation. | ||
|
||
For FV, the integral of the advection term of scalar $C_i$ over a cell can be expressed as: | ||
|
||
\begin{equation} | ||
\int\limits_{V_C} \nabla \cdot \left(\vec{u} C_i \right) dV \approx \sum\limits_f ( \vec{u}\cdot \vec{n})_{RC} C_if |S_f| \, | ||
\end{equation} | ||
|
||
where $C_{if}$ is the face value of the scalar concentration. 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 volumetric face flux $(\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/LinearFVScalarAdvection | ||
|
||
!syntax inputs /LinearFVKernels/LinearFVScalarAdvection | ||
|
||
!syntax children /LinearFVKernels/LinearFVScalarAdvection |
43 changes: 43 additions & 0 deletions
43
.../navier_stokes/doc/content/source/physics/WCNSLinearFVScalarTransportPhysics.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,43 @@ | ||
# Navier Stokes Linear Scalar Transport / WCNSLinearFVScalarTransportPhysics | ||
|
||
!syntax description /Physics/NavierStokes/ScalarTransportSegregated/WCNSLinearFVScalarTransportPhysics | ||
|
||
## Equation | ||
|
||
This [Physics](Physics/index.md) object creates the kernels and boundary conditions to solve the advection-diffusion-reaction | ||
equation for several scalar quantities advected by the flow. | ||
|
||
!equation | ||
\dfrac{\partial \phi_i}{\partial t} + \nabla \cdot (\phi_i \mathbf{v}) - \nabla \cdot (k_i \nabla \phi_i) - Q_i - \lambda_i \phi_i = 0 | ||
|
||
where: | ||
|
||
- $\phi_i$ is the i-th scalar quantity | ||
- \mathbf{v} is the advecting velocity | ||
- $k_i$ the i-th scalar diffusivity | ||
- $Q_i$ is the i-th scalar source | ||
- $\lambda_i$ is a reaction coefficient. It should be negative for a loss term | ||
|
||
The kernels created are: | ||
|
||
- [LinearFVScalarAdvection.md] for the scalar advection term | ||
- [LinearFVDiffusion.md] for the scalar diffusion term | ||
- [LinearFVSource.md] for the source terms | ||
|
||
Reaction terms can be expressed as source terms by using a negative coefficient in the | ||
[!param](/Physics/NavierStokes/ScalarTransportSegregated/WCNSLinearFVScalarTransportPhysics/passive_scalar_coupled_source_coeff) | ||
parameter, and the scalar variable as one of the | ||
[!param](/Physics/NavierStokes/ScalarTransportSegregated/WCNSLinearFVScalarTransportPhysics/passive_scalar_coupled_source)(s). | ||
|
||
## Coupling with other Physics | ||
|
||
Scalar advection equations can be solved concurrently with the flow equations by combining the [WCNSLinearFVFlowPhysics.md] with the `WCNSLinearFVScalarTransportPhysics`. | ||
The following input performs this coupling for incompressible flow in a 2D channel. | ||
|
||
!listing test/tests/finite_volume/ins/channel-flow/linear-segregated/2d-scalar/channel-physics.i block=Physics | ||
|
||
!syntax parameters /Physics/NavierStokes/ScalarTransportSegregated/WCNSLinearFVScalarTransportPhysics | ||
|
||
!syntax inputs /Physics/NavierStokes/ScalarTransportSegregated/WCNSLinearFVScalarTransportPhysics | ||
|
||
!syntax children /Physics/NavierStokes/ScalarTransportSegregated/WCNSLinearFVScalarTransportPhysics |
11 changes: 11 additions & 0 deletions
11
...okes/doc/content/syntax/Physics/NavierStokes/ScalarTransportSegregated/index.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,11 @@ | ||
# Navier Stokes Scalar Transport Linear Physics | ||
|
||
This syntax was created for the [WCNSLinearFVScalarTransportPhysics.md] `Physics`. | ||
The additional nesting is intended to allow the definition of multiple instances of this `Physics`, | ||
with different block restrictions. | ||
|
||
!syntax list /Physics/NavierStokes/ScalarTransportSegregated objects=True actions=False subsystems=False | ||
|
||
!syntax list /Physics/NavierStokes/ScalarTransportSegregated objects=False actions=False subsystems=True | ||
|
||
!syntax list /Physics/NavierStokes/ScalarTransportSegregated objects=False actions=True subsystems=False |
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/navier_stokes/include/linearfvkernels/LinearFVScalarAdvection.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 "LinearFVFluxKernel.h" | ||
#include "RhieChowMassFlux.h" | ||
#include "LinearFVAdvectionDiffusionBC.h" | ||
|
||
/** | ||
* An advection kernel that implements the advection term for the passive scalar transport equation. | ||
*/ | ||
class LinearFVScalarAdvection : public LinearFVFluxKernel | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
LinearFVScalarAdvection(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; | ||
|
||
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 velocity on the face which will be reused in the advection term's | ||
/// matrix and right hand side contribution | ||
Real _volumetric_face_flux; | ||
|
||
/// The interpolation method to use for the advected quantity | ||
Moose::FV::InterpMethod _advected_interp_method; | ||
}; |
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.