Skip to content

Commit

Permalink
Merge pull request #27242 from GiudGiud/PR_modules_doco
Browse files Browse the repository at this point in the history
Part 1 of finishing modules object & syntax documentation
  • Loading branch information
GiudGiud authored Apr 17, 2024
2 parents 5ea0409 + d181c7c commit b019223
Show file tree
Hide file tree
Showing 27 changed files with 369 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ provided to define $\nabla u$ on a boundary.
The total volume fraction of a given mineral species can be calculated using a
[`TotalMineralVolumeFraction`](/TotalMineralVolumeFraction.md) postprocessor.

## Reaction network parser
## Reaction network parser id=parser

The chemical reactions module includes a reaction network parser in the `Actions` system that enables
chemical reactions to be specified in a natural form in the input file. The parser then adds all
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
!template load file=stubs/moose_action.md.template name=AddCoupledEqSpeciesAction syntax=/ReactionNetwork/AqueousEquilibriumReactions/AddCoupledEqSpeciesAction
# AddCoupledEqSpeciesActions

!syntax description /ReactionNetwork/AqueousEquilibriumReactions/AddCoupledEqSpeciesAction

This action only creates the [Kernels](Kernels/index.md) and [AuxKernels](AuxKernels/index.md).
The primary species are created as [nonlinear variables](Variables/index.md), by the [AddPrimarySpeciesAction.md].
The reactions are parsed from the syntax described on this [page](modules/chemical_reactions/index.md#parser).
Equilibrium species are output as [auxiliary variables](AuxVariables/index.md), by the [AddSecondarySpeciesAction.md].
This action is the aqueous equilibrium pendant of the solid kinetic [AddCoupledSolidKinSpeciesAction.md].

!syntax parameters /ReactionNetwork/AqueousEquilibriumReactions/AddCoupledEqSpeciesAction

!syntax inputs /ReactionNetwork/AqueousEquilibriumReactions/AddCoupledEqSpeciesAction

!syntax children /ReactionNetwork/AqueousEquilibriumReactions/AddCoupledEqSpeciesAction
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
!template load file=stubs/moose_action.md.template name=AddCoupledSolidKinSpeciesAction syntax=/ReactionNetwork/SolidKineticReactions/AddCoupledSolidKinSpeciesAction
# AddCoupledSolidKinSpeciesActions

!syntax description /ReactionNetwork/SolidKineticReactions/AddCoupledSolidKinSpeciesAction

This action only creates the [Kernels](Kernels/index.md) and [AuxKernels](AuxKernels/index.md).
The primary species are created as [nonlinear variables](Variables/index.md), by the [AddPrimarySpeciesAction.md].
The reactions are parsed from the syntax described on this [page](modules/chemical_reactions/index.md#parser).
Equilibrium species are output as [auxiliary variables](AuxVariables/index.md), by the [AddSecondarySpeciesAction.md].
This action is the solid kinetic pendant of the aqueous equilibrium [AddCoupledEqSpeciesAction.md].

!syntax parameters /ReactionNetwork/SolidKineticReactions/AddCoupledSolidKinSpeciesAction

!syntax inputs /ReactionNetwork/SolidKineticReactions/AddCoupledSolidKinSpeciesAction

!syntax children /ReactionNetwork/SolidKineticReactions/AddCoupledSolidKinSpeciesAction
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
!template load file=stubs/moose_action.md.template name=AddPrimarySpeciesAction syntax=/ReactionNetwork/AqueousEquilibriumReactions/AddPrimarySpeciesAction
# AddPrimarySpeciesAction

!syntax description /ReactionNetwork/AqueousEquilibriumReactions/AddPrimarySpeciesAction

All the variables are created with the same finite element family and order, and with the same nonlinear variable
scaling.

!syntax parameters /ReactionNetwork/AqueousEquilibriumReactions/AddPrimarySpeciesAction

## Inputs for aqueous equilibrium reactions

!syntax inputs /ReactionNetwork/AqueousEquilibriumReactions/AddPrimarySpeciesAction

## Inputs for solid kinetics reactions

!syntax inputs /ReactionNetwork/SolidKineticReactions/AddPrimarySpeciesAction

!syntax children /ReactionNetwork/AqueousEquilibriumReactions/AddPrimarySpeciesAction
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
!template load file=stubs/moose_action.md.template name=AddSecondarySpeciesAction syntax=/ReactionNetwork/AqueousEquilibriumReactions/AddSecondarySpeciesAction
# AddSecondarySpeciesAction

!syntax description /ReactionNetwork/AqueousEquilibriumReactions/AddSecondarySpeciesAction

All the variables are created with the same finite element family and order, which are also
shared by the primary variables created within the same syntax by the [AddPrimarySpeciesAction.md].

!syntax parameters /ReactionNetwork/AqueousEquilibriumReactions/AddSecondarySpeciesAction

## Inputs for aqueous equilibrium reactions

!syntax inputs /ReactionNetwork/AqueousEquilibriumReactions/AddSecondarySpeciesAction

## Inputs for solid kinetics reactions

!syntax inputs /ReactionNetwork/SolidKineticReactions/AddSecondarySpeciesAction

!syntax children /ReactionNetwork/AqueousEquilibriumReactions/AddSecondarySpeciesAction
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
!template load file=stubs/moose_object.md.template name=DesorptionFromMatrix syntax=/Kernels/DesorptionFromMatrix
# DesorptionFromMatrix

!syntax description /Kernels/DesorptionFromMatrix

The weak form for this term is:

!equation
(\dot{m}, \psi)

where $\dot{m}$ is the mass rate from the matrix to the porespace and $\psi$ the test function.
The mass rates used in the kernel are retrieved directly from material properties, with the property name
following the same convention as [LangmuirMaterial.md] and [MollifiedLangmuirMaterial.md], e.g. "mass_rate_from_matrix"
for the mass rate, and "dmass_rate_from_matrix_dC" / "dmass_rate_from_matrix_dp" for its derivatives with regards to the
nonlinear variables, concentration and pore pressure.

!syntax parameters /Kernels/DesorptionFromMatrix

!syntax inputs /Kernels/DesorptionFromMatrix

!syntax children /Kernels/DesorptionFromMatrix
Original file line number Diff line number Diff line change
@@ -1 +1,20 @@
!template load file=stubs/moose_object.md.template name=DesorptionToPorespace syntax=/Kernels/DesorptionToPorespace
# DesorptionToPorespace

!syntax description /Kernels/DesorptionToPorespace

The weak form for this term is:

!equation
(-\dot{m}, \psi)

where $\dot{m}$ is the mass rate from the matrix to the porespace and $\psi$ the test function.
The mass rates used in the kernel are retrieved directly from material properties, with the property name
following the same convention as [LangmuirMaterial.md] and [MollifiedLangmuirMaterial.md], e.g. "mass_rate_from_matrix"
for the mass rate, and "dmass_rate_from_matrix_dC" / "dmass_rate_from_matrix_dp" for its derivatives with regards to the
nonlinear variables, concentration and pore pressure.

!syntax parameters /Kernels/DesorptionToPorespace

!syntax inputs /Kernels/DesorptionToPorespace

!syntax children /Kernels/DesorptionToPorespace
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
!template load file=stubs/moose_object.md.template name=LangmuirMaterial syntax=/Materials/LangmuirMaterial
# LangmuirMaterial

!syntax description /Materials/LangmuirMaterial

This material computes the mass rates from the matrix to the porespace, as well as the derivatives
of the mass rates with regards to the gas species and with regards to the pressure.

If the concentration is above the equilibrium concentration, desorption occurs and the mass rate is
equal to

!equation
\dot{m}_{m\rightarrow p} = \dfrac{C-C_{eq}}{K_d}

else adsorption is happening and:

!equation
\dot{m}_{m\rightarrow p} = \dfrac{C-C_{eq}}{K_a}

where $m_{m\rightarrow p}$ is the mass rate from the matrix to the porespace, $C$ the species concentration, $C_{eq}$ the
equilibrium concentration and $K_d$ / $K_a$ are the desorption and adsorption time constants (in seconds).

!syntax parameters /Materials/LangmuirMaterial

!syntax inputs /Materials/LangmuirMaterial

!syntax children /Materials/LangmuirMaterial
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
!template load file=stubs/moose_object.md.template name=MollifiedLangmuirMaterial syntax=/Materials/MollifiedLangmuirMaterial
# MollifiedLangmuirMaterial

!syntax description /Materials/MollifiedLangmuirMaterial

This material computes the mollified mass rates from the matrix to the porespace, as well as the derivatives
of the mollified mass rates with regards to the gas species and with regards to the pressure.

If the concentration is above the equilibrium concentration, desorption occurs and the mass rate is
equal to

!equation
\dot{m}_{m\rightarrow p} = A_{mol} * \dfrac{C-C_{eq}}{K_d}

else adsorption is happening and:

!equation
\dot{m}_{m\rightarrow p} = A_{mol} * \dfrac{C-C_{eq}}{K_a}

where $m_{m\rightarrow p}$ is the mass rate from the matrix to the porespace, $C$ the species concentration, $C_{eq}$ the
equilibrium concentration and $K_d$ / $K_a$ are the desorption and adsorption time constants (in seconds). The mollifier term
$A_{mol}$ is equal to

!equation
A_{mol} = tanh(\dfrac{C - C_{eq}}{ \text{mollifier} * \text{Langmuir density}})

!syntax parameters /Materials/MollifiedLangmuirMaterial

!syntax inputs /Materials/MollifiedLangmuirMaterial

!syntax children /Materials/MollifiedLangmuirMaterial
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
!template load file=stubs/moose_system.md.template name=AqueousEquilibriumReactions syntax=/ReactionNetwork/AqueousEquilibriumReactions
# AqueousEquilibriumReactions syntax

This syntax, nesting parameters in the `[ReactionNetwork/AqueousEquilibriumReactions]` block, is used to describe aqueous equilibrium chemical reactions.
The following actions use the parameters defined in this syntax:

- [AddCoupledEqSpeciesAction.md] to define the kernels and auxiliary kernels for the equations describing the chemical reactions.
- [AddPrimarySpeciesAction.md] to define the nonlinear variables for the primary species.
- [AddSecondarySpeciesAction.md] to define the auxiliary variables for the secondary species.

!syntax list /ReactionNetwork/AqueousEquilibriumReactions objects=True actions=False subsystems=False

!syntax list /ReactionNetwork/AqueousEquilibriumReactions objects=False actions=False subsystems=True

!syntax list /ReactionNetwork/AqueousEquilibriumReactions objects=False actions=True subsystems=False

Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
!template load file=stubs/moose_system.md.template name=SolidKineticReactions syntax=/ReactionNetwork/SolidKineticReactions
# SolidKineticReactions syntax

This syntax, nesting parameters in the `[ReactionNetwork/SolidKineticReactions]` block, is used to describe solid kinetic reactions.
The following actions use the parameters defined in this syntax:

- [AddCoupledSolidKinSpeciesAction.md] to define the kernels and auxiliary kernels for the equations describing the chemical reactions.
- [AddPrimarySpeciesAction.md] to define the nonlinear variables for the primary species.
- [AddSecondarySpeciesAction.md] to define the auxiliary variables for the secondary species.

!syntax list /ReactionNetwork/SolidKineticReactions objects=True actions=False subsystems=False

!syntax list /ReactionNetwork/SolidKineticReactions objects=False actions=False subsystems=True

!syntax list /ReactionNetwork/SolidKineticReactions objects=False actions=True subsystems=False
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
!template load file=stubs/moose_system.md.template name=ReactionNetwork syntax=/ReactionNetwork
# ReactionNetwork syntax

The `ReactionNetwork` parent block syntax is shared by the [aqueous equilibrium reactions](AqueousEquilibriumReactions/index.md)
and [solid kinetics reactions](SolidKineticReactions/index.md) syntaxes. Both are nested under their respective sub-block, and can be
defined simultaneously.

!syntax list /ReactionNetwork objects=True actions=False subsystems=False

!syntax list /ReactionNetwork objects=False actions=False subsystems=True

!syntax list /ReactionNetwork objects=False actions=True subsystems=False
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# NumAugmentedLagrangeIterations

!syntax description /Postprocessors/NumAugmentedLagrangeIterations

Defaults to 0 if the problem is not an [AugmentedLagrangianContactProblem.md].
The reader is referred to the [AugmentedLagrangianContactProblem.md] for more explanation
on the augmented Lagrangian iteration.

!syntax parameters /Postprocessors/NumAugmentedLagrangeIterations

!syntax inputs /Postprocessors/NumAugmentedLagrangeIterations

!syntax children /Postprocessors/NumAugmentedLagrangeIterations
27 changes: 16 additions & 11 deletions modules/navier_stokes/doc/content/source/bcs/INSFEFluidEnergyBC.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# INSFEFluidEnergyBC

!alert construction title=Undocumented Class
The INSFEFluidEnergyBC has not been documented. The content listed below should be used as a starting point for
documenting the class, which includes the typical automatic documentation associated with a
MooseObject; however, what is contained is ultimately determined by what is necessary to make the
documentation clear for users.

!syntax description /BCs/INSFEFluidEnergyBC

## Overview

!! Replace these lines with information regarding the INSFEFluidEnergyBC object.
This boundary condition can be used for porous media flow using the [!param](/BCs/INSFEFluidEnergyBC/porosity) parameter
to define the porosity.

## Example Input File Syntax
## Overview

!! Describe and include an example of how to use the INSFEFluidEnergyBC object.
This boundary condition can be used for porous media flow using the [!param](/BCs/INSFEFluidEnergyBC/porosity_elem) parameter
to define the porosity.

If the [!param](/BCs/INSFEFluidEnergyBC/v_fn) parameter is specified, it is used to compute the boundary fluid
velocity. If not, the domain velocity variables are used.
This kind of setup makes this boundary condition flexible to handle both specified velocity and specified pressure (thus velocity is part of the solutions) situations.
This boundary condition is reversible. If the velocity is outgoing from the boundary,
then the temperature considered for the heat flux is computed using the [!param](/BCs/INSFEFluidEnergyBC/temperature)
parameter variable.
If the velocity is such that the fluid enters the boundary, the fluid temperature is computed using the
[!param](/BCs/INSFEFluidEnergyBC/T_fn) parameter function, or the [!param](/BCs/INSFEFluidEnergyBC/T_branch)
parameter scalar variable, depending on which is specified.
The use of scalar variables is intended for coupling with thermal hydraulics components (in SAM).

!syntax parameters /BCs/INSFEFluidEnergyBC

Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# INSFEFluidEnergyDirichletBC

!alert construction title=Undocumented Class
The INSFEFluidEnergyDirichletBC has not been documented. The content listed below should be used as a starting point for
documenting the class, which includes the typical automatic documentation associated with a
MooseObject; however, what is contained is ultimately determined by what is necessary to make the
documentation clear for users.

!syntax description /BCs/INSFEFluidEnergyDirichletBC

## Overview

!! Replace these lines with information regarding the INSFEFluidEnergyDirichletBC object.

## Example Input File Syntax

!! Describe and include an example of how to use the INSFEFluidEnergyDirichletBC object.
If the [!param](/BCs/INSFEFluidEnergyBC/v_fn) parameter is specified, it is used to compute the boundary fluid
velocity. If not, the domain velocity variables are used. The velocity is used to determine whether the boundary is
an inlet.

This boundary condition provides a `conditional' Dirichlet temperature boundary condition for the energy equation, given that no integration by parts is applied to the energy advection term.
Without applying integration by parts to the advection term, the energy equation needs a Dirichlet temperature boundary condition for an inlet condition.
This object additionally introduces a natural boundary condition at outlets.
This conditional Dirichlet boundary condition relies on its `shouldApply()' function to determine if it should be applied.
The fluid temperature is computed using the
[!param](/BCs/INSFEFluidEnergyDirichletBC/T_fn) parameter function, or the [!param](/BCs/INSFEFluidEnergyDirichletBC/T_scalar)
parameter scalar variable, depending on which is specified. The use of scalar variables is intended for coupling with thermal hydraulics components (in SAM).

!syntax parameters /BCs/INSFEFluidEnergyDirichletBC

Expand Down
19 changes: 10 additions & 9 deletions modules/navier_stokes/doc/content/source/bcs/INSFEFluidMassBC.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
# INSFEFluidMassBC

!alert construction title=Undocumented Class
The INSFEFluidMassBC has not been documented. The content listed below should be used as a starting point for
documenting the class, which includes the typical automatic documentation associated with a
MooseObject; however, what is contained is ultimately determined by what is necessary to make the
documentation clear for users.

!syntax description /BCs/INSFEFluidMassBC

This boundary condition can be used for porous media flow using the [!param](/BCs/INSFEFluidEnergyBC/porosity) parameter
to define the porosity.
This boundary condition can describe both an inlet and an outlet.

## Overview

!! Replace these lines with information regarding the INSFEFluidMassBC object.
If either the [!param](/BCs/INSFEFluidMassBC/v_fn) or [!param](/BCs/INSFEFluidMassBC/v_pps) parameters are specified, they are used to compute the boundary fluid velocity. If not, the domain velocity variables are used.
The mass flux is computed as

## Example Input File Syntax
!equation
\rho v_{bc}

!! Describe and include an example of how to use the INSFEFluidMassBC object.
where $\rho$ is the local fluid density and $v_{bc}$ is the boundary fluid velocity. The mass flux times the test
function is the contribution of this boundary condition to the residual.

!syntax parameters /BCs/INSFEFluidMassBC

Expand Down
Loading

0 comments on commit b019223

Please sign in to comment.