Skip to content
Snippets Groups Projects
Commit eb9d68a5 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[examples][cahn-hilliard] minor improvements related to code docs

parent 13ff5521
No related branches found
No related tags found
1 merge request!3661Cleanup/cahn hilliard example
...@@ -85,7 +85,7 @@ public: ...@@ -85,7 +85,7 @@ public:
// In the `source` function, we implement the derivative of the free energy. // In the `source` function, we implement the derivative of the free energy.
// This demonstrates how parts of the local residual can be split into model specific // This demonstrates how parts of the local residual can be split into model specific
// parts and parts that might change from scenario to scenario. // parts (see `CahnHilliardModelLocalResidual`) and parts that might change from scenario to scenario.
template<class ElementVolumeVariables> template<class ElementVolumeVariables>
NumEqVector source(const Element &element, NumEqVector source(const Element &element,
const FVElementGeometry& fvGeometry, const FVElementGeometry& fvGeometry,
...@@ -114,7 +114,7 @@ public: ...@@ -114,7 +114,7 @@ public:
// The parameters interfaces are used in the local residual (see Part 1). // The parameters interfaces are used in the local residual (see Part 1).
// We can name this interface however we want as long as we adapt the calling site // We can name this interface however we want as long as we adapt the calling site
// in the `LocalResidual` class in `model.hh`. // in the `CahnHilliardModelLocalResidual` class in `model.hh`.
// [[codeblock]] // [[codeblock]]
Scalar mobility() const Scalar mobility() const
{ return mobility_; } { return mobility_; }
......
...@@ -181,14 +181,13 @@ public: ...@@ -181,14 +181,13 @@ public:
} }
// [[/codeblock]] // [[/codeblock]]
// **Flux term:** The function `computeFlux` computes the fluxes // **Flux term:** The function `computeFlux` computes the integrated
// over a sub control volume faces, including the integration over // fluxes over a sub control volume face.
// the area of the face.
// //
// ```math // ```math
// \begin{aligned} // \begin{aligned}
// F_{K,\sigma,0} &= -M \sum_{B \in \mathcal{B}_K} \mu_{h,B} \nabla N_B \cdot\boldsymbol{n} \vert \sigma \vert \cr // F_{K,\sigma,0} &= -M \vert \sigma \vert \sum_{B \in \mathcal{B}_K} \mu_{h,B} \nabla N_B \cdot\boldsymbol{n} \cr
// F_{K,\sigma,1} &= -\gamma \sum_{B \in \mathcal{B}_K} c_{h,B} \nabla N_B \cdot\boldsymbol{n} \vert \sigma \vert // F_{K,\sigma,1} &= -\gamma \vert \sigma \vert \sum_{B \in \mathcal{B}_K} c_{h,B} \nabla N_B \cdot\boldsymbol{n}
// \end{aligned} // \end{aligned}
// ```` // ````
// //
...@@ -209,7 +208,7 @@ public: ...@@ -209,7 +208,7 @@ public:
for (const auto& scv : scvs(fvGeometry)) for (const auto& scv : scvs(fvGeometry))
{ {
const auto& volVars = elemVolVars[scv]; const auto& volVars = elemVolVars[scv];
// v.axpy(a, w) means v <- v + a*w // v.axpy(a, w) means v += a*w
gradConcentration.axpy( gradConcentration.axpy(
volVars.concentration(), volVars.concentration(),
fluxVarCache.gradN(scv.indexInElement()) fluxVarCache.gradN(scv.indexInElement())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment