<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>multiPhysicsFoam – Partitioned</title><link>https://multiphysicsfoam.com/tags/partitioned/</link><description>Recent content in Partitioned on multiPhysicsFoam</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="https://multiphysicsfoam.com/tags/partitioned/index.xml" rel="self" type="application/rss+xml"/><item><title>Docs: genericRegionCoupledFlux</title><link>https://multiphysicsfoam.com/docs/user-guide/boundary-conditions/coupled-boundary-conditions/genericregioncoupledflux/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://multiphysicsfoam.com/docs/user-guide/boundary-conditions/coupled-boundary-conditions/genericregioncoupledflux/</guid><description>
&lt;h2 id="overview">Overview&lt;/h2>
&lt;p>&lt;code>genericRegionCoupledFlux&amp;lt;Type&amp;gt;&lt;/code> is the flux side (Neumann side) of the
partitioned Dirichlet–Neumann (DNA) coupling. It derives from &lt;code>fixedGradient&lt;/code>
and from &lt;code>interfaceToInterfaceCoupleManager&lt;/code>. In each coupling iteration it
reads the diffusive flux of the value-side partner (a
&lt;code>genericRegionCoupledJump&lt;/code>-derived BC on the neighbour patch), interpolates it
onto this patch, negates it, adds a &lt;em>flux jump&lt;/em> $j_q$ and divides by the
local diffusivity. The result is relaxed with an acceleration model and fixed
as the patch-normal gradient. Every partitioned flux-side BC derives from it:
&lt;code>regionCoupledScalarFlux&lt;/code>, &lt;code>regionCoupledHeatFlux&lt;/code>,
&lt;code>regionCoupledPhaseChangeHeatFlux&lt;/code>, &lt;code>regionCoupledVelocityFlux&lt;/code>,
&lt;code>regionCoupledPressureFlux&lt;/code>, &lt;code>regionCoupledMassTransferVelocityFlux&lt;/code> and
&lt;code>regionCoupledTraction&lt;/code>.&lt;/p>
&lt;p>The template is also registered as a selectable patch field type
&lt;code>genericRegionCoupledFlux&lt;/code> for &lt;code>scalar&lt;/code> and &lt;code>vector&lt;/code> fields. Both &lt;code>fluxJump()&lt;/code>
and &lt;code>flux()&lt;/code> are &lt;code>notImplemented&lt;/code>, so the bare type aborts on the first
&lt;code>updateCoeffs()&lt;/code> (see Known Limitations). In a case, use a derived BC such as
&lt;code>regionCoupledScalarFlux&lt;/code>.&lt;/p>
&lt;h2 id="mathematical-formulation">Mathematical Formulation&lt;/h2>
&lt;p>Let $F$ be the patch with this BC and $J$ the neighbour patch with the
value-side partner. The unrelaxed gradient in coupling iteration $k$ is&lt;/p>
$$
\left.\frac{\partial \tilde\phi_F}{\partial n}\right|^{k}
= \frac{-\,\mathcal{I}_{J\to F}\!\left(q_J\right) + j_q}{\Gamma_F}
\quad \text{on } \Gamma,
\qquad q_J = \Gamma_J \left.\frac{\partial \phi_J}{\partial n}\right|_b
$$
&lt;p>so that, at convergence,&lt;/p>
$$
\Gamma_F \frac{\partial \phi_F}{\partial n_F} + \Gamma_J \frac{\partial \phi_J}{\partial n_J} = j_q .
$$
&lt;p>$q_J$ is the &lt;code>flux()&lt;/code> of the jump-side partner, computed with its own
non-orthogonal/second-order settings (see &lt;code>genericRegionCoupledJump&lt;/code>). The
gradient is then relaxed (fixed, Aitken or IQN-ILS, as for
&lt;code>genericRegionCoupledJump&lt;/code>):&lt;/p>
$$
g_F^{\,k} = g_F^{\,k-1} + \omega^k \left(\tilde g_F^{\,k} - g_F^{\,k-1}\right).
$$
&lt;p>The patch value is evaluated from the gradient:&lt;/p>
$$
\phi_b =
\begin{cases}
\phi_P + \mathbf{k}\cdot\nabla\phi_P + \dfrac{g_F}{\Delta_f} &amp; \texttt{secondOrder false} \\[8pt]
\phi_P + \mathbf{k}\cdot\nabla\phi_P + \dfrac{g_F + \mathbf{n}\cdot\nabla\phi_P}{2\,\Delta_f} &amp; \texttt{secondOrder true}
\end{cases}
$$
&lt;p>The term $\mathbf{k}\cdot\nabla\phi_P$ ($\mathbf{k} = \mathbf{d} - \mathbf{n}(\mathbf{n}\cdot\mathbf{d})$)
is only present with &lt;code>nonOrthCorr true&lt;/code>.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Symbol&lt;/th>
&lt;th>Description&lt;/th>
&lt;th>Unit&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>$\phi$&lt;/td>
&lt;td>Coupled field (&lt;code>scalar&lt;/code> or &lt;code>vector&lt;/code>), same name in both regions&lt;/td>
&lt;td>field-dependent&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$g_F$&lt;/td>
&lt;td>Fixed patch-normal gradient (&lt;code>gradient()&lt;/code>)&lt;/td>
&lt;td>field-dependent / m&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$q_J$&lt;/td>
&lt;td>Diffusive flux of the jump-side partner&lt;/td>
&lt;td>field-dependent&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$\mathcal{I}_{J\to F}$&lt;/td>
&lt;td>Interface-to-interface interpolation of the owning interface&lt;/td>
&lt;td>–&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$j_q$&lt;/td>
&lt;td>Flux jump, &lt;code>fluxJump()&lt;/code> of the derived class&lt;/td>
&lt;td>as $q$&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$\Gamma_F$, $\Gamma_J$&lt;/td>
&lt;td>Diffusivities from &lt;code>diffCoeff()&lt;/code> on each side&lt;/td>
&lt;td>field-dependent&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$\Delta_f$&lt;/td>
&lt;td>&lt;code>patch().deltaCoeffs()&lt;/code>&lt;/td>
&lt;td>1/m&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$\mathbf{n}$, $\mathbf{d}$&lt;/td>
&lt;td>Outward unit face normal, face-to-cell-centre vector&lt;/td>
&lt;td>–, m&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The interface residual checked by the DNA loop is&lt;/p>
$$
r = \left|\Gamma_F\, g_F + \mathcal{I}_{J\to F}(q_J) - j_q\right|,
\qquad
\|r\| = \frac{\|r\|_2}{\max\!\left(\min\!\left(\|\Gamma_F\, g_F\|_2,\ \|-\mathcal{I}_{J\to F}(q_J) + j_q\|_2\right),\ \texttt{SMALL}\right)}
$$
&lt;p>with the global $L_2$ norm over the patch faces. The own flux uses the
stored (relaxed) gradient $g_F$, not a gradient recomputed from the
solution.&lt;/p>
&lt;h2 id="implementation">Implementation&lt;/h2>
&lt;p>&lt;strong>Finding the interface.&lt;/strong> As for &lt;code>genericRegionCoupledJump&lt;/code>: the interface
is the registered &lt;code>regionInterfaceType&lt;/code> whose type equals the &lt;strong>first&lt;/strong>
&lt;code>interfaceType&lt;/code> entry and that contains this region/patch on side A or B.
No match, or more than one match of that type, is a &lt;code>FatalError&lt;/code>. The
neighbour region/patch is the other side of that interface.&lt;/p>
&lt;p>&lt;strong>&lt;code>updateCoeffs()&lt;/code>&lt;/strong>:&lt;/p>
&lt;ol>
&lt;li>Returns at once if already updated or if the interface is not &lt;code>coupled&lt;/code>
(the gradient keeps its last value).&lt;/li>
&lt;li>Calls &lt;code>update()&lt;/code> on the matched interface (topology update, curvature
update if a finite-area mesh exists, then the interface&amp;rsquo;s &lt;code>correct()&lt;/code>).&lt;/li>
&lt;li>If the derived class returns &lt;code>useDirectFlux() == true&lt;/code>, the gradient is
set to &lt;code>flux()&lt;/code> directly. In this repository only &lt;code>regionCoupledTraction&lt;/code>
does that.&lt;/li>
&lt;li>Otherwise it looks up the neighbour field under the &lt;strong>local field name&lt;/strong>,
&lt;code>refCast&lt;/code>s its patch field on the neighbour patch to
&lt;code>genericRegionCoupledJumpFvPatchField&amp;lt;Type&amp;gt;&lt;/code> and calls its &lt;code>flux()&lt;/code>. The
flux is interpolated with &lt;code>interpolateFromNbrField&lt;/code>, multiplied by $-1$,
&lt;code>fluxJump()&lt;/code> is added, and the result is divided by &lt;code>diffCoeff()&lt;/code>.&lt;/li>
&lt;li>Relaxes the gradient in place with the acceleration model
(&lt;code>accModel_-&amp;gt;relax(this-&amp;gt;gradient())&lt;/code>).&lt;/li>
&lt;li>Calls &lt;code>fixedGradientFvPatchField::updateCoeffs()&lt;/code>.&lt;/li>
&lt;/ol>
&lt;p>&lt;strong>&lt;code>evaluate()&lt;/code>&lt;/strong> is specialised for &lt;code>scalar&lt;/code> and &lt;code>vector&lt;/code>. It calls
&lt;code>updateCoeffs()&lt;/code> if needed and sets the patch value with the formula above,
using &lt;code>grad(&amp;lt;field&amp;gt;)&lt;/code> if registered, otherwise &lt;code>fvc::grad(&amp;lt;field&amp;gt;)&lt;/code>. The
&lt;code>vector&lt;/code> version first calls &lt;code>fixedGradientFvPatchVectorField::evaluate()&lt;/code> and
then overwrites the value. The matrix coefficients (&lt;code>valueInternalCoeffs&lt;/code>,
&lt;code>valueBoundaryCoeffs&lt;/code>, &lt;code>gradientInternalCoeffs&lt;/code>, &lt;code>gradientBoundaryCoeffs&lt;/code>) are
not overridden. The diffusion term therefore receives exactly $g_F$, while
the corrections only enter through the evaluated patch value.&lt;/p>
&lt;p>&lt;strong>&lt;code>diffCoeff()&lt;/code>&lt;/strong> is identical to the jump side: name from
&lt;code>diffusivityName()&lt;/code> (the &lt;code>diffusivity&lt;/code> keyword unless overridden), &lt;code>v&lt;/code> →
&lt;code>rho&lt;/code>, &lt;code>volScalarField&lt;/code> of that name if registered, else a uniform
&lt;code>dimensionedScalar&lt;/code> from the region&amp;rsquo;s &lt;code>transportProperties&lt;/code>, and 1 for a
field named &lt;code>pKin&lt;/code>.&lt;/p>
&lt;p>&lt;strong>Residuals.&lt;/strong> &lt;code>rawResidual()&lt;/code> and &lt;code>normResidual()&lt;/code> are called through
&lt;code>regionInterfaceType::rawFluxRes/normFluxRes&lt;/code>. &lt;code>dnaControl&lt;/code> compares the
normalised value against &lt;code>maxFluxRes&lt;/code> and writes the raw value to
&lt;code>&amp;lt;field&amp;gt;initialFluxRes&lt;/code> / &lt;code>&amp;lt;field&amp;gt;finalFluxRes&lt;/code> when &lt;code>outputFluxResField&lt;/code> is
on. &lt;code>ofNormResidual()&lt;/code> exists but is not called. With &lt;code>useDirectFlux()&lt;/code> all
residual functions stop with a &lt;code>FatalError&lt;/code>, so a derived class that uses
the direct flux must not be checked through the generic flux residual.&lt;/p>
&lt;p>&lt;strong>Acceleration.&lt;/strong> The same &lt;code>accelerationModel&lt;/code> family as on the jump side
(&lt;code>fixed&lt;/code>, &lt;code>aitken&lt;/code>, &lt;code>IQNILS&lt;/code>), applied to the gradient field. See
&lt;code>genericRegionCoupledJump&lt;/code> for the update formulas.&lt;/p>
&lt;h2 id="dictionary-entries">Dictionary Entries&lt;/h2>
&lt;p>All keywords read by the dictionary constructor (including those of
&lt;code>interfaceToInterfaceCoupleManager&lt;/code>, &lt;code>fixedGradient&lt;/code> and the acceleration
model):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Keyword&lt;/th>
&lt;th>Description&lt;/th>
&lt;th>Required&lt;/th>
&lt;th>Default&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>type&lt;/code>&lt;/td>
&lt;td>&lt;code>genericRegionCoupledFlux&lt;/code> (or a derived type)&lt;/td>
&lt;td>yes&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>interfaceType&lt;/code>&lt;/td>
&lt;td>List of interface type names; only the &lt;strong>first&lt;/strong> entry is used&lt;/td>
&lt;td>yes&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>neighbourFieldName&lt;/code>&lt;/td>
&lt;td>Read and written back, but not used (the neighbour field is looked up under the local name)&lt;/td>
&lt;td>no&lt;/td>
&lt;td>local field name&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>diffusivity&lt;/code>&lt;/td>
&lt;td>Name of the diffusivity (&lt;code>volScalarField&lt;/code> or &lt;code>transportProperties&lt;/code> entry)&lt;/td>
&lt;td>no (but see Known Limitations)&lt;/td>
&lt;td>&lt;code>word::null&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>accType&lt;/code>&lt;/td>
&lt;td>Acceleration model: &lt;code>fixed&lt;/code>, &lt;code>aitken&lt;/code>, &lt;code>IQNILS&lt;/code>&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>fixed&lt;/code> (a warning is printed when missing)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>relax&lt;/code>&lt;/td>
&lt;td>Initial / fixed relaxation factor $\omega_0$&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>1.0&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>couplingReuse&lt;/code>&lt;/td>
&lt;td>&lt;code>IQNILS&lt;/code> only: number of past time steps whose modes are kept&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>nonOrthCorr&lt;/code>&lt;/td>
&lt;td>Non-orthogonal correction in &lt;code>evaluate()&lt;/code>&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>secondOrder&lt;/code>&lt;/td>
&lt;td>Second-order patch-value evaluation&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>gradient&lt;/code>&lt;/td>
&lt;td>Initial gradient (&lt;code>fixedGradient&lt;/code>). If present, the patch value is evaluated from it at construction. If absent, the gradient is zero and the patch value is the patch-internal value.&lt;/td>
&lt;td>no&lt;/td>
&lt;td>zero&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>value&lt;/code>&lt;/td>
&lt;td>Written by &lt;code>write()&lt;/code>, but &lt;strong>not read&lt;/strong> by the constructor (&lt;code>fixedGradient&lt;/code> constructs the value from &lt;code>gradient&lt;/code> or by extrapolation)&lt;/td>
&lt;td>no&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>&lt;code>write()&lt;/code> writes &lt;code>type&lt;/code>, &lt;code>interfaceType&lt;/code>, &lt;code>neighbourFieldName&lt;/code>, &lt;code>diffusivity&lt;/code>
(if non-empty), &lt;code>accType&lt;/code>, &lt;code>relax&lt;/code> (&lt;code>couplingReuse&lt;/code> for &lt;code>IQNILS&lt;/code>),
&lt;code>nonOrthCorr&lt;/code>, &lt;code>secondOrder&lt;/code> and &lt;code>value&lt;/code>. The &lt;code>gradient&lt;/code> is &lt;strong>not&lt;/strong> written.&lt;/p>
&lt;h2 id="usage">Usage&lt;/h2>
&lt;p>As with the jump side, only derived types are usable. Generic layout (shown
with the concrete scalar BC):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">// 0/regionB/C
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">interfaceB
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">{
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> type regionCoupledScalarFlux; // genericRegionCoupledFlux-derived
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> interfaceType (defaultInterface);
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> diffusivity &amp;#34;D&amp;#34;;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> nonOrthCorr false;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> secondOrder false;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> value uniform 0;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Partner on the neighbour region (must be &lt;code>genericRegionCoupledJump&lt;/code>-derived,
same field name and type):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">// 0/regionA/C
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">interfaceA
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">{
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> type regionCoupledScalarJump;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> interfaceType (defaultInterface);
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> diffusivity &amp;#34;D&amp;#34;;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> accType aitken;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> relax 0.75;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> value uniform 0;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The interface entry in &lt;code>constant/regionInterfaceProperties&lt;/code> is the same as
shown for &lt;code>genericRegionCoupledJump&lt;/code>.&lt;/p>
&lt;h2 id="known-limitations">Known Limitations&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Not usable on its own.&lt;/strong> &lt;code>fluxJump()&lt;/code> and &lt;code>flux()&lt;/code> call
&lt;code>notImplemented&lt;/code> (a &lt;code>FatalError&lt;/code>). &lt;code>updateCoeffs()&lt;/code> calls &lt;code>fluxJump()&lt;/code>, so
the bare type aborts on the first coupled solve.&lt;/li>
&lt;li>&lt;strong>The partner must be a jump BC.&lt;/strong> The neighbour patch field is
&lt;code>refCast&lt;/code> to &lt;code>genericRegionCoupledJumpFvPatchField&amp;lt;Type&amp;gt;&lt;/code>. Any other
neighbour BC (including another flux BC) stops the run with a bad-cast
error.&lt;/li>
&lt;li>&lt;strong>&lt;code>diffusivity&lt;/code> effectively required.&lt;/strong> With the default &lt;code>word::null&lt;/code> the
&lt;code>diffCoeff()&lt;/code> lookup fails unless the derived class overrides
&lt;code>diffusivityName()&lt;/code>.&lt;/li>
&lt;li>&lt;strong>First relaxation uses the wrong reference.&lt;/strong> The acceleration model is
initialised with the patch &lt;strong>values&lt;/strong> (&lt;code>initialize(*this)&lt;/code>), but it relaxes
the &lt;strong>gradient&lt;/strong>. In the very first coupled iteration
$g = \phi_b + \omega(\tilde g - \phi_b)$ for $\omega \ne 1$. With the
default &lt;code>fixed&lt;/code>/&lt;code>relax 1&lt;/code> (all tutorials) this has no effect.&lt;/li>
&lt;li>&lt;strong>&lt;code>gradient&lt;/code> is not written.&lt;/strong> On restart the flux BC starts from a zero
gradient (or from &lt;code>gradient&lt;/code> if added by hand), not from the last
coupled gradient.&lt;/li>
&lt;li>&lt;strong>&lt;code>value&lt;/code> is ignored on input.&lt;/strong> The initial patch value comes from
&lt;code>gradient&lt;/code> or zero-gradient extrapolation.&lt;/li>
&lt;li>&lt;strong>Corrections are explicit.&lt;/strong> &lt;code>nonOrthCorr&lt;/code>/&lt;code>secondOrder&lt;/code> only change the
evaluated patch value. The fixed-gradient matrix coefficients are unchanged.&lt;/li>
&lt;li>&lt;strong>&lt;code>diffusivity &amp;quot;v&amp;quot;&lt;/code> is not inverted&lt;/strong> (same dead check as on the jump side:
$\Gamma = \rho$ instead of $1/\rho$).&lt;/li>
&lt;li>&lt;strong>&lt;code>neighbourFieldName&lt;/code> has no effect&lt;/strong>; the same field name is required on
both sides.&lt;/li>
&lt;li>&lt;strong>&lt;code>IQNILS&lt;/code> is not parallel-consistent&lt;/strong> (processor-local &lt;code>sum&lt;/code>).&lt;/li>
&lt;li>&lt;strong>Partitioned only.&lt;/strong>&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;/td>
&lt;td>No tutorial uses the bare &lt;code>genericRegionCoupledFlux&lt;/code> type. Derived BCs are used in &lt;code>tutorials/conjugateHeatTransfer/*&lt;/code>, &lt;code>tutorials/electrochemistry/NTGKBatteryWithTabs&lt;/code> and &lt;code>tutorials/fluidStructureInteraction/heatedBeamInCrossFlow&lt;/code> (see &lt;code>regionCoupledScalarFlux&lt;/code>, &lt;code>regionCoupledHeatFlux&lt;/code>).&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>Alkfri, A., Habes, C., Marschall, H., &lt;em>multiRegionFoam: A Unified Multiphysics Framework for Multi-Region Coupled Continuum-Physical Problems&lt;/em>, Engineering with Computers, 2023.
DOI: &lt;a href="https://doi.org/10.1007/s00366-024-01974-4">10.1007/s00366-024-01974-4&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Docs: genericRegionCoupledJump</title><link>https://multiphysicsfoam.com/docs/user-guide/boundary-conditions/coupled-boundary-conditions/genericregioncoupledjump/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://multiphysicsfoam.com/docs/user-guide/boundary-conditions/coupled-boundary-conditions/genericregioncoupledjump/</guid><description>
&lt;h2 id="overview">Overview&lt;/h2>
&lt;p>&lt;code>genericRegionCoupledJump&amp;lt;Type&amp;gt;&lt;/code> is the value side (Dirichlet side) of the
partitioned Dirichlet–Neumann (DNA) coupling. It derives from &lt;code>fixedValue&lt;/code> and
from &lt;code>interfaceToInterfaceCoupleManager&lt;/code>. In each coupling iteration it sets
the patch value to the neighbour patch value, interpolated onto this patch,
plus a &lt;em>value jump&lt;/em> $j$. It then relaxes this value with an acceleration
model. It also provides the diffusive flux $\Gamma\,\partial\phi/\partial n$
that the flux-side partner (&lt;code>genericRegionCoupledFlux&lt;/code> or a class derived
from it) reads on the other side of the interface. Every partitioned value-side
BC derives from it: &lt;code>regionCoupledScalarJump&lt;/code>, &lt;code>regionCoupledTemperatureJump&lt;/code>,
&lt;code>regionCoupledVelocityValue&lt;/code>, &lt;code>regionCoupledPressureValue&lt;/code>,
&lt;code>regionCoupledMassTransferVelocityValue&lt;/code> and
&lt;code>regionCoupledMassTransferPressureValue&lt;/code>.&lt;/p>
&lt;p>The template is also registered as a selectable patch field type
&lt;code>genericRegionCoupledJump&lt;/code> for &lt;code>scalar&lt;/code> and &lt;code>vector&lt;/code> fields. It cannot be used
on its own, though: &lt;code>valueJump()&lt;/code> is &lt;code>notImplemented&lt;/code> and aborts the run on
the first &lt;code>updateCoeffs()&lt;/code> (see Known Limitations). In a case, use a derived
BC such as &lt;code>regionCoupledScalarJump&lt;/code> instead.&lt;/p>
&lt;h2 id="mathematical-formulation">Mathematical Formulation&lt;/h2>
&lt;p>Let $J$ be the patch with this BC and $F$ the neighbour patch with the
flux-side partner. In coupling iteration $k$ the BC computes&lt;/p>
$$
\tilde\phi_J^{\,k} = \mathcal{I}_{F\to J}\!\left(\phi_F\right) + j
\quad \text{on } \Gamma
$$
&lt;p>and fixes the relaxed value&lt;/p>
$$
\phi_J^{\,k} = \phi_J^{\,k-1} + \omega^k \left(\tilde\phi_J^{\,k} - \phi_J^{\,k-1}\right)
$$
&lt;p>(or the IQN-ILS update; see Implementation). The flux handed to the partner is&lt;/p>
$$
q_J = \Gamma_J \left.\frac{\partial \phi_J}{\partial n}\right|_b
$$
&lt;p>with the coupled patch-normal gradient (scalar fields)&lt;/p>
$$
\left.\frac{\partial \phi}{\partial n}\right|_b =
\begin{cases}
\Delta_f \left(\phi_b - \phi_P - \mathbf{k}\cdot\nabla\phi_P\right) &amp; \texttt{secondOrder false} \\[4pt]
2\,\Delta_f \left(\phi_b - \phi_P - \mathbf{k}\cdot\nabla\phi_P\right) - \mathbf{n}\cdot\nabla\phi_P &amp; \texttt{secondOrder true}
\end{cases}
\qquad
\mathbf{k} = \mathbf{d} - \mathbf{n}\,(\mathbf{n}\cdot\mathbf{d})
$$
&lt;p>The term $\mathbf{k}\cdot\nabla\phi_P$ is only present with &lt;code>nonOrthCorr true&lt;/code>.
For &lt;code>vector&lt;/code> fields the same expressions are used, and then the normal component is
removed: $\partial_n\boldsymbol{\phi} \leftarrow (\mathbf{I} - \mathbf{n}\mathbf{n})\cdot\partial_n\boldsymbol{\phi}$.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Symbol&lt;/th>
&lt;th>Description&lt;/th>
&lt;th>Unit&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>$\phi$&lt;/td>
&lt;td>Coupled field (&lt;code>scalar&lt;/code> or &lt;code>vector&lt;/code>), same name in both regions&lt;/td>
&lt;td>field-dependent&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$\mathcal{I}_{F\to J}$&lt;/td>
&lt;td>Interface-to-interface interpolation (&lt;code>AMI&lt;/code> or &lt;code>directMap&lt;/code>) of the owning interface&lt;/td>
&lt;td>–&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$j$&lt;/td>
&lt;td>Value jump, &lt;code>valueJump()&lt;/code> of the derived class&lt;/td>
&lt;td>as $\phi$&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$\omega^k$&lt;/td>
&lt;td>Relaxation factor of the acceleration model&lt;/td>
&lt;td>–&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$\Gamma_J$&lt;/td>
&lt;td>Diffusivity of side $J$, from &lt;code>diffCoeff()&lt;/code>&lt;/td>
&lt;td>field-dependent&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$\phi_P$, $\nabla\phi_P$&lt;/td>
&lt;td>Patch-internal cell value and cell gradient&lt;/td>
&lt;td>–&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$\Delta_f$&lt;/td>
&lt;td>&lt;code>patch().deltaCoeffs()&lt;/code>&lt;/td>
&lt;td>1/m&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$\mathbf{n}$, $\mathbf{d}$&lt;/td>
&lt;td>Outward unit face normal, face-to-cell-centre vector (&lt;code>patch().delta()&lt;/code>)&lt;/td>
&lt;td>–, m&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>The interface residual checked by the DNA loop is&lt;/p>
$$
r = \left|\phi_J - \mathcal{I}_{F\to J}(\phi_F) - j\right|,
\qquad
\|r\| = \frac{\|r\|_2}{\max\!\left(\min\!\left(\|\phi_J\|_2,\ \|\mathcal{I}_{F\to J}(\phi_F) + j\|_2\right),\ \texttt{SMALL}\right)}
$$
&lt;p>where $\|\cdot\|_2$ is the global (all-processor) $L_2$ norm over the patch faces.&lt;/p>
&lt;h2 id="implementation">Implementation&lt;/h2>
&lt;p>&lt;strong>Finding the interface.&lt;/strong> The coupling data are taken from a
&lt;code>regionInterfaceType&lt;/code> object. &lt;code>interfaceToInterfaceCoupleManager&lt;/code> looks up all
registered interfaces and keeps the one whose type equals the &lt;strong>first&lt;/strong> entry
of the BC&amp;rsquo;s &lt;code>interfaceType&lt;/code> list and whose side A or side B is this
region/patch. If there is no match, or more than one interface of that type
contains this patch, the run stops with a &lt;code>FatalError&lt;/code>. The neighbour region
and patch are taken from the matched interface: if this patch&amp;rsquo;s name equals
&lt;code>patchA&lt;/code> of the interface, the neighbour is side B, otherwise side A.&lt;/p>
&lt;p>&lt;strong>&lt;code>updateCoeffs()&lt;/code>&lt;/strong>, called when the coupled equation is assembled in the
DNA loop:&lt;/p>
&lt;ol>
&lt;li>Returns at once if the BC is already updated or the interface is not
&lt;code>coupled&lt;/code>. In that case the patch keeps its last value.&lt;/li>
&lt;li>Calls &lt;code>update()&lt;/code> on the matched interface. This rebuilds the global
patches if the mesh topology changed, updates the curvature if the
interface has a finite-area mesh, and calls the interface&amp;rsquo;s &lt;code>correct()&lt;/code>.&lt;/li>
&lt;li>If the derived class returns &lt;code>useDirectValue() == true&lt;/code>, the value is set
to &lt;code>value()&lt;/code> directly. No derived class in this repository does that; the
base class returns &lt;code>false&lt;/code>.&lt;/li>
&lt;li>Otherwise it looks up the neighbour field &lt;strong>under the local field name&lt;/strong>,
interpolates the neighbour patch values with
&lt;code>interpolateFromNbrField&lt;/code>, adds &lt;code>valueJump()&lt;/code> and assigns the result.&lt;/li>
&lt;li>Relaxes the patch values in place with the acceleration model
(&lt;code>accModel_-&amp;gt;relax(*this)&lt;/code>).&lt;/li>
&lt;li>Calls &lt;code>fixedValueFvPatchField::updateCoeffs()&lt;/code>.&lt;/li>
&lt;/ol>
&lt;p>&lt;strong>Matrix coefficients.&lt;/strong> &lt;code>snGrad()&lt;/code> and &lt;code>gradientBoundaryCoeffs()&lt;/code> are
specialised for &lt;code>scalar&lt;/code> and &lt;code>vector&lt;/code>. They use the cell gradient
&lt;code>grad(&amp;lt;field&amp;gt;)&lt;/code> if a field of that name is registered, otherwise they compute
&lt;code>fvc::grad(&amp;lt;field&amp;gt;)&lt;/code> on the fly. They add the non-orthogonal and
second-order corrections of the formula above, so the implicit
&lt;code>fvm::laplacian&lt;/code> of the coupled equation sees the same face gradient that
&lt;code>flux()&lt;/code> reports. &lt;code>gradientInternalCoeffs()&lt;/code> is inherited from &lt;code>fixedValue&lt;/code>
($-\Delta_f$).&lt;/p>
&lt;p>&lt;strong>&lt;code>flux()&lt;/code>&lt;/strong> returns &lt;code>snGrad() * diffCoeff()&lt;/code>. The flux-side partner calls it
through a &lt;code>refCast&lt;/code> to &lt;code>genericRegionCoupledJumpFvPatchField&amp;lt;Type&amp;gt;&lt;/code>.&lt;/p>
&lt;p>&lt;strong>&lt;code>diffCoeff()&lt;/code>&lt;/strong> resolves the diffusivity name returned by the virtual
&lt;code>diffusivityName()&lt;/code>. The base class returns the &lt;code>diffusivity&lt;/code> keyword; derived
classes may override it (&lt;code>regionCoupledTemperatureJump&lt;/code> falls back to
&lt;code>kappa&lt;/code>):&lt;/p>
&lt;ol>
&lt;li>The name &lt;code>v&lt;/code> is replaced by &lt;code>rho&lt;/code>.&lt;/li>
&lt;li>If a &lt;code>volScalarField&lt;/code> with that name is registered on the local region,
its patch values are used.&lt;/li>
&lt;li>Otherwise a uniform &lt;code>dimensionedScalar&lt;/code> with that name is read from the
region&amp;rsquo;s registered &lt;code>transportProperties&lt;/code> dictionary. A missing entry or
dictionary is a fatal error.&lt;/li>
&lt;li>For a field named &lt;code>pKin&lt;/code> the diffusivity is set to 1.&lt;/li>
&lt;/ol>
&lt;p>&lt;strong>Residuals.&lt;/strong> &lt;code>rawResidual()&lt;/code> (per face) and &lt;code>normResidual()&lt;/code> (normalised,
see above) are called by &lt;code>regionInterfaceType::rawJumpRes/normJumpRes&lt;/code>. The
DNA loop (&lt;code>dnaControl&lt;/code>) compares the normalised residual against
&lt;code>maxJumpRes&lt;/code> and writes the raw residual to &lt;code>&amp;lt;field&amp;gt;initialJumpRes&lt;/code> /
&lt;code>&amp;lt;field&amp;gt;finalJumpRes&lt;/code> if &lt;code>outputJumpResField&lt;/code> is on. &lt;code>ofNormResidual()&lt;/code>
(an OpenFOAM-style normalisation) is implemented but not called anywhere.
All three residual functions stop with a &lt;code>FatalError&lt;/code> if
&lt;code>useDirectValue()&lt;/code> is true.&lt;/p>
&lt;h3 id="acceleration-models">Acceleration models&lt;/h3>
&lt;p>The acceleration model is built from the patch dictionary by
&lt;code>accelerationModel&amp;lt;Type&amp;gt;::New&lt;/code>. It is initialised with the initial patch
values and stores the last relaxed value $x^{k-1}$. In each call it forms the
residual $r^k = \tilde x^k - x^{k-1}$. The iteration counter is reset to 1 on
the first call in a new time step; $x^{k-1}$ is &lt;strong>not&lt;/strong> reset, so the first
iteration of a time step is relaxed against the final value of the previous
one.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>&lt;code>accType&lt;/code>&lt;/th>
&lt;th>Update&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>fixed&lt;/code> (default)&lt;/td>
&lt;td>$x^k = x^{k-1} + \omega_0\, r^k$ with $\omega_0 =$ &lt;code>relax&lt;/code>. With &lt;code>relax 1&lt;/code> this is no relaxation.&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>aitken&lt;/code>&lt;/td>
&lt;td>$x^k = x^{k-1} + \omega^k r^k$ with $\omega^k = \left&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>IQNILS&lt;/code>&lt;/td>
&lt;td>Interface quasi-Newton with inverse Jacobian from a least-squares model. Iteration 1 of a time step drops stored modes older than &lt;code>couplingReuse&lt;/code> time steps. Iteration 2 stores the reference $(\tilde x_{ref}, r_{ref})$. From iteration 3 the columns $V_i = r^k - r_{ref}$, $W_i = \tilde x^k - \tilde x_{ref}$ are added. With more than one column, $c = \arg\min\|V c + r^k\|$ is solved by modified Gram–Schmidt QR and $x^k = \tilde x^k + W c$. Otherwise the fixed update with $\omega_0$ is used.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="dictionary-entries">Dictionary Entries&lt;/h2>
&lt;p>All keywords read by the dictionary constructor (including those of
&lt;code>interfaceToInterfaceCoupleManager&lt;/code> and the acceleration model):&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Keyword&lt;/th>
&lt;th>Description&lt;/th>
&lt;th>Required&lt;/th>
&lt;th>Default&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>type&lt;/code>&lt;/td>
&lt;td>&lt;code>genericRegionCoupledJump&lt;/code> (or a derived type)&lt;/td>
&lt;td>yes&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>interfaceType&lt;/code>&lt;/td>
&lt;td>List of interface type names, e.g. &lt;code>(defaultInterface)&lt;/code>. Only the &lt;strong>first&lt;/strong> entry is used to find the interface. Must be a list.&lt;/td>
&lt;td>yes&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>neighbourFieldName&lt;/code>&lt;/td>
&lt;td>Name of the neighbour field. Read and written back, but not used: the neighbour field is always looked up under the local field name.&lt;/td>
&lt;td>no&lt;/td>
&lt;td>local field name&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>diffusivity&lt;/code>&lt;/td>
&lt;td>Name of the diffusivity (&lt;code>volScalarField&lt;/code> or &lt;code>transportProperties&lt;/code> entry) used by &lt;code>flux()&lt;/code>&lt;/td>
&lt;td>no (but see Known Limitations)&lt;/td>
&lt;td>&lt;code>word::null&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>jumpCoefficient&lt;/code>&lt;/td>
&lt;td>Name of a jump-coefficient field/entry. Stored by the base class, used only by &lt;code>regionCoupledScalarJump&lt;/code>.&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>word::null&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>accType&lt;/code>&lt;/td>
&lt;td>Acceleration model: &lt;code>fixed&lt;/code>, &lt;code>aitken&lt;/code>, &lt;code>IQNILS&lt;/code>&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>fixed&lt;/code> (a warning is printed when missing)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>relax&lt;/code>&lt;/td>
&lt;td>Initial / fixed relaxation factor $\omega_0$&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>1.0&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>couplingReuse&lt;/code>&lt;/td>
&lt;td>&lt;code>IQNILS&lt;/code> only: number of past time steps whose modes are kept&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>nonOrthCorr&lt;/code>&lt;/td>
&lt;td>Non-orthogonal correction $\mathbf{k}\cdot\nabla\phi_P$ in &lt;code>snGrad&lt;/code>&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>secondOrder&lt;/code>&lt;/td>
&lt;td>Second-order one-sided &lt;code>snGrad&lt;/code>&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>value&lt;/code>&lt;/td>
&lt;td>Initial patch value. Read if present; otherwise the patch values are left uninitialised, so always give it.&lt;/td>
&lt;td>effectively yes&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>&lt;code>write()&lt;/code> writes &lt;code>type&lt;/code>, &lt;code>interfaceType&lt;/code>, &lt;code>neighbourFieldName&lt;/code>, &lt;code>diffusivity&lt;/code>
(if the resolved name is non-empty), &lt;code>accType&lt;/code>, &lt;code>relax&lt;/code> (&lt;code>couplingReuse&lt;/code> for
&lt;code>IQNILS&lt;/code>), &lt;code>nonOrthCorr&lt;/code>, &lt;code>secondOrder&lt;/code> and &lt;code>value&lt;/code>. &lt;code>jumpCoefficient&lt;/code> is
&lt;strong>not&lt;/strong> written.&lt;/p>
&lt;h2 id="usage">Usage&lt;/h2>
&lt;p>Direct use only makes sense with a derived class; the base type aborts in
&lt;code>valueJump()&lt;/code>. The generic entry layout (shown with the concrete scalar BC)
is:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">// 0/regionA/C
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">interfaceA
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">{
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> type regionCoupledScalarJump; // genericRegionCoupledJump-derived
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> interfaceType (defaultInterface);
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> diffusivity &amp;#34;D&amp;#34;;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> accType aitken;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> relax 0.75;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> nonOrthCorr false;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> secondOrder false;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> value uniform 0;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The partner on the neighbour region must be a
&lt;code>genericRegionCoupledFlux&lt;/code>-derived BC of the same field type, e.g.
&lt;code>regionCoupledScalarFlux&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">// 0/regionB/C
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">interfaceB
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">{
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> type regionCoupledScalarFlux;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> interfaceType (defaultInterface);
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> diffusivity &amp;#34;D&amp;#34;;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> nonOrthCorr false;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> secondOrder false;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> value uniform 0;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>and the patch pair must be declared in &lt;code>constant/regionInterfaceProperties&lt;/code>
under &lt;code>partitionedCoupledPatches&lt;/code>, with the field in &lt;code>coupledFields&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">partitionedCoupledPatches
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">(
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> regionAregionB
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> {
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> interfaceType (defaultInterface);
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> coupledPatchPair ((regionA interfaceA) (regionB interfaceB));
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> coupledFields (C);
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> defaultInterfaceCoeffs {}
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> }
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">);
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="known-limitations">Known Limitations&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Not usable on its own.&lt;/strong> &lt;code>genericRegionCoupledJump&lt;/code> is registered for
&lt;code>scalar&lt;/code> and &lt;code>vector&lt;/code>, but &lt;code>valueJump()&lt;/code> calls &lt;code>notImplemented&lt;/code>, which is a
&lt;code>FatalError&lt;/code>. &lt;code>updateCoeffs()&lt;/code> calls it in every coupled iteration, so a case
using the bare type aborts on the first coupled solve.&lt;/li>
&lt;li>&lt;strong>&lt;code>diffusivity&lt;/code> effectively required.&lt;/strong> The default is &lt;code>word::null&lt;/code>. Unless
a derived class overrides &lt;code>diffusivityName()&lt;/code>, &lt;code>flux()&lt;/code> (called by the
partner) then looks up an empty name in &lt;code>transportProperties&lt;/code> and stops.&lt;/li>
&lt;li>&lt;strong>&lt;code>neighbourFieldName&lt;/code> has no effect.&lt;/strong> Both coupled patches must carry a
field of the same name.&lt;/li>
&lt;li>&lt;strong>&lt;code>diffusivity &amp;quot;v&amp;quot;&lt;/code> is not inverted.&lt;/strong> The name &lt;code>v&lt;/code> is mapped to &lt;code>rho&lt;/code>. The
following check for &lt;code>v&lt;/code>, meant to return $1/\rho$, compares the already
replaced name and is never true, so $\Gamma = \rho$ is used.&lt;/li>
&lt;li>&lt;strong>Vector &lt;code>snGrad&lt;/code> is tangential only.&lt;/strong> For &lt;code>vector&lt;/code> fields the normal
component of $\partial_n\boldsymbol\phi$ is removed in &lt;code>snGrad()&lt;/code> and
&lt;code>gradientBoundaryCoeffs()&lt;/code>. This suits the velocity BCs built on it, but not
a general vector diffusion problem.&lt;/li>
&lt;li>&lt;strong>Acceleration state carries over time steps.&lt;/strong> $x^{k-1}$ is not reset at a
new time step, so &lt;code>relax &amp;lt; 1&lt;/code> damps the transient change of the interface
value in the first iteration of every step.&lt;/li>
&lt;li>&lt;strong>&lt;code>IQNILS&lt;/code> is not parallel-consistent.&lt;/strong> The QR products use processor-local
&lt;code>sum&lt;/code> instead of &lt;code>gSum&lt;/code>, so in a decomposed run each processor computes its
own coefficients.&lt;/li>
&lt;li>&lt;strong>Side detection by patch name only.&lt;/strong> The neighbour side is decided by
comparing the local patch name with &lt;code>patchA&lt;/code> of the interface. Two coupled
patches with the same name in both regions would resolve to the wrong
neighbour (inferred, untested).&lt;/li>
&lt;li>&lt;strong>&lt;code>jumpCoefficient&lt;/code> is not written&lt;/strong> by &lt;code>write()&lt;/code>, so it is lost after
&lt;code>decomposePar&lt;/code>/&lt;code>reconstructPar&lt;/code> round trips or in written time directories.&lt;/li>
&lt;li>&lt;strong>Jump–jump pairing.&lt;/strong> Nothing prevents a jump BC on both sides, but then no
flux BC exists and &lt;code>normFluxRes&lt;/code> returns &lt;code>GREAT&lt;/code> with a warning, so the DNA
loop always runs &lt;code>maxCoupleIter&lt;/code> iterations (inferred from the code).&lt;/li>
&lt;li>&lt;strong>Partitioned only.&lt;/strong> The monolithic solve is commented out in
&lt;code>multiRegionSystem::solve()&lt;/code>.&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;/td>
&lt;td>No tutorial uses the bare &lt;code>genericRegionCoupledJump&lt;/code> type. Derived BCs are used in &lt;code>tutorials/conjugateHeatTransfer/*&lt;/code>, &lt;code>tutorials/electrochemistry/NTGKBatteryWithTabs&lt;/code> and &lt;code>tutorials/fluidStructureInteraction/heatedBeamInCrossFlow&lt;/code> (see &lt;code>regionCoupledScalarJump&lt;/code>, &lt;code>regionCoupledTemperatureJump&lt;/code>).&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>Alkfri, A., Habes, C., Marschall, H., &lt;em>multiRegionFoam: A Unified Multiphysics Framework for Multi-Region Coupled Continuum-Physical Problems&lt;/em>, Engineering with Computers, 2023.
DOI: &lt;a href="https://doi.org/10.1007/s00366-024-01974-4">10.1007/s00366-024-01974-4&lt;/a>&lt;/li>
&lt;li>Küttler, U., Wall, W. A., &lt;em>Fixed-point fluid–structure interaction solvers with dynamic relaxation&lt;/em>, Computational Mechanics 43, 2008. DOI: &lt;a href="https://doi.org/10.1007/s00466-008-0255-5">10.1007/s00466-008-0255-5&lt;/a>&lt;/li>
&lt;li>Degroote, J., Bathe, K.-J., Vierendeels, J., &lt;em>Performance of a new partitioned procedure versus a monolithic procedure in fluid–structure interaction&lt;/em>, Computers &amp;amp; Structures 87, 2009. DOI: &lt;a href="https://doi.org/10.1016/j.compstruc.2008.11.013">10.1016/j.compstruc.2008.11.013&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Docs: regionCoupledScalarFlux</title><link>https://multiphysicsfoam.com/docs/user-guide/boundary-conditions/coupled-boundary-conditions/regioncoupledscalarflux/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://multiphysicsfoam.com/docs/user-guide/boundary-conditions/coupled-boundary-conditions/regioncoupledscalarflux/</guid><description>
&lt;h2 id="overview">Overview&lt;/h2>
&lt;p>&lt;code>regionCoupledScalarFlux&lt;/code> is the concrete scalar flux side (Neumann side) of
the partitioned DNA coupling. It derives from
&lt;code>genericRegionCoupledFlux&amp;lt;scalar&amp;gt;&lt;/code> (and so from &lt;code>fixedGradient&lt;/code>). It fixes the
patch-normal gradient so that the local diffusive flux is equal and opposite
to the flux of the value-side partner, i.e. flux continuity without a source
at the interface. It does not check the interface type and is normally used
with &lt;code>defaultInterface&lt;/code>. The partner on the neighbour patch must be a
&lt;code>genericRegionCoupledJump&amp;lt;scalar&amp;gt;&lt;/code>-derived BC, usually
&lt;code>regionCoupledScalarJump&lt;/code>.&lt;/p>
&lt;h2 id="mathematical-formulation">Mathematical Formulation&lt;/h2>
&lt;p>Let $F$ be this patch and $J$ the neighbour (jump-side) patch:&lt;/p>
$$
\Gamma_F \frac{\partial \phi_F}{\partial n_F} + \Gamma_J \frac{\partial \phi_J}{\partial n_J} = 0
\quad \text{on } \Gamma
$$
&lt;p>imposed as the gradient&lt;/p>
$$
\left.\frac{\partial \phi_F}{\partial n}\right|_b
= -\frac{\mathcal{I}_{J\to F}\!\left(\Gamma_J\, \partial_n \phi_J\right)}{\Gamma_F}
$$
&lt;p>followed by relaxation with the acceleration model. &lt;code>fluxJump()&lt;/code> returns zero.&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Symbol&lt;/th>
&lt;th>Description&lt;/th>
&lt;th>Unit&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>$\phi$&lt;/td>
&lt;td>Coupled scalar field (same name in both regions)&lt;/td>
&lt;td>field-dependent&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$\Gamma_F$&lt;/td>
&lt;td>Diffusivity named by this BC&amp;rsquo;s &lt;code>diffusivity&lt;/code>&lt;/td>
&lt;td>field-dependent&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$\Gamma_J\,\partial_n\phi_J$&lt;/td>
&lt;td>&lt;code>flux()&lt;/code> of the jump-side partner, with the partner&amp;rsquo;s &lt;code>diffusivity&lt;/code>&lt;/td>
&lt;td>field-dependent&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$\mathcal{I}_{J\to F}$&lt;/td>
&lt;td>Interface-to-interface interpolation&lt;/td>
&lt;td>–&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="implementation">Implementation&lt;/h2>
&lt;p>Everything except &lt;code>fluxJump()&lt;/code> is inherited from
&lt;code>genericRegionCoupledFlux&amp;lt;scalar&amp;gt;&lt;/code>. In each DNA iteration &lt;code>updateCoeffs()&lt;/code>
updates the interface, &lt;code>refCast&lt;/code>s the neighbour patch field to
&lt;code>genericRegionCoupledJumpFvPatchField&amp;lt;scalar&amp;gt;&lt;/code>, takes its &lt;code>flux()&lt;/code>,
interpolates and negates it, adds &lt;code>fluxJump()&lt;/code> (= 0), divides by the local
&lt;code>diffCoeff()&lt;/code>, relaxes the gradient and fixes it. &lt;code>evaluate()&lt;/code> sets the
patch value from the gradient with optional non-orthogonal and second-order
corrections. The flux residual
$|\Gamma_F\,g_F + \mathcal{I}(q_J)|$ is checked against &lt;code>maxFluxRes&lt;/code>.&lt;/p>
&lt;h2 id="dictionary-entries">Dictionary Entries&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Keyword&lt;/th>
&lt;th>Description&lt;/th>
&lt;th>Required&lt;/th>
&lt;th>Default&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>type&lt;/code>&lt;/td>
&lt;td>&lt;code>regionCoupledScalarFlux&lt;/code>&lt;/td>
&lt;td>yes&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>interfaceType&lt;/code>&lt;/td>
&lt;td>Interface type list, e.g. &lt;code>(defaultInterface)&lt;/code>. Only the first entry is used; any type is accepted.&lt;/td>
&lt;td>yes&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>diffusivity&lt;/code>&lt;/td>
&lt;td>Diffusivity name (&lt;code>volScalarField&lt;/code> or &lt;code>transportProperties&lt;/code> entry)&lt;/td>
&lt;td>effectively yes&lt;/td>
&lt;td>&lt;code>word::null&lt;/code> (lookup fails)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>neighbourFieldName&lt;/code>&lt;/td>
&lt;td>Read and written, not used&lt;/td>
&lt;td>no&lt;/td>
&lt;td>local field name&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>accType&lt;/code>&lt;/td>
&lt;td>&lt;code>fixed&lt;/code>, &lt;code>aitken&lt;/code> or &lt;code>IQNILS&lt;/code>&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>fixed&lt;/code> (with warning)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>relax&lt;/code>&lt;/td>
&lt;td>Initial / fixed relaxation factor&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>1.0&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>couplingReuse&lt;/code>&lt;/td>
&lt;td>&lt;code>IQNILS&lt;/code> only: reused time steps&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>nonOrthCorr&lt;/code>&lt;/td>
&lt;td>Non-orthogonal correction in &lt;code>evaluate()&lt;/code>&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>secondOrder&lt;/code>&lt;/td>
&lt;td>Second-order value evaluation&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>gradient&lt;/code>&lt;/td>
&lt;td>Initial gradient; if given, the initial patch value is evaluated from it&lt;/td>
&lt;td>no&lt;/td>
&lt;td>zero&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>value&lt;/code>&lt;/td>
&lt;td>Not read (only written)&lt;/td>
&lt;td>no&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="usage">Usage&lt;/h2>
&lt;p>From &lt;code>tutorials/electrochemistry/NTGKBatteryWithTabs/0/negTabRegion/orig/partitioned/T&lt;/code>
(flux side on the tab):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">toCellFromNeg
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">{
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> type regionCoupledScalarFlux;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> interfaceType (defaultInterface);
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> diffusivity &amp;#34;k&amp;#34;;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> secondOrder false;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> nonOrthCorr false;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> value $internalField;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Partner in &lt;code>0/batteryRegion/orig/partitioned/T&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">toNegTab
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">{
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> type regionCoupledScalarJump;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> interfaceType (defaultInterface);
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> diffusivity &amp;#34;k&amp;#34;;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> accType aitken;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> relax 0.75;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> secondOrder false;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> nonOrthCorr false;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> value $internalField;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>The &lt;code>regionInterfaceProperties&lt;/code> (&lt;code>cellToNegTab&lt;/code>, &lt;code>defaultInterface&lt;/code>,
&lt;code>coupledFields (phiPos phiNeg T)&lt;/code>) and the &lt;code>DNA&lt;/code> entries are shown in
&lt;code>regionCoupledScalarJump&lt;/code>. In this tutorial &lt;code>k&lt;/code> is a uniform entry in the
&lt;code>transportProperties&lt;/code> of the &lt;code>NTGK&lt;/code> and &lt;code>conductPotentialTemperature&lt;/code>
regions.&lt;/p>
&lt;h2 id="known-limitations">Known Limitations&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Partner must be a jump BC&lt;/strong> of the same field (bad-cast error
otherwise).&lt;/li>
&lt;li>&lt;strong>&lt;code>diffusivity&lt;/code> must be set&lt;/strong>; the default &lt;code>word::null&lt;/code> lookup fails.&lt;/li>
&lt;li>&lt;strong>No interfacial source.&lt;/strong> &lt;code>fluxJump()&lt;/code> is always zero. Use a derived BC
with its own &lt;code>fluxJump()&lt;/code> (e.g. &lt;code>regionCoupledPhaseChangeHeatFlux&lt;/code>) for a
flux jump.&lt;/li>
&lt;li>&lt;strong>No consistency check&lt;/strong> between the diffusivities named on the two
sides.&lt;/li>
&lt;li>&lt;strong>&lt;code>value&lt;/code> is ignored on input&lt;/strong> and &lt;strong>&lt;code>gradient&lt;/code> is not written&lt;/strong>. On
restart the coupled gradient starts from zero unless &lt;code>gradient&lt;/code> is given.&lt;/li>
&lt;li>&lt;strong>First relaxation uses the patch values as reference&lt;/strong> (inherited; only
matters with &lt;code>relax&lt;/code> ≠ 1 or &lt;code>aitken&lt;/code>/&lt;code>IQNILS&lt;/code> on this side).&lt;/li>
&lt;li>Inherited from &lt;code>genericRegionCoupledFlux&lt;/code>: &lt;code>neighbourFieldName&lt;/code> unused,
&lt;code>nonOrthCorr&lt;/code>/&lt;code>secondOrder&lt;/code> only in the evaluated value, &lt;code>IQNILS&lt;/code> not
parallel-consistent, partitioned only.&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/electrochemistry/NTGKBatteryWithTabs&lt;/code>&lt;/td>
&lt;td>&lt;code>phiPos&lt;/code>: flux side on the battery (&lt;code>diffusivity sigmaPos&lt;/code>, initial &lt;code>gradient uniform 0.1266&lt;/code>). &lt;code>phiNeg&lt;/code>: flux side on the negative tab (&lt;code>diffusivity sigma&lt;/code>). &lt;code>T&lt;/code>: flux side on both tabs (&lt;code>diffusivity k&lt;/code>). All with &lt;code>defaultInterface&lt;/code> and &lt;code>directMap&lt;/code>.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>Alkfri, A., Habes, C., Marschall, H., &lt;em>multiRegionFoam: A Unified Multiphysics Framework for Multi-Region Coupled Continuum-Physical Problems&lt;/em>, Engineering with Computers, 2023.
DOI: &lt;a href="https://doi.org/10.1007/s00366-024-01974-4">10.1007/s00366-024-01974-4&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Docs: regionCoupledScalarJump</title><link>https://multiphysicsfoam.com/docs/user-guide/boundary-conditions/coupled-boundary-conditions/regioncoupledscalarjump/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://multiphysicsfoam.com/docs/user-guide/boundary-conditions/coupled-boundary-conditions/regioncoupledscalarjump/</guid><description>
&lt;h2 id="overview">Overview&lt;/h2>
&lt;p>&lt;code>regionCoupledScalarJump&lt;/code> is the concrete scalar value side (Dirichlet side)
of the partitioned DNA coupling. It derives from
&lt;code>genericRegionCoupledJump&amp;lt;scalar&amp;gt;&lt;/code> (and so from &lt;code>fixedValue&lt;/code>). It fixes the
patch value to the neighbour value interpolated onto this patch, scaled by a
jump (partition) coefficient $c$, which defaults to 1, i.e. continuity. It does
not check the interface type, so it works with any interface, in practice
&lt;code>defaultInterface&lt;/code>. It is the generic choice for potentials, temperatures
and concentrations that need no interface physics. The partner on the
neighbour patch is &lt;code>regionCoupledScalarFlux&lt;/code> (or any other
&lt;code>genericRegionCoupledFlux&amp;lt;scalar&amp;gt;&lt;/code>-derived BC, e.g.
&lt;code>regionCoupledPhaseChangeHeatFlux&lt;/code>).&lt;/p>
&lt;h2 id="mathematical-formulation">Mathematical Formulation&lt;/h2>
&lt;p>Let $J$ be this patch and $F$ the neighbour (flux-side) patch:&lt;/p>
$$
\phi_J = c\;\mathcal{I}_{F\to J}(\phi_F) \quad \text{on } \Gamma
$$
&lt;p>implemented as $\phi_J = \mathcal{I}_{F\to J}(\phi_F) + j$ with the value jump&lt;/p>
$$
j = \mathcal{I}_{F\to J}(\phi_F)\,(c - 1).
$$
&lt;p>The value is then relaxed by the acceleration model. The flux handed to the
partner is&lt;/p>
$$
q_J = \Gamma_J \left.\frac{\partial \phi_J}{\partial n}\right|_b
$$
&lt;p>with the coupled &lt;code>snGrad&lt;/code> of &lt;code>genericRegionCoupledJump&lt;/code> (optional
non-orthogonal and second-order corrections).&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Symbol&lt;/th>
&lt;th>Description&lt;/th>
&lt;th>Unit&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>$\phi$&lt;/td>
&lt;td>Coupled scalar field (same name in both regions)&lt;/td>
&lt;td>field-dependent&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$c$&lt;/td>
&lt;td>Jump (partition) coefficient, keyword &lt;code>jumpCoefficient&lt;/code>&lt;/td>
&lt;td>–&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$\mathcal{I}_{F\to J}$&lt;/td>
&lt;td>Interface-to-interface interpolation&lt;/td>
&lt;td>–&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>$\Gamma_J$&lt;/td>
&lt;td>Diffusivity named by &lt;code>diffusivity&lt;/code>&lt;/td>
&lt;td>field-dependent&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="implementation">Implementation&lt;/h2>
&lt;p>All run-time work (interface lookup, &lt;code>updateCoeffs()&lt;/code>, relaxation, &lt;code>snGrad&lt;/code>,
&lt;code>flux()&lt;/code>, &lt;code>diffCoeff()&lt;/code>, residuals) is inherited from
&lt;code>genericRegionCoupledJump&amp;lt;scalar&amp;gt;&lt;/code>. The class only implements
&lt;code>valueJump()&lt;/code>:&lt;/p>
&lt;ol>
&lt;li>Looks up the neighbour field under the local field name and interpolates
its neighbour patch values onto this patch.&lt;/li>
&lt;li>Determines $c$ per face:
&lt;ul>
&lt;li>if a &lt;code>volScalarField&lt;/code> named &lt;code>jumpCoefficient&lt;/code> is registered on the
&lt;strong>local&lt;/strong> region, its local patch values are used;&lt;/li>
&lt;li>else, if &lt;code>jumpCoefficient&lt;/code> is set, a uniform &lt;code>dimensionedScalar&lt;/code> of that
name is read from the local region&amp;rsquo;s &lt;code>transportProperties&lt;/code>;&lt;/li>
&lt;li>else $c = 1$.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>Returns $\mathcal{I}_{F\to J}(\phi_F)\,(c - 1)$.&lt;/li>
&lt;/ol>
&lt;p>&lt;code>valueJump()&lt;/code> is evaluated in &lt;code>updateCoeffs()&lt;/code> and again in each residual
evaluation (jump residual $|\phi_J - \mathcal{I}(\phi_F) - j|$, checked
against &lt;code>maxJumpRes&lt;/code>).&lt;/p>
&lt;h2 id="dictionary-entries">Dictionary Entries&lt;/h2>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>Keyword&lt;/th>
&lt;th>Description&lt;/th>
&lt;th>Required&lt;/th>
&lt;th>Default&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>&lt;code>type&lt;/code>&lt;/td>
&lt;td>&lt;code>regionCoupledScalarJump&lt;/code>&lt;/td>
&lt;td>yes&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>interfaceType&lt;/code>&lt;/td>
&lt;td>Interface type list, e.g. &lt;code>(defaultInterface)&lt;/code>. Only the first entry is used to find the interface; any type is accepted.&lt;/td>
&lt;td>yes&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>diffusivity&lt;/code>&lt;/td>
&lt;td>Diffusivity name (&lt;code>volScalarField&lt;/code> or &lt;code>transportProperties&lt;/code> entry) used by &lt;code>flux()&lt;/code> for the partner&lt;/td>
&lt;td>effectively yes&lt;/td>
&lt;td>&lt;code>word::null&lt;/code> (lookup fails)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>jumpCoefficient&lt;/code>&lt;/td>
&lt;td>Name of the partition-coefficient field / &lt;code>transportProperties&lt;/code> entry&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>word::null&lt;/code> → $c = 1$&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>neighbourFieldName&lt;/code>&lt;/td>
&lt;td>Read and written, not used&lt;/td>
&lt;td>no&lt;/td>
&lt;td>local field name&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>accType&lt;/code>&lt;/td>
&lt;td>&lt;code>fixed&lt;/code>, &lt;code>aitken&lt;/code> or &lt;code>IQNILS&lt;/code>&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>fixed&lt;/code> (with warning)&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>relax&lt;/code>&lt;/td>
&lt;td>Initial / fixed relaxation factor&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>1.0&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>couplingReuse&lt;/code>&lt;/td>
&lt;td>&lt;code>IQNILS&lt;/code> only: reused time steps&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>0&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>nonOrthCorr&lt;/code>&lt;/td>
&lt;td>Non-orthogonal correction of &lt;code>snGrad&lt;/code>&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>secondOrder&lt;/code>&lt;/td>
&lt;td>Second-order &lt;code>snGrad&lt;/code>&lt;/td>
&lt;td>no&lt;/td>
&lt;td>&lt;code>false&lt;/code>&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;code>value&lt;/code>&lt;/td>
&lt;td>Initial patch value (read if present, otherwise uninitialised)&lt;/td>
&lt;td>effectively yes&lt;/td>
&lt;td>—&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="usage">Usage&lt;/h2>
&lt;p>From &lt;code>tutorials/electrochemistry/NTGKBatteryWithTabs/0/posTabRegion/orig/partitioned/phiPos&lt;/code>
(jump side on the tab):&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">toCellFromPos
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">{
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> type regionCoupledScalarJump;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> interfaceType (defaultInterface);
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> diffusivity &amp;#34;sigma&amp;#34;;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> accType aitken;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> relax 0.1;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> secondOrder false;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> nonOrthCorr false;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> value $internalField;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Partner in &lt;code>0/batteryRegion/orig/partitioned/phiPos&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">toPosTab
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">{
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> type regionCoupledScalarFlux;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> interfaceType (defaultInterface);
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> diffusivity &amp;#34;sigmaPos&amp;#34;;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> secondOrder false;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> nonOrthCorr false;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> value $internalField;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> gradient uniform 0.1266;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Interface entry in &lt;code>constant/regionInterfaceProperties&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">cellToPosTab
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">{
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> interfaceType (defaultInterface);
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> coupledPatchPair
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> (
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> (batteryRegion toPosTab)
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> (posTabRegion toCellFromPos)
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> );
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> coupledFields
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> (
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> phiPos
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> phiNeg
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> T
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> );
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> defaultInterfaceCoeffs
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> {}
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>and a DNA entry per coupled field in &lt;code>constant/multiRegionProperties&lt;/code>:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">DNA
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">{
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> phiPos
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> {
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> maxCoupleIter 50;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> residualControl
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> {
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> maxJumpRes 1e-05;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> outputJumpResField no;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> maxFluxRes 1e-05;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> outputFluxResField no;
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> }
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> }
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>For a partition coefficient (e.g. Henry&amp;rsquo;s law $C_A = H\,C_B$), add
&lt;code>jumpCoefficient H;&lt;/code> and provide &lt;code>H&lt;/code> either as a &lt;code>volScalarField&lt;/code> on the
jump-side region or as &lt;code>H H [0 0 0 0 0 0 0] 0.5;&lt;/code> in its
&lt;code>transportProperties&lt;/code>.&lt;/p>
&lt;h2 id="known-limitations">Known Limitations&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>No interface-type check.&lt;/strong> Any interface type listed first in
&lt;code>interfaceType&lt;/code> is accepted. The interface&amp;rsquo;s own physics, if any, is not
used, except that its &lt;code>correct()&lt;/code> is called through &lt;code>update()&lt;/code>.&lt;/li>
&lt;li>&lt;strong>&lt;code>diffusivity&lt;/code> must be set.&lt;/strong> The default &lt;code>word::null&lt;/code> makes the
&lt;code>diffCoeff()&lt;/code> lookup in &lt;code>transportProperties&lt;/code> fail as soon as the partner
asks for &lt;code>flux()&lt;/code>.&lt;/li>
&lt;li>&lt;strong>Diffusivities are not checked for consistency.&lt;/strong> Each side uses whatever
its &lt;code>diffusivity&lt;/code> names (in NTGK, &lt;code>sigmaPos&lt;/code> on the battery and &lt;code>sigma&lt;/code> on
the tab). Flux conservation requires the same units on both sides.&lt;/li>
&lt;li>&lt;strong>Jump coefficient is taken from the jump side only&lt;/strong> (local field or local
&lt;code>transportProperties&lt;/code>). With a &lt;code>volScalarField&lt;/code>, the local patch values
are used and not interpolated.&lt;/li>
&lt;li>&lt;strong>&lt;code>jumpCoefficient&lt;/code> is not written&lt;/strong> by &lt;code>write()&lt;/code>, so it disappears from
written time directories and after &lt;code>decomposePar&lt;/code>.&lt;/li>
&lt;li>Inherited limitations of &lt;code>genericRegionCoupledJump&lt;/code>: &lt;code>neighbourFieldName&lt;/code>
unused, side detection by patch name only, &lt;code>IQNILS&lt;/code> not parallel-consistent,
partitioned only.&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/electrochemistry/NTGKBatteryWithTabs&lt;/code>&lt;/td>
&lt;td>&lt;code>batteryRegion (NTGK)&lt;/code> coupled to two &lt;code>conductPotentialTemperature&lt;/code> tabs through &lt;code>defaultInterface&lt;/code>. &lt;code>phiPos&lt;/code>: jump side on the positive tab (&lt;code>diffusivity sigma&lt;/code>, Aitken 0.1). &lt;code>phiNeg&lt;/code>: jump side on the battery (&lt;code>diffusivity sigmaNeg&lt;/code>, Aitken 0.75). &lt;code>T&lt;/code>: jump side on the battery at both tabs (&lt;code>diffusivity k&lt;/code>, Aitken 0.75). &lt;code>directMap&lt;/code> transfer.&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;h2 id="references">References&lt;/h2>
&lt;ul>
&lt;li>Alkfri, A., Habes, C., Marschall, H., &lt;em>multiRegionFoam: A Unified Multiphysics Framework for Multi-Region Coupled Continuum-Physical Problems&lt;/em>, Engineering with Computers, 2023.
DOI: &lt;a href="https://doi.org/10.1007/s00366-024-01974-4">10.1007/s00366-024-01974-4&lt;/a>&lt;/li>
&lt;/ul></description></item></channel></rss>