Commit 33964458 authored by Henry's avatar Henry
Browse files

Field mapping following topology change: Dy default additional faces now...

Field mapping following topology change: Dy default additional faces now inherit the internal field values

if they do not have neighbouring faces from which the values may be
interpolated.  Also the old-time flux is set to the current flux values
following correction.  This currently supports only Euler time-schemes.
parent cc561534
......@@ -68,4 +68,6 @@
}
}
phi.oldTime() = phi;
#include "continuityErrs.H"
......@@ -56,6 +56,8 @@
phi -= pcorrEqn.flux();
}
}
#include "continuityErrs.H"
}
phi.oldTime() = phi;
#include "continuityErrs.H"
......@@ -53,6 +53,8 @@
fvc::makeRelative(phi, U);
}
}
#include "continuityErrs.H"
}
phi.oldTime() = phi;
#include "continuityErrs.H"
......@@ -198,10 +198,61 @@ void Foam::fvPatchField<Type>::patchInternalField(Field<Type>& pif) const
template<class Type>
void Foam::fvPatchField<Type>::autoMap
(
const fvPatchFieldMapper& m
const fvPatchFieldMapper& mapper
)
{
Field<Type>::autoMap(m);
Field<Type>& f = *this;
if (!this->size())
{
f.setSize(mapper.size());
if (f.size())
{
f = this->patchInternalField();
}
}
else
{
// Map all faces provided with mapping data
Field<Type>::autoMap(mapper);
// For unmapped faces set to internal field value (zero-gradient)
if
(
mapper.direct()
&& &mapper.directAddressing()
&& mapper.directAddressing().size()
)
{
Field<Type> pif(this->patchInternalField());
const labelList& mapAddressing = mapper.directAddressing();
forAll(mapAddressing, i)
{
if (mapAddressing[i] < 0)
{
f[i] = pif[i];
}
}
}
else if (!mapper.direct() && mapper.addressing().size())
{
Field<Type> pif(this->patchInternalField());
const labelListList& mapAddressing = mapper.addressing();
forAll(mapAddressing, i)
{
const labelList& localAddrs = mapAddressing[i];
if (!localAddrs.size())
{
f[i] = pif[i];
}
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment