mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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.
This commit is contained in:
@ -68,4 +68,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
phi.oldTime() = phi;
|
||||||
|
|
||||||
#include "continuityErrs.H"
|
#include "continuityErrs.H"
|
||||||
|
|||||||
@ -56,6 +56,8 @@
|
|||||||
phi -= pcorrEqn.flux();
|
phi -= pcorrEqn.flux();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "continuityErrs.H"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
phi.oldTime() = phi;
|
||||||
|
|
||||||
|
#include "continuityErrs.H"
|
||||||
|
|||||||
@ -53,6 +53,8 @@
|
|||||||
fvc::makeRelative(phi, U);
|
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>
|
template<class Type>
|
||||||
void Foam::fvPatchField<Type>::autoMap
|
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];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user