Skip to content
Snippets Groups Projects
Commit d36bb781 authored by henry's avatar henry
Browse files

timeVaryingMappedFixedValueFvPatchField: Added the option to specify the name...

timeVaryingMappedFixedValueFvPatchField: Added the option to specify the name of the field data table.

Defaults to the name of the field the BC is being applied to but may be set
using the keyword fieldTableName, e.g.

    fieldTableName  totalPressure;
parent 5579f7af
No related merge requests found
......@@ -49,6 +49,7 @@ timeVaryingMappedFixedValueFvPatchField
)
:
fixedValueFvPatchField<Type>(p, iF),
fieldTableName_(iF.name()),
setAverage_(false),
referenceCS_(NULL),
nearestVertex_(0),
......@@ -80,6 +81,7 @@ timeVaryingMappedFixedValueFvPatchField
)
:
fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
fieldTableName_(ptf.fieldTableName_),
setAverage_(ptf.setAverage_),
referenceCS_(NULL),
nearestVertex_(0),
......@@ -110,6 +112,7 @@ timeVaryingMappedFixedValueFvPatchField
)
:
fixedValueFvPatchField<Type>(p, iF),
fieldTableName_(iF.name()),
setAverage_(readBool(dict.lookup("setAverage"))),
referenceCS_(NULL),
nearestVertex_(0),
......@@ -128,6 +131,11 @@ timeVaryingMappedFixedValueFvPatchField
<< endl;
}
if (dict.found("fieldTableName"))
{
dict.lookup("fieldTableName") >> fieldTableName_;
}
if (dict.found("value"))
{
fvPatchField<Type>::operator==(Field<Type>("value", dict, p.size()));
......@@ -147,6 +155,7 @@ timeVaryingMappedFixedValueFvPatchField
)
:
fixedValueFvPatchField<Type>(ptf),
fieldTableName_(ptf.fieldTableName_),
setAverage_(ptf.setAverage_),
referenceCS_(ptf.referenceCS_),
nearestVertex_(ptf.nearestVertex_),
......@@ -177,6 +186,7 @@ timeVaryingMappedFixedValueFvPatchField
)
:
fixedValueFvPatchField<Type>(ptf, iF),
fieldTableName_(ptf.fieldTableName_),
setAverage_(ptf.setAverage_),
referenceCS_(ptf.referenceCS_),
nearestVertex_(ptf.nearestVertex_),
......@@ -271,8 +281,8 @@ void timeVaryingMappedFixedValueFvPatchField<Type>::readSamplePoints()
<< "Need at least three non-colinear samplePoints"
<< " to be able to interpolate."
<< "\n on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< " of points " << samplePoints.name()
<< " in file " << samplePoints.objectPath()
<< exit(FatalError);
}
......@@ -332,8 +342,8 @@ void timeVaryingMappedFixedValueFvPatchField<Type>::readSamplePoints()
) << "Cannot find points that make valid normal." << nl
<< "Need at least three sample points which are not in a line."
<< "\n on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< " of points " << samplePoints.name()
<< " in file " << samplePoints.objectPath()
<< exit(FatalError);
}
......@@ -474,8 +484,7 @@ void timeVaryingMappedFixedValueFvPatchField<Type>::findTime
<< "In directory "
<< this->db().time().constant()/"boundaryData"/this->patch().name()
<< "\n on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< " of field " << fieldTableName_
<< exit(FatalError);
}
......@@ -563,7 +572,7 @@ void timeVaryingMappedFixedValueFvPatchField<Type>::checkTable()
(
IOobject
(
this->dimensionedInternalField().name(),
fieldTableName_,
this->db().time().constant(),
"boundaryData"
/this->patch().name()
......@@ -608,7 +617,7 @@ void timeVaryingMappedFixedValueFvPatchField<Type>::checkTable()
(
IOobject
(
this->dimensionedInternalField().name(),
fieldTableName_,
this->db().time().constant(),
"boundaryData"
/this->patch().name()
......@@ -771,6 +780,12 @@ void timeVaryingMappedFixedValueFvPatchField<Type>::write(Ostream& os) const
{
fvPatchField<Type>::write(os);
os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl;
if (fieldTableName_ != this->dimensionedInternalField().name())
{
os.writeKeyword("fieldTableName") << fieldTableName_ << token::END_STATEMENT << nl;
}
this->writeEntry("value", os);
}
......
......@@ -57,6 +57,9 @@ class timeVaryingMappedFixedValueFvPatchField
{
// Private data
//- Name of the field data table, defaults to the name of the field
word fieldTableName_;
//- If true adjust the mapped field to maintain average value
bool setAverage_;
......
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