<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>multiPhysicsFoam – Finite-Area</title><link>https://multiphysicsfoam.com/tags/finite-area/</link><description>Recent content in Finite-Area on multiPhysicsFoam</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://multiphysicsfoam.com/tags/finite-area/index.xml" rel="self" type="application/rss+xml"/><item><title>Docs: calcCurvature</title><link>https://multiphysicsfoam.com/docs/user-guide/utilities/calccurvature/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://multiphysicsfoam.com/docs/user-guide/utilities/calccurvature/</guid><description>
&lt;h2 id="overview">Overview&lt;/h2>
&lt;p>&lt;code>calcCurvature&lt;/code> is a standalone application that builds the finite-area mesh
(&lt;code>faMesh&lt;/code>) of a case and evaluates the mean curvature of that surface for a
single time. It writes two volume fields, &lt;code>curvature&lt;/code> and &lt;code>curvatureNew&lt;/code>. Both
are zero everywhere except on the boundary patch named &lt;code>freeSurface&lt;/code> or
&lt;code>interface&lt;/code>. The curvature it computes is the same &lt;code>faMesh::faceCurvatures()&lt;/code>
that &lt;code>capillaryInterface&lt;/code> uses for the surface-tension pressure jump. Use it to
check the curvature quality of a surface mesh (e.g. a spherical bubble, where
$\kappa$ should be uniform) before running a capillary case. It is a single-mesh
tool: it does not read &lt;code>multiRegionProperties&lt;/code> and knows nothing about regions
beyond the standard &lt;code>-region&lt;/code> option.&lt;/p>
&lt;h2 id="method">Method&lt;/h2>
&lt;ol>
&lt;li>
&lt;p>&lt;strong>Time and mesh.&lt;/strong> The time is selected with the standard time options (see
&lt;a href="https://multiphysicsfoam.com/docs/user-guide/utilities/calccurvature/#usage">Usage&lt;/a>). The run time is set to the &lt;strong>first&lt;/strong> selected time, and only
that time is processed. The mesh is created as a &lt;code>dynamicFvMesh&lt;/code> (region
from &lt;code>-region&lt;/code>, default &lt;code>region0&lt;/code>). If &lt;code>constant/[&amp;lt;region&amp;gt;/]dynamicMeshDict&lt;/code>
is absent, a &lt;code>staticFvMesh&lt;/code> is used. The mesh is never moved.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Finite-area mesh.&lt;/strong> &lt;code>faMesh(mesh)&lt;/code> is constructed for the default area
name, i.e. it reads the &lt;code>faMesh&lt;/code> written by &lt;code>makeFaMesh&lt;/code>
(&lt;code>constant/[&amp;lt;region&amp;gt;/]faMesh&lt;/code>).&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Patch detection.&lt;/strong> The boundary is scanned for a patch named
&lt;code>freeSurface&lt;/code> or &lt;code>interface&lt;/code>. If both exist, the one with the higher patch
index wins. If neither exists, the application aborts with a bare
&lt;code>FatalError&lt;/code> (no message).&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Curvature&lt;/strong> (&lt;code>curvature&lt;/code>). The &lt;code>faMesh&lt;/code> face curvature is copied into the
detected patch:&lt;/p>
$$
\mathbf{k}_N = \frac{1}{S_f}\sum_{e \in f} \mathbf{L}_e\, c_e,
\qquad
\kappa = \operatorname{sign}\!\left(\mathbf{k}_N\cdot\mathbf{n}_f\right)\,|\mathbf{k}_N|
$$
&lt;p>with $S_f$ the face area, $\mathbf{L}_e$ the edge length vectors (&lt;code>Le()&lt;/code>),
$c_e$ the edge length correction (&lt;code>edgeLengthCorrection()&lt;/code>,
$c_e = \cos\!\big(\tfrac{1}{2}\arcsin|\mathbf{n}_a\times\mathbf{n}_b|\big)$ from
the two edge point normals) and $\mathbf{n}_f$ the &lt;code>faMesh&lt;/code> face area normal.
$\kappa$ is therefore signed relative to the &lt;code>faMesh&lt;/code> normal.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Alternative curvature&lt;/strong> (&lt;code>curvatureNew&lt;/code>). The same edge sum
$\mathbf{k}_N$ is computed again. A unit &amp;ldquo;normal&amp;rdquo; is built from it,
$\hat{\mathbf{n}} = \mathbf{k}_N/|\mathbf{k}_N|$, falling back to the
&lt;code>fvPatch&lt;/code> face normal where $|S_f\,\mathbf{k}_N| \le$ &lt;code>SMALL&lt;/code>. The written
value is&lt;/p>
$$
\kappa_\text{new} = \hat{\mathbf{n}}\cdot\mathbf{k}_N
$$
&lt;p>Because $\hat{\mathbf{n}}$ is parallel to $\mathbf{k}_N$, this is
$|\mathbf{k}_N| = |\kappa|$ wherever the fallback is not active, i.e. the
&lt;strong>unsigned&lt;/strong> curvature.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;strong>Report.&lt;/strong> Min/max and arithmetic mean (unweighted by face area) of both
patch fields are printed to the log.&lt;/p>
&lt;/li>
&lt;/ol>
&lt;h2 id="usage">Usage&lt;/h2>
&lt;p>Command line (standalone application):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">calcCurvature &lt;span class="o">[&lt;/span>-region &amp;lt;name&amp;gt;&lt;span class="o">]&lt;/span> &lt;span class="o">[&lt;/span>-time &amp;lt;ranges&amp;gt; &lt;span class="p">|&lt;/span> -latestTime&lt;span class="o">]&lt;/span> &lt;span class="o">[&lt;/span>-constant&lt;span class="o">]&lt;/span> &lt;span class="o">[&lt;/span>-noZero&lt;span class="o">]&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Option&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>-region &amp;lt;name&amp;gt;&lt;/code>&lt;/td>
&lt;td>Mesh region to operate on. Default: &lt;code>region0&lt;/code> (case root).&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>-time &amp;lt;ranges&amp;gt;&lt;/code>&lt;/td>
&lt;td>Time ranges to select (e.g. &lt;code>0.1&lt;/code>, &lt;code>:10,20 40:70&lt;/code>). Only the &lt;strong>first&lt;/strong> selected time is processed.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>-latestTime&lt;/code>&lt;/td>
&lt;td>Select the latest time. On its own, this processes the latest time; combined with other selections only the earliest one is processed.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>-constant&lt;/code>&lt;/td>
&lt;td>Include &lt;code>constant/&lt;/code> in the time list.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>-noZero&lt;/code>&lt;/td>
&lt;td>Exclude &lt;code>0/&lt;/code> from the time list.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Without time options all time directories (including &lt;code>0/&lt;/code>) are selected, so
the &lt;strong>earliest&lt;/strong> time is processed. If no time directory matches, &lt;code>constant/&lt;/code>
is used with a warning.&lt;/p>
&lt;p>Typical sequence for a single-mesh case:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">blockMesh
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">makeFaMesh
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">calcCurvature
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="input--output">Input / Output&lt;/h2>
&lt;p>&lt;strong>Read&lt;/strong>&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>File&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>constant/[&amp;lt;region&amp;gt;/]polyMesh&lt;/code>&lt;/td>
&lt;td>Volume mesh; must contain a patch named &lt;code>freeSurface&lt;/code> or &lt;code>interface&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>constant/[&amp;lt;region&amp;gt;/]faMesh&lt;/code>&lt;/td>
&lt;td>Finite-area mesh from &lt;code>makeFaMesh&lt;/code> on that patch&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>constant/[&amp;lt;region&amp;gt;/]dynamicMeshDict&lt;/code>&lt;/td>
&lt;td>Optional; selects the &lt;code>dynamicFvMesh&lt;/code> type (static if absent)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>system/[&amp;lt;region&amp;gt;/]faSchemes&lt;/code>, &lt;code>faSolution&lt;/code>&lt;/td>
&lt;td>Required by the &lt;code>faMesh&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>system/[&amp;lt;region&amp;gt;/]fvSchemes&lt;/code>, &lt;code>fvSolution&lt;/code>&lt;/td>
&lt;td>Required by the &lt;code>fvMesh&lt;/code>&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>&lt;strong>Written&lt;/strong> to &lt;code>&amp;lt;time&amp;gt;/[&amp;lt;region&amp;gt;/]&lt;/code> of the processed time:&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Field&lt;/th>
&lt;th>Type&lt;/th>
&lt;th>Unit&lt;/th>
&lt;th>Content&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>curvature&lt;/code>&lt;/td>
&lt;td>&lt;code>volScalarField&lt;/code>&lt;/td>
&lt;td>1/m&lt;/td>
&lt;td>0 in all cells and on all other patches; signed $\kappa$ on the free-surface/interface patch&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>curvatureNew&lt;/code>&lt;/td>
&lt;td>&lt;code>volScalarField&lt;/code>&lt;/td>
&lt;td>1/m&lt;/td>
&lt;td>0 in all cells and on all other patches; $\kappa_\text{new}$ (unsigned, see &lt;a href="https://multiphysicsfoam.com/docs/user-guide/utilities/calccurvature/#method">Method&lt;/a>) on that patch&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>All patches are of type &lt;code>calculated&lt;/code>. No other fields are read or written.&lt;/p>
&lt;h2 id="known-limitations">Known Limitations&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Single time only.&lt;/strong> The selected time list is not looped over. Only the
earliest selected time is processed, even if &lt;code>-time&lt;/code> selects several.&lt;/li>
&lt;li>&lt;strong>Fixed patch names.&lt;/strong> The patch must be called exactly &lt;code>freeSurface&lt;/code> or
&lt;code>interface&lt;/code>. There is no option to pick another name (e.g. &lt;code>interfaceShadow&lt;/code>).
A missing patch aborts with an empty error message.&lt;/li>
&lt;li>&lt;strong>faMesh must cover exactly that patch.&lt;/strong> The &lt;code>faMesh&lt;/code> face values are
assigned directly to the patch, so the &lt;code>faMesh&lt;/code> must be built on that patch
only, with the same face count and ordering. A &lt;code>faMesh&lt;/code> on a different or
additional patch causes a size mismatch.&lt;/li>
&lt;li>&lt;strong>&lt;code>curvatureNew&lt;/code> is unsigned.&lt;/strong> Its &amp;ldquo;normal&amp;rdquo; is derived from the edge sum
itself rather than from the surface normal, so it carries no sign. It is not
the signed normal force density that its comments suggest.&lt;/li>
&lt;li>&lt;strong>Mean of face values.&lt;/strong> The printed average is an unweighted face average,
not an area-weighted one.&lt;/li>
&lt;li>&lt;strong>Libraries for the &lt;code>dynamicMeshDict&lt;/code>.&lt;/strong> The application links only
&lt;code>finiteVolume&lt;/code>, &lt;code>finiteArea&lt;/code>, &lt;code>dynamicFvMesh&lt;/code>, &lt;code>dynamicMesh&lt;/code> and
&lt;code>meshTools&lt;/code>. A &lt;code>dynamicMeshDict&lt;/code> that selects a mesh type or motion solver
from another library (e.g. &lt;code>interfaceTrackingFvMesh&lt;/code>, or a motion solver
from &lt;code>fvMotionSolvers&lt;/code>) needs that library loaded through the dictionary&amp;rsquo;s
library entries. Otherwise the selection fails.&lt;/li>
&lt;li>&lt;strong>No parallel-specific handling.&lt;/strong> Min/max/average are evaluated per
processor without reduction.&lt;/li>
&lt;/ul>
&lt;h2 id="tutorials">Tutorials&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Tutorial&lt;/th>
&lt;th>Description&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>tutorials/multiphaseFlow/3dDuineveldRisingBubble/baseMeshes/meshA&lt;/code>&lt;/td>
&lt;td>Base bubble mesh generation (&lt;code>blockMesh&lt;/code>, &lt;code>makeFaMesh&lt;/code> on patch &lt;code>interface&lt;/code>). The &lt;code>calcCurvature&lt;/code> call is present but &lt;strong>commented out&lt;/strong> in &lt;code>Allrun&lt;/code>.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>tutorials/multiphaseFlow/3dDuineveldRisingBubble/hexBaseMeshes/meshA&lt;/code>&lt;/td>
&lt;td>Same for the hex base mesh; the call is likewise commented out.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table></description></item></channel></rss>