Fixed read and mapping errors on turbulence boundary conditions
This commit is contained in:
parent
7334b895fe
commit
1fd5416dfc
4 changed files with 115 additions and 14 deletions
|
@ -62,14 +62,31 @@ immersedBoundaryEpsilonWallFunctionFvPatchScalarField
|
||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
epsilonWallFunctionFvPatchScalarField(p, iF, dict),
|
epsilonWallFunctionFvPatchScalarField(p, iF), // Do not read mixed data
|
||||||
immersedBoundaryFieldBase<scalar>
|
immersedBoundaryFieldBase<scalar>
|
||||||
(
|
(
|
||||||
p,
|
p,
|
||||||
Switch(dict.lookup("setDeadValue")),
|
Switch(dict.lookup("setDeadValue")),
|
||||||
readScalar(dict.lookup("deadValue"))
|
readScalar(dict.lookup("deadValue"))
|
||||||
)
|
)
|
||||||
{}
|
{
|
||||||
|
// Since patch does not read a dictionary, the patch type needs to be read
|
||||||
|
// manually. HJ, 6/Sep/2018
|
||||||
|
this->readPatchType(dict);
|
||||||
|
|
||||||
|
if (!isType<immersedBoundaryFvPatch>(p))
|
||||||
|
{
|
||||||
|
FatalIOErrorInFunction(dict)
|
||||||
|
<< "\n patch type '" << p.type()
|
||||||
|
<< "' not constraint type '" << typeName << "'"
|
||||||
|
<< "\n for patch " << p.name()
|
||||||
|
<< " of field " << this->dimensionedInternalField().name()
|
||||||
|
<< " in file " << this->dimensionedInternalField().objectPath()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
|
scalarField::operator=(this->patchInternalField());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
immersedBoundaryEpsilonWallFunctionFvPatchScalarField::
|
immersedBoundaryEpsilonWallFunctionFvPatchScalarField::
|
||||||
|
@ -81,14 +98,35 @@ immersedBoundaryEpsilonWallFunctionFvPatchScalarField
|
||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
epsilonWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
|
epsilonWallFunctionFvPatchScalarField(p, iF), // Do not map mixed data. Set patchType later
|
||||||
immersedBoundaryFieldBase<scalar>
|
immersedBoundaryFieldBase<scalar>
|
||||||
(
|
(
|
||||||
p,
|
p,
|
||||||
ptf.setDeadValue(),
|
ptf.setDeadValue(),
|
||||||
ptf.deadValue()
|
ptf.deadValue()
|
||||||
)
|
)
|
||||||
{}
|
{
|
||||||
|
// Note: NO MAPPING. Fields are created on the immersed boundary
|
||||||
|
// HJ, 12/Apr/2012
|
||||||
|
if (!isType<immersedBoundaryFvPatch>(p))
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "\n patch type '" << p.type()
|
||||||
|
<< "' not constraint type '" << typeName << "'"
|
||||||
|
<< "\n for patch " << p.name()
|
||||||
|
<< " of field " << this->dimensionedInternalField().name()
|
||||||
|
<< " in file " << this->dimensionedInternalField().objectPath()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy the patch type since mixed data was not mapped
|
||||||
|
this->setPatchType(ptf);
|
||||||
|
|
||||||
|
// On creation of the mapped field, the internal field is dummy and
|
||||||
|
// cannot be used. Initialise the value to avoid errors
|
||||||
|
// HJ, 1/Dec/2017
|
||||||
|
scalarField::operator=(SMALL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
immersedBoundaryEpsilonWallFunctionFvPatchScalarField::
|
immersedBoundaryEpsilonWallFunctionFvPatchScalarField::
|
||||||
|
@ -182,7 +220,6 @@ void immersedBoundaryEpsilonWallFunctionFvPatchScalarField::updateCoeffs()
|
||||||
// HJ, 20/May/2018
|
// HJ, 20/May/2018
|
||||||
if (db().foundObject<volScalarField>(GName()))
|
if (db().foundObject<volScalarField>(GName()))
|
||||||
{
|
{
|
||||||
Info<< "Updating epsilon" << endl;
|
|
||||||
epsilonWallFunctionFvPatchScalarField::updateCoeffs();
|
epsilonWallFunctionFvPatchScalarField::updateCoeffs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ immersedBoundaryKqRWallFunctionFvPatchField
|
||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
kqRWallFunctionFvPatchField<Type>(p, iF, dict),
|
kqRWallFunctionFvPatchField<Type>(p, iF), // Do not read mixed data
|
||||||
immersedBoundaryFieldBase<Type>
|
immersedBoundaryFieldBase<Type>
|
||||||
(
|
(
|
||||||
p,
|
p,
|
||||||
|
@ -90,10 +90,10 @@ immersedBoundaryKqRWallFunctionFvPatchField
|
||||||
pTraits<Type>(dict.lookup("deadValue"))
|
pTraits<Type>(dict.lookup("deadValue"))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this->checkType();
|
|
||||||
this->readPatchType(dict);
|
this->readPatchType(dict);
|
||||||
|
this->checkType();
|
||||||
|
|
||||||
*this == this->patchInternalField();
|
Field<Type>::operator=(this->patchInternalField());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ immersedBoundaryKqRWallFunctionFvPatchField
|
||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
kqRWallFunctionFvPatchField<Type>(ptf, p, iF, mapper),
|
kqRWallFunctionFvPatchField<Type>(p, iF), // Do not map mixed data. Set patchType later
|
||||||
immersedBoundaryFieldBase<Type>
|
immersedBoundaryFieldBase<Type>
|
||||||
(
|
(
|
||||||
p,
|
p,
|
||||||
|
@ -117,6 +117,10 @@ immersedBoundaryKqRWallFunctionFvPatchField
|
||||||
{
|
{
|
||||||
this->setPatchType(ptf);
|
this->setPatchType(ptf);
|
||||||
this->checkType();
|
this->checkType();
|
||||||
|
|
||||||
|
// cannot be used. Initialise the value to avoid errors
|
||||||
|
// HJ, 1/Dec/2017
|
||||||
|
Field<Type>::operator=(pTraits<Type>::zero);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -61,10 +61,23 @@ immersedBoundaryNutWallFunctionFvPatchScalarField
|
||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
nutkWallFunctionFvPatchScalarField(p, iF, dict),
|
nutkWallFunctionFvPatchScalarField(p, iF), // Do not read mixed data
|
||||||
immersedBoundaryFieldBase<scalar>(p, true, 1e-6)
|
immersedBoundaryFieldBase<scalar>(p, true, 1e-6)
|
||||||
{
|
{
|
||||||
this->readPatchType(dict);
|
this->readPatchType(dict);
|
||||||
|
|
||||||
|
if (!isType<immersedBoundaryFvPatch>(p))
|
||||||
|
{
|
||||||
|
FatalIOErrorInFunction(dict)
|
||||||
|
<< "\n patch type '" << p.type()
|
||||||
|
<< "' not constraint type '" << typeName << "'"
|
||||||
|
<< "\n for patch " << p.name()
|
||||||
|
<< " of field " << this->dimensionedInternalField().name()
|
||||||
|
<< " in file " << this->dimensionedInternalField().objectPath()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
|
scalarField::operator=(this->patchInternalField());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,10 +90,28 @@ immersedBoundaryNutWallFunctionFvPatchScalarField
|
||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
nutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
|
nutkWallFunctionFvPatchScalarField(p, iF), // Do not map mixed data. Set patchType later
|
||||||
immersedBoundaryFieldBase<scalar>(p, true, 1e-6)
|
immersedBoundaryFieldBase<scalar>(p, true, 1e-6)
|
||||||
{
|
{
|
||||||
|
// Note: NO MAPPING. Fields are created on the immersed boundary
|
||||||
|
// HJ, 12/Apr/2012
|
||||||
|
if (!isType<immersedBoundaryFvPatch>(p))
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "\n patch type '" << p.type()
|
||||||
|
<< "' not constraint type '" << typeName << "'"
|
||||||
|
<< "\n for patch " << p.name()
|
||||||
|
<< " of field " << this->dimensionedInternalField().name()
|
||||||
|
<< " in file " << this->dimensionedInternalField().objectPath()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
this->setPatchType(ptf);
|
this->setPatchType(ptf);
|
||||||
|
|
||||||
|
// On creation of the mapped field, the internal field is dummy and
|
||||||
|
// cannot be used. Initialise the value to avoid errors
|
||||||
|
// HJ, 1/Dec/2017
|
||||||
|
scalarField::operator=(scalar(0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ immersedBoundaryOmegaWallFunctionFvPatchScalarField
|
||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
omegaWallFunctionFvPatchScalarField(p, iF, dict),
|
omegaWallFunctionFvPatchScalarField(p, iF), // Do not read mixed data
|
||||||
immersedBoundaryFieldBase<scalar>
|
immersedBoundaryFieldBase<scalar>
|
||||||
(
|
(
|
||||||
p,
|
p,
|
||||||
|
@ -70,7 +70,18 @@ immersedBoundaryOmegaWallFunctionFvPatchScalarField
|
||||||
{
|
{
|
||||||
this->readPatchType(dict);
|
this->readPatchType(dict);
|
||||||
|
|
||||||
*this == this->patchInternalField();
|
if (!isType<immersedBoundaryFvPatch>(p))
|
||||||
|
{
|
||||||
|
FatalIOErrorInFunction(dict)
|
||||||
|
<< "\n patch type '" << p.type()
|
||||||
|
<< "' not constraint type '" << typeName << "'"
|
||||||
|
<< "\n for patch " << p.name()
|
||||||
|
<< " of field " << this->dimensionedInternalField().name()
|
||||||
|
<< " in file " << this->dimensionedInternalField().objectPath()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
|
scalarField::operator=(this->patchInternalField());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -83,7 +94,7 @@ immersedBoundaryOmegaWallFunctionFvPatchScalarField
|
||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
omegaWallFunctionFvPatchScalarField(ptf, p, iF, mapper),
|
omegaWallFunctionFvPatchScalarField(p, iF), // Do not map mixed data. Set patchType later
|
||||||
immersedBoundaryFieldBase<scalar>
|
immersedBoundaryFieldBase<scalar>
|
||||||
(
|
(
|
||||||
p,
|
p,
|
||||||
|
@ -91,7 +102,25 @@ immersedBoundaryOmegaWallFunctionFvPatchScalarField
|
||||||
ptf.deadValue()
|
ptf.deadValue()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
// Note: NO MAPPING. Fields are created on the immersed boundary
|
||||||
|
// HJ, 12/Apr/2012
|
||||||
|
if (!isType<immersedBoundaryFvPatch>(p))
|
||||||
|
{
|
||||||
|
FatalErrorInFunction
|
||||||
|
<< "\n patch type '" << p.type()
|
||||||
|
<< "' not constraint type '" << typeName << "'"
|
||||||
|
<< "\n for patch " << p.name()
|
||||||
|
<< " of field " << this->dimensionedInternalField().name()
|
||||||
|
<< " in file " << this->dimensionedInternalField().objectPath()
|
||||||
|
<< exit(FatalIOError);
|
||||||
|
}
|
||||||
|
|
||||||
this->setPatchType(ptf);
|
this->setPatchType(ptf);
|
||||||
|
|
||||||
|
// On creation of the mapped field, the internal field is dummy and
|
||||||
|
// cannot be used. Initialise the value to avoid errors
|
||||||
|
// HJ, 1/Dec/2017
|
||||||
|
scalarField::operator=(SMALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in a new issue