Skip to content

Commit

Permalink
Merge pull request idaholab#27748 from pbehne/workshop
Browse files Browse the repository at this point in the history
Fixed some typos in workshop slides.
  • Loading branch information
GiudGiud authored Jun 23, 2024
2 parents 705cbc2 + 41e917a commit ed7323a
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To solve this problem, the following physics must be considered:
- Conservation of Energy:

!equation id=energy
C \left(\dfrac{\partial T}{\partial t} + \epsilon \vec{u} \cdot \nabla T \right) - \nabla \cdot k \nabla T = 0
\rho c_p \left(\dfrac{\partial T}{\partial t} + \epsilon \vec{u} \cdot \nabla T \right) - \nabla \cdot k \nabla T = 0

- Darcy's Law:

Expand Down
1 change: 1 addition & 0 deletions test/tests/outputs/checkpoint/checkpoint_interval.i
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@
type = Checkpoint
time_step_interval = 3
num_files = 2
wall_time_interval = 3600 # seconds
[]
[]
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,14 @@ more variables.

Advanced restart and recovery in MOOSE require checkpoint files

To enable automatic checkpoints using the default options (every time step, and keep last two) in
a simulation simply add the following flag to your input file:
Checkpoints are automatically enabled by default and are output every 1 hour of wall time (customizable interval), but can be disabled with:
```text
[Outputs]
wall_time_checkpoint = false
[]
```

Checkpoints can be output at every time step with the following shortcut syntax:

```text
[Outputs]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tests/
my_kernel_test.i [input file]
tests [test specification file]
gold/ [gold standard folder for validated solution]
out.e [solution]
out.e [solution]
```

!---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ The action of the Jacobian is approximated by:

!equation id=jfnk
\begin{aligned}
\mathbf{J}\mathbf{v} \approx \frac{\mathbf{R}(\mathbf{u}+\epsilon \mathbf{v})-\mathbf{R}(\mathbf{u})}{\epsilon}
\mathbf{J}(\mathbf{u})\mathbf{v} \approx \frac{\mathbf{R}(\mathbf{u}+\epsilon \mathbf{v})-\mathbf{R}(\mathbf{u})}{\epsilon}
\end{aligned}

The `Kernel` method `computeQpResidual` is called to compute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Split to integral to cell-wise integrals and use the divergence theorem:
On an internal cell (let's say on cell C), assuming that $\beta$ is constant:

!equation
\int_{\partial\Omega_i} (\vec{\beta}~u) \cdot \hat{n}~ dS = \sum_f^{N_{f,C}} \int_{\partial\Omega_{C,f}} (\vec{\beta}~u) \cdot \hat{n}~ dS \approx \sum_f^{N_{f,C}} \vec{\beta}_f~ u_f \hat{n}_f |S_f|
\int_{\partial\Omega_i} (\vec{\beta}~u) \cdot \hat{n}~ dS = \sum_f^{N_{f,C}} \int_{\partial\Omega_{C,f}} (\vec{\beta}~u) \cdot \hat{n}~ dS \approx \sum_f^{N_{f,C}} (\vec{\beta}_f~ u_f) \cdot \hat{n}_f |S_f|

!col-end!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Darcy's Law:
\vec{u} = -\frac{\mathbf{K}}{\mu} (\nabla p - \rho \vec{g})

where $\vec{u}$ is the fluid velocity, $\epsilon$ is porosity, $\mathbf{K}$ is the permeability
tensor, $\mu$ is fluid viscosity, $p$ is the pressure, $\rho$ is the density, $\vec{g}$ is the
tensor, $\mu$ is fluid viscosity, $p$ is the pressure, $\rho$ is the density, $\c_p$ is the specific heat, $\vec{g}$ is the
gravity vector, and $T$ is the temperature.

!---
Expand All @@ -45,17 +45,17 @@ $p$ and $T$:
-\nabla \cdot \frac{\mathbf{K}}{\mu} \nabla p = 0

!equation
C\left( \frac{\partial T}{\partial t} + \epsilon \vec{u}\cdot\nabla T \right) - \nabla \cdot k \nabla T = 0
\rho c_p \left( \frac{\partial T}{\partial t} + \epsilon \vec{u}\cdot\nabla T \right) - \nabla \cdot k \nabla T = 0

!---

The parameters $\rho$, $C$, and $k$ are the porosity-dependent density, heat capacity, and thermal
The parameters $\rho$, $c_p$, and $k$ are the porosity-dependent density, specific heat capacity, and thermal
conductivity of the combined fluid/solid medium, defined by:

!equation
\rho \equiv \epsilon \rho_f + (1-\epsilon) \rho_s
\\
C \equiv \epsilon \rho_f {c_p}_f + (1-\epsilon) \rho_s {c_p}_s
\rho c_p \equiv \epsilon \rho_f {c_p}_f + (1-\epsilon) \rho_s {c_p}_s
\\
k \equiv \epsilon k_f + (1-\epsilon) k_s

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
With the pressure equation handled, the heat conduction equation is next.

!equation
C\left( \frac{\partial T}{\partial t} + \epsilon \vec{u}\cdot\nabla T \right) - \nabla\cdot k \nabla T = 0
\rho c_p \left( \frac{\partial T}{\partial t} + \epsilon \vec{u}\cdot\nabla T \right) - \nabla\cdot k \nabla T = 0

!---

Expand Down Expand Up @@ -56,7 +56,7 @@ prop_values = '0.01 200'

!---

## Step 5b: Running Input File
## Step 5a: Running Input File

```bash
cd ~/projects/moose/tutorials/darcy_thermo_mech/step5_heat_conduction
Expand All @@ -74,7 +74,7 @@ cd problems
To create a time-dependent problem add in the time derivative:

!equation
C \frac{\partial T}{\partial t} - \nabla \cdot k \nabla T = 0
\rho c_p \frac{\partial T}{\partial t} - \nabla \cdot k \nabla T = 0

The time term exists in the heat transfer module as `ADHeatConductionTimeDerivative`, thus
only an update to the input file is required to run the transient case.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ they are coupled together.
!equation
-\nabla \cdot \frac{\mathbf{K}}{\mu} \nabla p = 0
\\
C\left( \frac{\partial T}{\partial t} + \underbrace{\epsilon \vec{u}\cdot\nabla T}_{\textrm{DarcyAdvection}} \right) - \nabla \cdot k \nabla T = 0
\rho c_p \frac{\partial T}{\partial t} + \underbrace{\rho c_p \epsilon \vec{u}\cdot\nabla T}_{\textrm{DarcyAdvection}} - \nabla \cdot k \nabla T = 0

- Objects have been created for everything except the $\vec{u}\cdot\nabla T$ term; a `Kernel`,
`DarcyAdvection`, will be developed for this term.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ This velocity can be computed using the Auxiliary system.
Solve the transient heat equation using the "heat conduction" module.

!equation
C \frac{\partial T}{\partial t} - \nabla \cdot k \nabla T = 0
\rho c_p \frac{\partial T}{\partial t} - \nabla \cdot k \nabla T = 0

!---

Expand All @@ -70,7 +70,7 @@ to the heat equation.
!equation
-\nabla \cdot \frac{\mathbf{K}}{\mu} \nabla p = 0
\\
C\left( \frac{\partial T}{\partial t} + \epsilon \vec{u}\cdot\nabla T \right) - \nabla \cdot k \nabla T = 0
\rho c_p \left( \frac{\partial T}{\partial t} + \epsilon \vec{u}\cdot\nabla T \right) - \nabla \cdot k \nabla T = 0

!---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ An action designed to build specific objects, such as the case in [#step09] for

The MOOSE action system operates on tasks, each task is connected to one or many actions.

For each task the `act()` method is called for each task, thus the act method can be used to
For each task the `act()` method is called. Thus the act method can be used to
create any number of objects.

!---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ nodal auxiliary variables

### Nodal Auxiliary Variables

Element auxiliary variables are computed at each node and are stored as linear Lagrange variables
Nodal auxiliary variables are computed at each node and are stored as linear Lagrange variables

AuxKernel objects computing nodal values can +only+ couple to nodal nonlinear variables and
other nodal auxiliary variables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ if the value has not been computed via a `declareProperty` call within a `Materi

Output of `Material` properties is enabled by setting the "outputs" parameter.

The following example creates two additional variables called "mat1" and "mat2" that will show up in
The following example creates additional variables called "real_property", "tensor_property", and "vector_property" that will show up in
the output file.

!listing output_block.i block=Materials Outputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ The content of each `Output` can customized, see for example for an [Exodus](Exo
```text
[Outputs]
interval = 10 # this is a time step interval
exodus = true
[all]
[exo]
type = Exodus
interval = 1 # overrides interval from top-level
[]
[cp]
type = Checkpoint # Uses interval specified from top-level
[]
[]
```

Expand All @@ -88,8 +90,6 @@ using the short-cut syntax. sub-blocks use the actual sub-block name as the suf
[]
```

The use of 'file_base' anywhere in the `[Outputs]` block disables all default naming behavior.

!---

!style fontsize=85%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class DarcyPressure : public ADKernel

// References to be set from Material system

/// The permeability. Note that this is declared as a \p MaterialProperty. This means that if
/// calculation of this property in the producing \p Material depends on non-linear variables, the
/// derivative information will be lost here in the consumer and the non-linear solve will suffer
/// The viscosity. This is declared as an \p ADMaterialProperty, meaning any derivative
/// information coming from the producing \p Material will be preserved and the integrity of the
/// non-linear solve will be likewise preserved
const ADMaterialProperty<Real> & _permeability;

/// The viscosity. This is declared as an \p ADMaterialProperty, meaning any derivative
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
// libMesh includes
#include "libmesh/fe.h"

registerMooseAction("DarcyThermoMechApp", SetupDarcySimulation, "setup_darcy");
registerMooseAction("DarcyThermoMechApp", SetupDarcySimulation, "add_aux_variable");
registerMooseAction("DarcyThermoMechApp", SetupDarcySimulation, "add_aux_kernel");
registerMooseAction("DarcyThermoMechApp", SetupDarcySimulation, "add_kernel");

InputParameters
SetupDarcySimulation::validParams()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,9 @@ DarcyThermoMechApp::registerApps()
void
DarcyThermoMechApp::registerAll(Factory & factory, ActionFactory & action_factory, Syntax & syntax)
{

Registry::registerObjectsTo(factory, {"DarcyThermoMechApp"});
Registry::registerActionsTo(action_factory, {"DarcyThermoMechApp"});
ModulesApp::registerAll(factory, action_factory, syntax);

registerSyntaxTask("SetupDarcySimulation", "DarcyThermoMech", "add_aux_variable");
registerSyntaxTask("SetupDarcySimulation", "DarcyThermoMech", "add_aux_kernel");
registerSyntaxTask("SetupDarcySimulation", "DarcyThermoMech", "add_kernel");
registerSyntax("SetupDarcySimulation", "DarcyThermoMech");
}

0 comments on commit ed7323a

Please sign in to comment.