mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -179,7 +179,7 @@ bool Foam::OutputFilterFunctionObject<OutputFilter>::execute
|
||||
template<class OutputFilter>
|
||||
bool Foam::OutputFilterFunctionObject<OutputFilter>::end()
|
||||
{
|
||||
if (active())
|
||||
if (enabled_)
|
||||
{
|
||||
if (!storeFilter_)
|
||||
{
|
||||
|
||||
@ -927,6 +927,19 @@ Foam::word Foam::GeometricField<Type, PatchField, GeoMesh>::select
|
||||
}
|
||||
|
||||
|
||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||
void Foam::GeometricField<Type, PatchField, GeoMesh>::writeMinMax
|
||||
(
|
||||
Ostream& os
|
||||
) const
|
||||
{
|
||||
os << "min/max(" << this->name() << ") = "
|
||||
<< min(*this).value() << ", "
|
||||
<< max(*this).value()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
// writeData member function required by regIOobject
|
||||
template<class Type, template<class> class PatchField, class GeoMesh>
|
||||
bool Foam::GeometricField<Type, PatchField, GeoMesh>::
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -488,6 +488,9 @@ public:
|
||||
// otherwise the standard parameters by returning the field name
|
||||
word select(bool final) const;
|
||||
|
||||
//- Helper function to write the min and max to an Ostream
|
||||
void writeMinMax(Ostream& os) const;
|
||||
|
||||
|
||||
// Member function *this operators
|
||||
|
||||
|
||||
@ -82,6 +82,41 @@ Description
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
The effectiveness table is described in terms of the primary and secondary
|
||||
mass flow rates. For example, the table:
|
||||
|
||||
secondary MFR
|
||||
| 0.1 0.2 0.3
|
||||
-----+-----------------
|
||||
0.02 | A B C
|
||||
primary MFR 0.04 | D E F
|
||||
0.06 | G H I
|
||||
|
||||
|
||||
Is specified by the following:
|
||||
|
||||
(
|
||||
0.02
|
||||
(
|
||||
(0.1 A)
|
||||
(0.2 B)
|
||||
(0.3 C)
|
||||
),
|
||||
0.04
|
||||
(
|
||||
(0.1 D)
|
||||
(0.2 E)
|
||||
(0.3 F)
|
||||
),
|
||||
0.06
|
||||
(
|
||||
(0.1 G)
|
||||
(0.2 H)
|
||||
(0.3 I)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Note
|
||||
- the table with name "fileName" should have the same units as the
|
||||
secondary mass flow rate and kg/s for phi
|
||||
|
||||
@ -189,7 +189,7 @@ void Foam::fv::SemiImplicitSource<Type>::addSup
|
||||
|
||||
UIndirectList<scalar>(Sp, cells_) = injectionRate_[fieldI].second()/VDash_;
|
||||
|
||||
eqn += Su + fvm::Sp(Sp, psi);
|
||||
eqn += Su + fvm::SuSp(Sp, psi);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -110,7 +110,7 @@ void Foam::cloudSolution::read()
|
||||
dict_.lookup("transient") >> transient_;
|
||||
dict_.lookup("coupled") >> coupled_;
|
||||
dict_.lookup("cellValueSourceCorrection") >> cellValueSourceCorrection_;
|
||||
dict_.lookup("maxCo") >> maxCo_;
|
||||
dict_.readIfPresent("maxCo", maxCo_);
|
||||
|
||||
if (steadyState())
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -31,7 +31,7 @@ Description
|
||||
- list of injector positions and directions (along injection axes)
|
||||
- number of parcels to inject per injector
|
||||
- parcel velocities
|
||||
- inner and outer cone angles
|
||||
- inner and outer half-cone angles
|
||||
- Parcel diameters obtained by distribution model
|
||||
|
||||
SourceFiles
|
||||
@ -87,10 +87,10 @@ class ConeInjection
|
||||
//- Parcel velocity magnitude relative to SOI [m/s]
|
||||
const TimeDataEntry<scalar> Umag_;
|
||||
|
||||
//- Inner cone angle relative to SOI [deg]
|
||||
//- Inner half-cone angle relative to SOI [deg]
|
||||
const TimeDataEntry<scalar> thetaInner_;
|
||||
|
||||
//- Outer cone angle relative to SOI [deg]
|
||||
//- Outer half-cone angle relative to SOI [deg]
|
||||
const TimeDataEntry<scalar> thetaOuter_;
|
||||
|
||||
//- Parcel size distribution model
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -32,7 +32,7 @@ Description
|
||||
- injector position
|
||||
- direction (along injection axis)
|
||||
- parcel flow rate
|
||||
- inner and outer cone angles
|
||||
- inner and outer half-cone angles
|
||||
|
||||
- Parcel diameters obtained by size distribution model
|
||||
|
||||
@ -134,10 +134,10 @@ private:
|
||||
//- Flow rate profile relative to SOI []
|
||||
const TimeDataEntry<scalar> flowRateProfile_;
|
||||
|
||||
//- Inner cone angle relative to SOI [deg]
|
||||
//- Inner half-cone angle relative to SOI [deg]
|
||||
const TimeDataEntry<scalar> thetaInner_;
|
||||
|
||||
//- Outer cone angle relative to SOI [deg]
|
||||
//- Outer half-cone angle relative to SOI [deg]
|
||||
const TimeDataEntry<scalar> thetaOuter_;
|
||||
|
||||
//- Parcel size PDF model
|
||||
|
||||
@ -121,7 +121,7 @@ void Foam::writeDictionary::read(const dictionary& dict)
|
||||
|
||||
digests_.setSize(dictNames_.size(), SHA1Digest());
|
||||
|
||||
Info<< type() << ": monitoring dictionaries:" << nl;
|
||||
Info<< type() << " " << name_ << ": monitoring dictionaries:" << nl;
|
||||
if (dictNames_.size())
|
||||
{
|
||||
forAll(dictNames_, i)
|
||||
@ -151,7 +151,7 @@ void Foam::writeDictionary::execute()
|
||||
{
|
||||
if (firstDict)
|
||||
{
|
||||
Info<< type() << " output:" << nl << endl;
|
||||
Info<< type() << " " << name_ << " output:" << nl << endl;
|
||||
|
||||
IOobject::writeDivider(Info);
|
||||
Info<< endl;
|
||||
|
||||
@ -89,6 +89,8 @@ void Foam::writeRegisteredObject::timeSet()
|
||||
|
||||
void Foam::writeRegisteredObject::write()
|
||||
{
|
||||
Info<< type() << " " << name_ << " output:" << nl;
|
||||
|
||||
forAll(objectNames_, i)
|
||||
{
|
||||
if (obr_.foundObject<regIOobject>(objectNames_[i]))
|
||||
@ -105,6 +107,8 @@ void Foam::writeRegisteredObject::write()
|
||||
obj.writeOpt() = IOobject::NO_WRITE;
|
||||
}
|
||||
|
||||
Info<< " writing object " << obj.name() << nl << endl;
|
||||
|
||||
obj.write();
|
||||
}
|
||||
else
|
||||
|
||||
@ -104,6 +104,7 @@ protected:
|
||||
//- Takes over the writing from Db
|
||||
bool exclusiveWriting_;
|
||||
|
||||
//- Refererence to Db
|
||||
const objectRegistry& obr_;
|
||||
|
||||
// Read from dictionary
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -76,7 +76,7 @@ void Foam::cloudInfo::read(const dictionary& dict)
|
||||
{
|
||||
functionObjectFile::resetNames(dict.lookup("clouds"));
|
||||
|
||||
Info<< type() << ": ";
|
||||
Info<< type() << " " << name_ << ": ";
|
||||
if (names().size())
|
||||
{
|
||||
Info<< "applying to clouds:" << nl;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -65,6 +65,8 @@ void Foam::fieldAverage::initialize()
|
||||
{
|
||||
resetFields();
|
||||
|
||||
Info<< type() << " " << name_ << ":" << nl;
|
||||
|
||||
|
||||
// Add mean fields to the field lists
|
||||
forAll(faItems_, fieldI)
|
||||
@ -96,6 +98,8 @@ void Foam::fieldAverage::initialize()
|
||||
// ensure first averaging works unconditionally
|
||||
prevTimeIndex_ = -1;
|
||||
|
||||
Info<< endl;
|
||||
|
||||
initialised_ = true;
|
||||
}
|
||||
|
||||
@ -107,6 +111,8 @@ void Foam::fieldAverage::calcAverages()
|
||||
initialize();
|
||||
}
|
||||
|
||||
Info<< type() << " " << name_ << " output:" << nl;
|
||||
|
||||
const label currentTimeIndex =
|
||||
static_cast<const fvMesh&>(obr_).time().timeIndex();
|
||||
|
||||
@ -119,7 +125,7 @@ void Foam::fieldAverage::calcAverages()
|
||||
prevTimeIndex_ = currentTimeIndex;
|
||||
}
|
||||
|
||||
Info<< "Calculating averages" << nl << endl;
|
||||
Info<< " Calculating averages" << nl;
|
||||
|
||||
addMeanSqrToPrime2Mean<scalar, scalar>();
|
||||
addMeanSqrToPrime2Mean<vector, symmTensor>();
|
||||
@ -143,6 +149,8 @@ void Foam::fieldAverage::calcAverages()
|
||||
|
||||
void Foam::fieldAverage::writeAverages() const
|
||||
{
|
||||
Info<< " Writing average fields" << endl;
|
||||
|
||||
writeFields<scalar>();
|
||||
writeFields<vector>();
|
||||
writeFields<sphericalTensor>();
|
||||
@ -189,8 +197,8 @@ void Foam::fieldAverage::readAveragingProperties()
|
||||
|
||||
if (resetOnRestart_)
|
||||
{
|
||||
Info<< "fieldAverage: starting averaging at time "
|
||||
<< obr_.time().timeName() << nl << endl;
|
||||
Info<< " Starting averaging at time " << obr_.time().timeName()
|
||||
<< nl;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -207,14 +215,14 @@ void Foam::fieldAverage::readAveragingProperties()
|
||||
|
||||
if (!propsDictHeader.headerOk())
|
||||
{
|
||||
Info<< "fieldAverage: starting averaging at time "
|
||||
<< obr_.time().timeName() << nl << endl;
|
||||
Info<< " Starting averaging at time " << obr_.time().timeName()
|
||||
<< nl;
|
||||
return;
|
||||
}
|
||||
|
||||
IOdictionary propsDict(propsDictHeader);
|
||||
|
||||
Info<< "fieldAverage: restarting averaging for fields:" << endl;
|
||||
Info<< " Restarting averaging for fields:" << nl;
|
||||
forAll(faItems_, fieldI)
|
||||
{
|
||||
const word& fieldName = faItems_[fieldI].fieldName();
|
||||
@ -224,13 +232,11 @@ void Foam::fieldAverage::readAveragingProperties()
|
||||
|
||||
totalIter_[fieldI] = readLabel(fieldDict.lookup("totalIter"));
|
||||
totalTime_[fieldI] = readScalar(fieldDict.lookup("totalTime"));
|
||||
Info<< " " << fieldName
|
||||
Info<< " " << fieldName
|
||||
<< " iters = " << totalIter_[fieldI]
|
||||
<< " time = " << totalTime_[fieldI] << endl;
|
||||
<< " time = " << totalTime_[fieldI] << nl;
|
||||
}
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -266,15 +272,15 @@ Foam::fieldAverage::fieldAverage
|
||||
active_ = false;
|
||||
WarningIn
|
||||
(
|
||||
"fieldAverage::fieldAverage\n"
|
||||
"(\n"
|
||||
"const word&,\n"
|
||||
"const objectRegistry&,\n"
|
||||
"const dictionary&,\n"
|
||||
"const bool\n"
|
||||
"fieldAverage::fieldAverage"
|
||||
"("
|
||||
"const word&, "
|
||||
"const objectRegistry&, "
|
||||
"const dictionary&, "
|
||||
"const bool "
|
||||
")"
|
||||
) << "No fvMesh available, deactivating."
|
||||
<< nl << endl;
|
||||
) << "No fvMesh available, deactivating " << name_ << nl
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -293,11 +299,15 @@ void Foam::fieldAverage::read(const dictionary& dict)
|
||||
{
|
||||
initialised_ = false;
|
||||
|
||||
Info<< type() << " " << name_ << ":" << nl;
|
||||
|
||||
dict.readIfPresent("resetOnRestart", resetOnRestart_);
|
||||
dict.readIfPresent("resetOnOutput", resetOnOutput_);
|
||||
dict.lookup("fields") >> faItems_;
|
||||
|
||||
readAveragingProperties();
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -307,6 +317,8 @@ void Foam::fieldAverage::execute()
|
||||
if (active_)
|
||||
{
|
||||
calcAverages();
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -329,14 +341,16 @@ void Foam::fieldAverage::write()
|
||||
|
||||
if (resetOnOutput_)
|
||||
{
|
||||
Info<< "fieldAverage: restarting averaging at time "
|
||||
<< obr_.time().timeName() << nl << endl;
|
||||
Info<< " Restarting averaging at time " << obr_.time().timeName()
|
||||
<< nl << endl;
|
||||
|
||||
initialize();
|
||||
|
||||
// ensure first averaging works unconditionally
|
||||
prevTimeIndex_ = -1;
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ void Foam::fieldAverage::addMeanFieldType(const label fieldI)
|
||||
const word& fieldName = faItems_[fieldI].fieldName();
|
||||
const word& meanFieldName = faItems_[fieldI].meanFieldName();
|
||||
|
||||
Info<< "Reading/calculating field " << meanFieldName << nl << endl;
|
||||
Info<< " Reading/initialising field " << meanFieldName << endl;
|
||||
|
||||
if (obr_.foundObject<Type>(meanFieldName))
|
||||
{
|
||||
@ -46,9 +46,9 @@ void Foam::fieldAverage::addMeanFieldType(const label fieldI)
|
||||
}
|
||||
else if (obr_.found(meanFieldName))
|
||||
{
|
||||
Info<< "Cannot allocate average field " << meanFieldName
|
||||
Info<< " Cannot allocate average field " << meanFieldName
|
||||
<< " since an object with that name already exists."
|
||||
<< " Disabling averaging." << nl << endl;
|
||||
<< " Disabling averaging for field." << endl;
|
||||
|
||||
faItems_[fieldI].mean() = false;
|
||||
}
|
||||
@ -105,7 +105,7 @@ void Foam::fieldAverage::addPrime2MeanFieldType(const label fieldI)
|
||||
const word& meanFieldName = faItems_[fieldI].meanFieldName();
|
||||
const word& prime2MeanFieldName = faItems_[fieldI].prime2MeanFieldName();
|
||||
|
||||
Info<< "Reading/calculating field " << prime2MeanFieldName << nl << endl;
|
||||
Info<< " Reading/initialising field " << prime2MeanFieldName << nl;
|
||||
|
||||
if (obr_.foundObject<Type2>(prime2MeanFieldName))
|
||||
{
|
||||
@ -113,9 +113,9 @@ void Foam::fieldAverage::addPrime2MeanFieldType(const label fieldI)
|
||||
}
|
||||
else if (obr_.found(prime2MeanFieldName))
|
||||
{
|
||||
Info<< "Cannot allocate average field " << prime2MeanFieldName
|
||||
Info<< " Cannot allocate average field " << prime2MeanFieldName
|
||||
<< " since an object with that name already exists."
|
||||
<< " Disabling averaging." << nl << endl;
|
||||
<< " Disabling averaging for field." << nl;
|
||||
|
||||
faItems_[fieldI].prime2Mean() = false;
|
||||
}
|
||||
|
||||
@ -51,7 +51,15 @@ Foam::fieldCoordinateSystemTransform::fieldCoordinateSystemTransform
|
||||
coordSys_(obr, dict)
|
||||
{
|
||||
// Check if the available mesh is an fvMesh otherise deactivate
|
||||
if (!isA<fvMesh>(obr_))
|
||||
if (isA<fvMesh>(obr_))
|
||||
{
|
||||
read(dict);
|
||||
|
||||
Info<< type() << " " << name_ << ":" << nl
|
||||
<< " Applying transformation from global Cartesian to local "
|
||||
<< coordSys_ << nl << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
active_ = false;
|
||||
WarningIn
|
||||
@ -63,15 +71,9 @@ Foam::fieldCoordinateSystemTransform::fieldCoordinateSystemTransform
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating."
|
||||
) << "No fvMesh available, deactivating " << name_
|
||||
<< endl;
|
||||
}
|
||||
|
||||
read(dict);
|
||||
|
||||
Info<< type() << ":" << nl
|
||||
<< " Applying transformation from global Cartesian to local "
|
||||
<< coordSys_ << nl << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -112,6 +114,8 @@ void Foam::fieldCoordinateSystemTransform::timeSet()
|
||||
|
||||
void Foam::fieldCoordinateSystemTransform::write()
|
||||
{
|
||||
Info<< type() << " " << name_ << " output:" << nl;
|
||||
|
||||
forAll(fieldSet_, fieldI)
|
||||
{
|
||||
// If necessary load field
|
||||
|
||||
@ -39,25 +39,9 @@ void Foam::fieldCoordinateSystemTransform::transformField
|
||||
{
|
||||
const word& fieldName = field.name() + "Transformed";
|
||||
|
||||
dimensionedTensor R("R", field.dimensions(), coordSys_.R().R());
|
||||
|
||||
if (obr_.foundObject<Type>(fieldName))
|
||||
if (!obr_.foundObject<Type>(fieldName))
|
||||
{
|
||||
Type& transField =
|
||||
const_cast<Type&>(obr_.lookupObject<Type>(fieldName));
|
||||
|
||||
transField == field;
|
||||
|
||||
forAll(field, i)
|
||||
{
|
||||
Foam::transform(transField, R, transField);
|
||||
}
|
||||
|
||||
transField.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
Type& transField = obr_.store
|
||||
obr_.store
|
||||
(
|
||||
new Type
|
||||
(
|
||||
@ -72,14 +56,23 @@ void Foam::fieldCoordinateSystemTransform::transformField
|
||||
field
|
||||
)
|
||||
);
|
||||
|
||||
forAll(field, i)
|
||||
{
|
||||
Foam::transform(transField, R, transField);
|
||||
}
|
||||
|
||||
transField.write();
|
||||
}
|
||||
|
||||
Type& transField =
|
||||
const_cast<Type&>(obr_.lookupObject<Type>(fieldName));
|
||||
|
||||
transField == field;
|
||||
|
||||
dimensionedTensor R("R", field.dimensions(), coordSys_.R().R());
|
||||
|
||||
forAll(field, i)
|
||||
{
|
||||
Foam::transform(transField, R, transField);
|
||||
}
|
||||
|
||||
Info<< " writing field " << transField.name() << nl << endl;
|
||||
|
||||
transField.write();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ Foam::fieldMinMax::fieldMinMax
|
||||
name_(name),
|
||||
obr_(obr),
|
||||
active_(true),
|
||||
log_(false),
|
||||
log_(true),
|
||||
mode_(mdMag),
|
||||
fieldSet_()
|
||||
{
|
||||
@ -76,8 +76,13 @@ Foam::fieldMinMax::fieldMinMax
|
||||
WarningIn
|
||||
(
|
||||
"fieldMinMax::fieldMinMax"
|
||||
"(const objectRegistry& obr, const dictionary& dict)"
|
||||
) << "No fvMesh available, deactivating."
|
||||
"("
|
||||
"const word&, "
|
||||
"const objectRegistry&, "
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating " << name_
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -97,7 +102,7 @@ void Foam::fieldMinMax::read(const dictionary& dict)
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
log_ = dict.lookupOrDefault<Switch>("log", false);
|
||||
log_ = dict.lookupOrDefault<Switch>("log", true);
|
||||
|
||||
mode_ = modeTypeNames_[dict.lookupOrDefault<word>("mode", "magnitude")];
|
||||
dict.lookup("fields") >> fieldSet_;
|
||||
@ -153,7 +158,7 @@ void Foam::fieldMinMax::write()
|
||||
|
||||
if (log_)
|
||||
{
|
||||
Info<< type() << " output:" << nl;
|
||||
Info<< type() << " " << name_ << " output:" << nl;
|
||||
}
|
||||
|
||||
forAll(fieldSet_, fieldI)
|
||||
|
||||
@ -45,7 +45,7 @@ void Foam::fieldValue::read(const dictionary& dict)
|
||||
{
|
||||
dict_ = dict;
|
||||
|
||||
log_ = dict.lookupOrDefault<Switch>("log", false);
|
||||
log_ = dict.lookupOrDefault<Switch>("log", true);
|
||||
dict.lookup("fields") >> fields_;
|
||||
dict.lookup("valueOutput") >> valueOutput_;
|
||||
}
|
||||
@ -82,7 +82,7 @@ Foam::fieldValue::fieldValue
|
||||
obr_(obr),
|
||||
dict_(dict),
|
||||
active_(true),
|
||||
log_(false),
|
||||
log_(true),
|
||||
sourceName_(dict.lookupOrDefault<word>("sourceName", "sampledSurface")),
|
||||
fields_(dict.lookup("fields")),
|
||||
valueOutput_(dict.lookup("valueOutput")),
|
||||
@ -104,8 +104,8 @@ Foam::fieldValue::fieldValue
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating."
|
||||
<< nl << endl;
|
||||
) << "No fvMesh available, deactivating " << name << nl
|
||||
<< endl;
|
||||
active_ = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ Foam::fieldValues::fieldValueDelta::fieldValueDelta
|
||||
name_(name),
|
||||
obr_(obr),
|
||||
loadFromFiles_(loadFromFiles),
|
||||
log_(false),
|
||||
log_(true),
|
||||
operation_(opSubtract),
|
||||
source1Ptr_(NULL),
|
||||
source2Ptr_(NULL)
|
||||
@ -119,7 +119,7 @@ Foam::fieldValues::fieldValueDelta::~fieldValueDelta()
|
||||
|
||||
void Foam::fieldValues::fieldValueDelta::read(const dictionary& dict)
|
||||
{
|
||||
log_ = dict.lookupOrDefault<Switch>("log", false);
|
||||
log_ = dict.lookupOrDefault<Switch>("log", true);
|
||||
source1Ptr_.reset
|
||||
(
|
||||
fieldValue::New
|
||||
|
||||
@ -50,7 +50,11 @@ Foam::nearWallFields::nearWallFields
|
||||
fieldSet_()
|
||||
{
|
||||
// Check if the available mesh is an fvMesh otherise deactivate
|
||||
if (!isA<fvMesh>(obr_))
|
||||
if (isA<fvMesh>(obr_))
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
else
|
||||
{
|
||||
active_ = false;
|
||||
WarningIn
|
||||
@ -62,11 +66,10 @@ Foam::nearWallFields::nearWallFields
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating."
|
||||
) << "No fvMesh available, deactivating " << name_
|
||||
<< endl;
|
||||
}
|
||||
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
@ -124,12 +127,16 @@ void Foam::nearWallFields::read(const dictionary& dict)
|
||||
reverseFieldMap_.insert(sampleFldName, fldName);
|
||||
}
|
||||
|
||||
Info<< "Creating " << fieldMap_.size() << " fields" << endl;
|
||||
Info<< type() << " " << name_ << ": Creating " << fieldMap_.size()
|
||||
<< " fields" << endl;
|
||||
|
||||
createFields(vsf_);
|
||||
createFields(vvf_);
|
||||
createFields(vSpheretf_);
|
||||
createFields(vSymmtf_);
|
||||
createFields(vtf_);
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,6 +172,7 @@ void Foam::nearWallFields::end()
|
||||
|
||||
void Foam::nearWallFields::timeSet()
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
|
||||
@ -178,7 +186,9 @@ void Foam::nearWallFields::write()
|
||||
// Do nothing
|
||||
if (active_)
|
||||
{
|
||||
Info<< "Writing sampled fields to " << obr_.time().timeName()
|
||||
Info<< type() << " " << name_ << " output:" << nl;
|
||||
|
||||
Info<< " Writing sampled fields to " << obr_.time().timeName()
|
||||
<< endl;
|
||||
|
||||
sampleFields(vsf_);
|
||||
@ -208,6 +218,8 @@ void Foam::nearWallFields::write()
|
||||
{
|
||||
vtf_[i].write();
|
||||
}
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,11 @@ Foam::processorField::processorField
|
||||
active_(true)
|
||||
{
|
||||
// Check if the available mesh is an fvMesh otherise deactivate
|
||||
if (!isA<fvMesh>(obr_))
|
||||
if (isA<fvMesh>(obr_))
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
else
|
||||
{
|
||||
active_ = false;
|
||||
WarningIn
|
||||
@ -62,11 +66,9 @@ Foam::processorField::processorField
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating."
|
||||
) << "No fvMesh available, deactivating " << name_
|
||||
<< endl;
|
||||
}
|
||||
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -50,7 +50,11 @@ Foam::readFields::readFields
|
||||
fieldSet_()
|
||||
{
|
||||
// Check if the available mesh is an fvMesh otherise deactivate
|
||||
if (!isA<fvMesh>(obr_))
|
||||
if (isA<fvMesh>(obr_))
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
else
|
||||
{
|
||||
active_ = false;
|
||||
WarningIn
|
||||
@ -62,11 +66,9 @@ Foam::readFields::readFields
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating."
|
||||
) << "No fvMesh available, deactivating " << name_
|
||||
<< endl;
|
||||
}
|
||||
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -149,10 +149,10 @@ void Foam::regionSizeDistribution::writeAlphaFields
|
||||
liquidCore.correctBoundaryConditions();
|
||||
backgroundAlpha.correctBoundaryConditions();
|
||||
|
||||
Info<< "Volume of liquid-core = "
|
||||
Info<< " Volume of liquid-core = "
|
||||
<< fvc::domainIntegrate(liquidCore).value()
|
||||
<< endl;
|
||||
Info<< "Volume of background = "
|
||||
Info<< " Volume of background = "
|
||||
<< fvc::domainIntegrate(backgroundAlpha).value()
|
||||
<< endl;
|
||||
|
||||
@ -330,18 +330,25 @@ Foam::regionSizeDistribution::regionSizeDistribution
|
||||
patchNames_(dict.lookup("patches"))
|
||||
{
|
||||
// Check if the available mesh is an fvMesh, otherwise deactivate
|
||||
if (!isA<fvMesh>(obr_))
|
||||
if (isA<fvMesh>(obr_))
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
else
|
||||
{
|
||||
active_ = false;
|
||||
WarningIn
|
||||
(
|
||||
"regionSizeDistribution::regionSizeDistribution"
|
||||
"(const objectRegistry&, const dictionary&)"
|
||||
) << "No fvMesh available, deactivating." << nl
|
||||
"("
|
||||
"const word&, "
|
||||
"const objectRegistry&, "
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating " << name_ << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
@ -402,16 +409,18 @@ void Foam::regionSizeDistribution::write()
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
Info<< type() << " " << name_ << " output:" << nl;
|
||||
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
|
||||
autoPtr<volScalarField> alphaPtr;
|
||||
if (obr_.foundObject<volScalarField>(alphaName_))
|
||||
{
|
||||
Info<< "Looking up field " << alphaName_ << endl;
|
||||
Info<< " Looking up field " << alphaName_ << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Reading field " << alphaName_ << endl;
|
||||
Info<< " Reading field " << alphaName_ << endl;
|
||||
alphaPtr.reset
|
||||
(
|
||||
new volScalarField
|
||||
@ -437,7 +446,7 @@ void Foam::regionSizeDistribution::write()
|
||||
: obr_.lookupObject<volScalarField>(alphaName_)
|
||||
);
|
||||
|
||||
Info<< "Volume of alpha = "
|
||||
Info<< " Volume of alpha = "
|
||||
<< fvc::domainIntegrate(alpha).value()
|
||||
<< endl;
|
||||
|
||||
@ -445,9 +454,9 @@ void Foam::regionSizeDistribution::write()
|
||||
const scalar maxDropletVol = 1.0/6.0*pow(maxDiam_, 3);
|
||||
const scalar delta = (maxDiam_-minDiam_)/nBins_;
|
||||
|
||||
Info<< "Mesh volume = " << meshVol << endl;
|
||||
Info<< "Maximum droplet diameter = " << maxDiam_ << endl;
|
||||
Info<< "Maximum droplet volume = " << maxDropletVol << endl;
|
||||
Info<< " Mesh volume = " << meshVol << endl;
|
||||
Info<< " Maximum droplet diameter = " << maxDiam_ << endl;
|
||||
Info<< " Maximum droplet volume = " << maxDropletVol << endl;
|
||||
|
||||
|
||||
// Determine blocked faces
|
||||
@ -506,8 +515,8 @@ void Foam::regionSizeDistribution::write()
|
||||
|
||||
regionSplit regions(mesh, blockedFace);
|
||||
|
||||
Info<< "Determined " << regions.nRegions() << " disconnected regions"
|
||||
<< endl;
|
||||
Info<< " Determined " << regions.nRegions()
|
||||
<< " disconnected regions" << endl;
|
||||
|
||||
|
||||
if (debug)
|
||||
@ -525,7 +534,7 @@ void Foam::regionSizeDistribution::write()
|
||||
mesh,
|
||||
dimensionedScalar("zero", dimless, 0)
|
||||
);
|
||||
Info<< "Dumping region as volScalarField to " << region.name()
|
||||
Info<< " Dumping region as volScalarField to " << region.name()
|
||||
<< endl;
|
||||
|
||||
forAll(regions, cellI)
|
||||
@ -557,7 +566,7 @@ void Foam::regionSizeDistribution::write()
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< token::TAB << "Region"
|
||||
Info<< " " << token::TAB << "Region"
|
||||
<< token::TAB << "Volume(mesh)"
|
||||
<< token::TAB << "Volume(" << alpha.name() << "):"
|
||||
<< token::TAB << "nCells"
|
||||
@ -577,7 +586,7 @@ void Foam::regionSizeDistribution::write()
|
||||
++vIter, ++aIter, ++numIter
|
||||
)
|
||||
{
|
||||
Info<< token::TAB << vIter.key()
|
||||
Info<< " " << token::TAB << vIter.key()
|
||||
<< token::TAB << vIter()
|
||||
<< token::TAB << aIter()
|
||||
<< token::TAB << numIter()
|
||||
@ -587,7 +596,7 @@ void Foam::regionSizeDistribution::write()
|
||||
alphaSumVol += aIter();
|
||||
nCells += numIter();
|
||||
}
|
||||
Info<< token::TAB << "Total:"
|
||||
Info<< " " << token::TAB << "Total:"
|
||||
<< token::TAB << meshSumVol
|
||||
<< token::TAB << alphaSumVol
|
||||
<< token::TAB << nCells
|
||||
@ -599,15 +608,15 @@ void Foam::regionSizeDistribution::write()
|
||||
|
||||
|
||||
{
|
||||
Info<< "Patch connected regions (liquid core):" << endl;
|
||||
Info<< token::TAB << "Region"
|
||||
Info<< " Patch connected regions (liquid core):" << endl;
|
||||
Info<< token::TAB << " Region"
|
||||
<< token::TAB << "Volume(mesh)"
|
||||
<< token::TAB << "Volume(" << alpha.name() << "):"
|
||||
<< endl;
|
||||
forAllConstIter(Map<label>, patchRegions, iter)
|
||||
{
|
||||
label regionI = iter.key();
|
||||
Info<< token::TAB << iter.key()
|
||||
Info<< " " << token::TAB << iter.key()
|
||||
<< token::TAB << allRegionVolume[regionI]
|
||||
<< token::TAB << allRegionAlphaVolume[regionI] << endl;
|
||||
|
||||
@ -616,8 +625,8 @@ void Foam::regionSizeDistribution::write()
|
||||
}
|
||||
|
||||
{
|
||||
Info<< "Background regions:" << endl;
|
||||
Info<< token::TAB << "Region"
|
||||
Info<< " Background regions:" << endl;
|
||||
Info<< " " << token::TAB << "Region"
|
||||
<< token::TAB << "Volume(mesh)"
|
||||
<< token::TAB << "Volume(" << alpha.name() << "):"
|
||||
<< endl;
|
||||
@ -638,7 +647,7 @@ void Foam::regionSizeDistribution::write()
|
||||
&& vIter() >= maxDropletVol
|
||||
)
|
||||
{
|
||||
Info<< token::TAB << vIter.key()
|
||||
Info<< " " << token::TAB << vIter.key()
|
||||
<< token::TAB << vIter()
|
||||
<< token::TAB << aIter() << endl;
|
||||
}
|
||||
@ -738,8 +747,8 @@ void Foam::regionSizeDistribution::write()
|
||||
|
||||
// Write to screen
|
||||
{
|
||||
Info<< "Bins:" << endl;
|
||||
Info<< token::TAB << "Bin"
|
||||
Info<< " Bins:" << endl;
|
||||
Info<< " " << token::TAB << "Bin"
|
||||
<< token::TAB << "Min diameter"
|
||||
<< token::TAB << "Count:"
|
||||
<< endl;
|
||||
@ -747,7 +756,7 @@ void Foam::regionSizeDistribution::write()
|
||||
scalar diam = 0.0;
|
||||
forAll(binCount, binI)
|
||||
{
|
||||
Info<< token::TAB << binI
|
||||
Info<< " " << token::TAB << binI
|
||||
<< token::TAB << diam
|
||||
<< token::TAB << binCount[binI] << endl;
|
||||
diam += delta;
|
||||
@ -774,7 +783,7 @@ void Foam::regionSizeDistribution::write()
|
||||
forAll(selected, i)
|
||||
{
|
||||
const word& fldName = scalarNames[selected[i]];
|
||||
Info<< "Scalar field " << fldName << endl;
|
||||
Info<< " Scalar field " << fldName << endl;
|
||||
|
||||
const scalarField& fld = obr_.lookupObject
|
||||
<
|
||||
@ -803,7 +812,7 @@ void Foam::regionSizeDistribution::write()
|
||||
forAll(selected, i)
|
||||
{
|
||||
const word& fldName = vectorNames[selected[i]];
|
||||
Info<< "Vector field " << fldName << endl;
|
||||
Info<< " Vector field " << fldName << endl;
|
||||
|
||||
vectorField fld = obr_.lookupObject
|
||||
<
|
||||
|
||||
@ -128,7 +128,7 @@ void Foam::streamLine::track()
|
||||
|
||||
label nSeeds = returnReduce(particles.size(), sumOp<label>());
|
||||
|
||||
Info<< type() << " : seeded " << nSeeds << " particles." << endl;
|
||||
Info << " seeded " << nSeeds << " particles." << endl;
|
||||
|
||||
// Read or lookup fields
|
||||
PtrList<volScalarField> vsFlds;
|
||||
@ -194,10 +194,10 @@ void Foam::streamLine::track()
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn("streamLine::execute()")
|
||||
<< "Cannot find field " << fields_[i] << endl
|
||||
FatalErrorIn("streamLine::track()")
|
||||
<< "Cannot find field " << fields_[i] << nl
|
||||
<< "Valid scalar fields are:"
|
||||
<< mesh.names(volScalarField::typeName) << endl
|
||||
<< mesh.names(volScalarField::typeName) << nl
|
||||
<< "Valid vector fields are:"
|
||||
<< mesh.names(volVectorField::typeName)
|
||||
<< exit(FatalError);
|
||||
@ -267,12 +267,10 @@ void Foam::streamLine::track()
|
||||
|
||||
if (UIndex == -1)
|
||||
{
|
||||
FatalErrorIn("streamLine::execute()")
|
||||
<< "Cannot find field to move particles with : " << UName_
|
||||
<< endl
|
||||
<< "This field has to be present in the sampled fields "
|
||||
<< fields_
|
||||
<< " and in the objectRegistry." << endl
|
||||
FatalErrorIn("streamLine::track()")
|
||||
<< "Cannot find field to move particles with : " << UName_ << nl
|
||||
<< "This field has to be present in the sampled fields " << fields_
|
||||
<< " and in the objectRegistry."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -374,6 +372,8 @@ void Foam::streamLine::read(const dictionary& dict)
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
Info<< type() << " " << name_ << ":" << nl;
|
||||
|
||||
//dict_ = dict;
|
||||
dict.lookup("fields") >> fields_;
|
||||
if (dict.found("UName"))
|
||||
@ -433,14 +433,14 @@ void Foam::streamLine::read(const dictionary& dict)
|
||||
{
|
||||
nSubCycle_ = 1;
|
||||
}
|
||||
Info<< type() << " : automatic track length specified through"
|
||||
Info<< " automatic track length specified through"
|
||||
<< " number of sub cycles : " << nSubCycle_ << nl << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
dict.lookup("trackLength") >> trackLength_;
|
||||
|
||||
Info<< type() << " : fixed track length specified : "
|
||||
Info<< " fixed track length specified : "
|
||||
<< trackLength_ << nl << endl;
|
||||
}
|
||||
|
||||
@ -451,7 +451,7 @@ void Foam::streamLine::read(const dictionary& dict)
|
||||
interpolationCellPoint<scalar>::typeName
|
||||
);
|
||||
|
||||
//Info<< typeName << " using interpolation " << interpolationScheme_
|
||||
//Info<< " using interpolation " << interpolationScheme_
|
||||
// << endl;
|
||||
|
||||
cloudName_ = dict.lookupOrDefault<word>("cloudName", "streamLine");
|
||||
@ -525,6 +525,8 @@ void Foam::streamLine::write()
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
Info<< type() << " " << name_ << " output:" << nl;
|
||||
|
||||
const Time& runTime = obr_.time();
|
||||
const fvMesh& mesh = dynamic_cast<const fvMesh&>(obr_);
|
||||
|
||||
@ -623,8 +625,8 @@ void Foam::streamLine::write()
|
||||
n += allTracks_[trackI].size();
|
||||
}
|
||||
|
||||
Info<< "Tracks:" << allTracks_.size()
|
||||
<< " total samples:" << n << endl;
|
||||
Info<< " Tracks:" << allTracks_.size() << " total samples:" << n
|
||||
<< endl;
|
||||
|
||||
|
||||
// Massage into form suitable for writers
|
||||
@ -694,7 +696,7 @@ void Foam::streamLine::write()
|
||||
)
|
||||
);
|
||||
|
||||
Info<< "Writing data to " << vtkFile.path() << endl;
|
||||
Info<< " Writing data to " << vtkFile.path() << endl;
|
||||
|
||||
scalarFormatterPtr_().write
|
||||
(
|
||||
@ -735,7 +737,7 @@ void Foam::streamLine::write()
|
||||
)
|
||||
);
|
||||
|
||||
//Info<< "Writing vector data to " << vtkFile << endl;
|
||||
//Info<< " Writing vector data to " << vtkFile << endl;
|
||||
|
||||
vectorFormatterPtr_().write
|
||||
(
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -49,7 +49,11 @@ Foam::surfaceInterpolateFields::surfaceInterpolateFields
|
||||
fieldSet_()
|
||||
{
|
||||
// Check if the available mesh is an fvMesh otherise deactivate
|
||||
if (!isA<fvMesh>(obr_))
|
||||
if (isA<fvMesh>(obr_))
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
else
|
||||
{
|
||||
active_ = false;
|
||||
WarningIn
|
||||
@ -61,11 +65,9 @@ Foam::surfaceInterpolateFields::surfaceInterpolateFields
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating."
|
||||
) << "No fvMesh available, deactivating " << name_
|
||||
<< endl;
|
||||
}
|
||||
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
@ -122,7 +124,9 @@ void Foam::surfaceInterpolateFields::write()
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
Info<< "Writing interpolated surface fields to "
|
||||
Info<< type() << " " << name_ << " output:" << nl;
|
||||
|
||||
Info<< " Writing interpolated surface fields to "
|
||||
<< obr_.time().timeName() << endl;
|
||||
|
||||
forAll(ssf_, i)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -59,7 +59,7 @@ void Foam::surfaceInterpolateFields::interpolateFields
|
||||
|
||||
if (obr_.found(sName))
|
||||
{
|
||||
Info<< " a surfaceField " << sName << " already exists"
|
||||
Info<< " surface field " << sName << " already exists"
|
||||
<< endl;
|
||||
}
|
||||
else
|
||||
@ -68,7 +68,7 @@ void Foam::surfaceInterpolateFields::interpolateFields
|
||||
sflds.setSize(sz+1);
|
||||
sflds.set(sz, new sfType(sName, linearInterpolate(fld)));
|
||||
|
||||
Info<< " interpolated " << fld.name() << " to create "
|
||||
Info<< " interpolated " << fld.name() << " to create "
|
||||
<< sflds[sz].name() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -101,7 +101,11 @@ Foam::turbulenceFields::turbulenceFields
|
||||
fieldSet_()
|
||||
{
|
||||
// Check if the available mesh is an fvMesh otherise deactivate
|
||||
if (!isA<fvMesh>(obr_))
|
||||
if (isA<fvMesh>(obr_))
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
else
|
||||
{
|
||||
active_ = false;
|
||||
WarningIn
|
||||
@ -113,11 +117,9 @@ Foam::turbulenceFields::turbulenceFields
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating."
|
||||
) << "No fvMesh available, deactivating " << name_
|
||||
<< endl;
|
||||
}
|
||||
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
@ -135,7 +137,7 @@ void Foam::turbulenceFields::read(const dictionary& dict)
|
||||
{
|
||||
fieldSet_.insert(wordList(dict.lookup("fields")));
|
||||
|
||||
Info<< type() << ": ";
|
||||
Info<< type() << " " << name_ << ": ";
|
||||
if (fieldSet_.size())
|
||||
{
|
||||
Info<< "storing fields:" << nl;
|
||||
|
||||
@ -457,13 +457,13 @@ Foam::wallBoundedStreamLine::wallBoundedStreamLine
|
||||
WarningIn
|
||||
(
|
||||
"wallBoundedStreamLine::wallBoundedStreamLine\n"
|
||||
"(\n"
|
||||
"const word&,\n"
|
||||
"const objectRegistry&,\n"
|
||||
"const dictionary&,\n"
|
||||
"const bool\n"
|
||||
"("
|
||||
"const word&, "
|
||||
"const objectRegistry&, "
|
||||
"const dictionary&, "
|
||||
"const bool "
|
||||
")"
|
||||
) << "No fvMesh available, deactivating."
|
||||
) << "No fvMesh available, deactivating " << name_
|
||||
<< nl << endl;
|
||||
}
|
||||
}
|
||||
@ -584,11 +584,11 @@ void Foam::wallBoundedStreamLine::read(const dictionary& dict)
|
||||
{
|
||||
label nFaces = returnReduce(faces.size(), sumOp<label>());
|
||||
|
||||
WarningIn("wallBoundedStreamLine::track()")
|
||||
WarningIn("wallBoundedStreamLine::read(const dictionary&)")
|
||||
<< "Found " << nFaces
|
||||
<<" faces with low quality or negative volume "
|
||||
<< "decomposition tets. Writing to faceSet " << faces.name()
|
||||
<< endl; //exit(FatalError);
|
||||
<< endl;
|
||||
}
|
||||
|
||||
// 2. all edges on a cell having two faces
|
||||
@ -625,7 +625,7 @@ void Foam::wallBoundedStreamLine::read(const dictionary& dict)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"wallBoundedStreamLine::read(..)"
|
||||
"wallBoundedStreamLine::read(const dictionary&)"
|
||||
) << "problem cell:" << cellI
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
@ -52,6 +52,7 @@ void Foam::forceCoeffs::writeFileHeader(const label i)
|
||||
<< "# magUInf : " << magUInf_ << nl
|
||||
<< "# lRef : " << lRef_ << nl
|
||||
<< "# Aref : " << Aref_ << nl
|
||||
<< "# CofR : " << coordSys_.origin() << nl
|
||||
<< "# Time" << tab << "Cm" << tab << "Cd" << tab << "Cl" << tab
|
||||
<< "Cl(f)" << tab << "Cl(r)";
|
||||
}
|
||||
@ -63,14 +64,16 @@ void Foam::forceCoeffs::writeFileHeader(const label i)
|
||||
<< "# bins : " << nBin_ << nl
|
||||
<< "# start : " << binMin_ << nl
|
||||
<< "# delta : " << binDx_ << nl
|
||||
<< "# direction : " << binDir_ << nl;
|
||||
<< "# direction : " << binDir_ << nl
|
||||
<< "# Time";
|
||||
|
||||
file(i)
|
||||
<< "# Time"
|
||||
<< tab << "bin"
|
||||
<< tab << "Cm"
|
||||
<< tab << "Cd"
|
||||
<< tab << "Cl";
|
||||
for (label j = 0; j < nBin_; j++)
|
||||
{
|
||||
const word jn('[' + Foam::name(j) + ']');
|
||||
|
||||
file(i)
|
||||
<< tab << "Cm" << jn << tab << "Cd" << jn << tab << "Cl" << jn;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -93,7 +96,7 @@ Foam::forceCoeffs::forceCoeffs
|
||||
const bool loadFromFiles
|
||||
)
|
||||
:
|
||||
forces(name, obr, dict, loadFromFiles),
|
||||
forces(name, obr, dict, loadFromFiles, false),
|
||||
liftDir_(vector::zero),
|
||||
dragDir_(vector::zero),
|
||||
pitchAxis_(vector::zero),
|
||||
@ -102,6 +105,8 @@ Foam::forceCoeffs::forceCoeffs
|
||||
Aref_(0.0)
|
||||
{
|
||||
read(dict);
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
|
||||
|
||||
@ -194,7 +199,7 @@ void Foam::forceCoeffs::write()
|
||||
|
||||
if (log_)
|
||||
{
|
||||
Info<< type() << " output:" << nl
|
||||
Info<< type() << " " << name_ << " output:" << nl
|
||||
<< " Cm = " << Cm << nl
|
||||
<< " Cd = " << Cd << nl
|
||||
<< " Cl = " << Cl << nl
|
||||
@ -214,16 +219,17 @@ void Foam::forceCoeffs::write()
|
||||
}
|
||||
}
|
||||
|
||||
file(1)<< obr_.time().value();
|
||||
|
||||
forAll(coeffs[0], i)
|
||||
{
|
||||
file(1)
|
||||
<< obr_.time().value()
|
||||
<< tab << i
|
||||
<< tab << coeffs[2][i]
|
||||
<< tab << coeffs[1][i]
|
||||
<< tab << coeffs[0][i]
|
||||
<< endl;
|
||||
<< tab << coeffs[0][i];
|
||||
}
|
||||
|
||||
file(1) << endl;
|
||||
}
|
||||
|
||||
if (log_)
|
||||
|
||||
@ -74,6 +74,7 @@ void Foam::forces::writeFileHeader(const label i)
|
||||
// force data
|
||||
|
||||
file(i)
|
||||
<< "# CofR : " << coordSys_.origin() << nl
|
||||
<< "# Time" << tab
|
||||
<< "forces(pressure,viscous,porous) "
|
||||
<< "moment(pressure,viscous,porous)";
|
||||
@ -94,19 +95,29 @@ void Foam::forces::writeFileHeader(const label i)
|
||||
<< "# bins : " << nBin_ << nl
|
||||
<< "# start : " << binMin_ << nl
|
||||
<< "# delta : " << binDx_ << nl
|
||||
<< "# direction : " << binDir_ << nl;
|
||||
<< "# direction : " << binDir_ << nl
|
||||
<< "# Time";
|
||||
|
||||
file(i)
|
||||
<< "# Time"
|
||||
<< tab << "bin"
|
||||
<< tab << "forces(pressure,viscous,porous)"
|
||||
<< tab << "moment(pressure,viscous,porous)";
|
||||
for (label j = 0; j < nBin_; j++)
|
||||
{
|
||||
const word jn('[' + Foam::name(j) + ']');
|
||||
|
||||
file(i)
|
||||
<< tab
|
||||
<< "forces" << jn << "(pressure,viscous,porous) "
|
||||
<< "moment" << jn << "(pressure,viscous,porous)";
|
||||
}
|
||||
if (localSystem_)
|
||||
{
|
||||
file(i)
|
||||
<< tab << "localForces(pressure,viscous,porous)"
|
||||
<< tab << "localMoment(pressure,viscous,porous)";
|
||||
for (label j = 0; j < nBin_; j++)
|
||||
{
|
||||
const word jn('[' + Foam::name(j) + ']');
|
||||
|
||||
file(i)
|
||||
<< tab
|
||||
<< "localForces" << jn << "(pressure,viscous,porous) "
|
||||
<< "localMoments" << jn << "(pressure,viscous,porous)";
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -358,7 +369,7 @@ void Foam::forces::writeForces()
|
||||
{
|
||||
if (log_)
|
||||
{
|
||||
Info<< type() << " output:" << nl
|
||||
Info<< type() << " " << name_ << " output:" << nl
|
||||
<< " forces(pressure,viscous,porous) = ("
|
||||
<< sum(force_[0]) << ","
|
||||
<< sum(force_[1]) << ","
|
||||
@ -425,17 +436,27 @@ void Foam::forces::writeBins()
|
||||
f[0][i] += f[0][i-1];
|
||||
f[1][i] += f[1][i-1];
|
||||
f[2][i] += f[2][i-1];
|
||||
|
||||
m[0][i] += m[0][i-1];
|
||||
m[1][i] += m[1][i-1];
|
||||
m[2][i] += m[2][i-1];
|
||||
}
|
||||
}
|
||||
|
||||
List<Field<vector> > lf(3);
|
||||
List<Field<vector> > lm(3);
|
||||
file(1) << obr_.time().value();
|
||||
|
||||
forAll(f[0], i)
|
||||
{
|
||||
file(1)
|
||||
<< tab
|
||||
<< "(" << f[0][i] << "," << f[1][i] << "," << f[2][i] << ") "
|
||||
<< "(" << m[0][i] << "," << m[1][i] << "," << m[2][i] << ")";
|
||||
}
|
||||
|
||||
if (localSystem_)
|
||||
{
|
||||
List<Field<vector> > lf(3);
|
||||
List<Field<vector> > lm(3);
|
||||
lf[0] = coordSys_.localVector(force_[0]);
|
||||
lf[1] = coordSys_.localVector(force_[1]);
|
||||
lf[2] = coordSys_.localVector(force_[2]);
|
||||
@ -455,27 +476,17 @@ void Foam::forces::writeBins()
|
||||
lm[2][i] += lm[2][i-1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
forAll(f[0], i)
|
||||
{
|
||||
file(1)
|
||||
<< obr_.time().value()
|
||||
<< tab << i
|
||||
<< tab << "(" << f[0][i] << "," << f[1][i] << "," << f[2][i] << ")"
|
||||
<< tab << "(" << m[0][i] << "," << m[1][i] << "," << m[2][i] << ")";
|
||||
|
||||
if (localSystem_)
|
||||
forAll(lf[0], i)
|
||||
{
|
||||
file(1)
|
||||
<< tab
|
||||
<< "(" << lf[0][i] << "," << lf[1][i] << "," << lf[2][i] << ")"
|
||||
<< tab
|
||||
<< "(" << lf[0][i] << "," << lf[1][i] << "," << lf[2][i] << ") "
|
||||
<< "(" << lm[0][i] << "," << lm[1][i] << "," << lm[2][i] << ")";
|
||||
}
|
||||
|
||||
file(1) << endl;
|
||||
}
|
||||
|
||||
file(1) << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -486,14 +497,15 @@ Foam::forces::forces
|
||||
const word& name,
|
||||
const objectRegistry& obr,
|
||||
const dictionary& dict,
|
||||
const bool loadFromFiles
|
||||
const bool loadFromFiles,
|
||||
const bool readFields
|
||||
)
|
||||
:
|
||||
functionObjectFile(obr, name, createFileNames(dict)),
|
||||
name_(name),
|
||||
obr_(obr),
|
||||
active_(true),
|
||||
log_(false),
|
||||
log_(true),
|
||||
force_(3),
|
||||
moment_(3),
|
||||
patchSet_(),
|
||||
@ -516,7 +528,15 @@ Foam::forces::forces
|
||||
initialised_(false)
|
||||
{
|
||||
// Check if the available mesh is an fvMesh otherise deactivate
|
||||
if (!isA<fvMesh>(obr_))
|
||||
if (isA<fvMesh>(obr_))
|
||||
{
|
||||
if (readFields)
|
||||
{
|
||||
read(dict);
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
active_ = false;
|
||||
WarningIn
|
||||
@ -528,11 +548,10 @@ Foam::forces::forces
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating."
|
||||
) << "No fvMesh available, deactivating " << name_
|
||||
<< endl;
|
||||
}
|
||||
|
||||
read(dict);
|
||||
}
|
||||
|
||||
|
||||
@ -553,7 +572,7 @@ Foam::forces::forces
|
||||
name_(name),
|
||||
obr_(obr),
|
||||
active_(true),
|
||||
log_(false),
|
||||
log_(true),
|
||||
force_(3),
|
||||
moment_(3),
|
||||
patchSet_(patchSet),
|
||||
@ -597,7 +616,13 @@ void Foam::forces::read(const dictionary& dict)
|
||||
{
|
||||
initialised_ = false;
|
||||
|
||||
log_ = dict.lookupOrDefault<Switch>("log", false);
|
||||
log_ = dict.lookupOrDefault<Switch>("log", true);
|
||||
|
||||
if (log_)
|
||||
{
|
||||
Info<< type() << " " << name_ << ":" << nl;
|
||||
}
|
||||
|
||||
directForceDensity_ = dict.lookupOrDefault("directForceDensity", false);
|
||||
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
@ -634,15 +659,15 @@ void Foam::forces::read(const dictionary& dict)
|
||||
localSystem_ = true;
|
||||
}
|
||||
|
||||
if (dict.readIfPresent("porosity", porosity_))
|
||||
if (dict.readIfPresent("porosity", porosity_) && log_)
|
||||
{
|
||||
if (porosity_)
|
||||
{
|
||||
Info<< "Including porosity effects" << endl;
|
||||
Info<< " Including porosity effects" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Not including porosity effects" << endl;
|
||||
Info<< " Not including porosity effects" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -278,7 +278,8 @@ public:
|
||||
const word& name,
|
||||
const objectRegistry&,
|
||||
const dictionary&,
|
||||
const bool loadFromFiles = false
|
||||
const bool loadFromFiles = false,
|
||||
const bool readFields = true
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -181,6 +181,7 @@ void Foam::abortCalculation::end()
|
||||
|
||||
void Foam::abortCalculation::timeSet()
|
||||
{
|
||||
// Do nothing - only valid on execute
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -113,6 +113,7 @@ void Foam::systemCall::end()
|
||||
|
||||
void Foam::systemCall::timeSet()
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -102,7 +102,7 @@ Foam::CourantNo::CourantNo
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating." << nl
|
||||
) << "No fvMesh available, deactivating " << name_ << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
@ -77,10 +77,34 @@ Foam::DESModelRegions::DESModelRegions
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating." << nl
|
||||
) << "No fvMesh available, deactivating " << name_ << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
if (active_)
|
||||
{
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
|
||||
volScalarField* DESModelRegionsPtr
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
type(),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("0", dimless, 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
mesh.objectRegistry::store(DESModelRegionsPtr);
|
||||
}
|
||||
|
||||
read(dict);
|
||||
}
|
||||
|
||||
@ -136,10 +160,15 @@ void Foam::DESModelRegions::write()
|
||||
|
||||
if (log_)
|
||||
{
|
||||
Info<< type() << " " << name_ << " output:" << nl;
|
||||
Info<< type() << " " << name_ << " output:" << nl;
|
||||
}
|
||||
|
||||
tmp<volScalarField> tresult;
|
||||
volScalarField& DESModelRegions =
|
||||
const_cast<volScalarField&>
|
||||
(
|
||||
mesh.lookupObject<volScalarField>(type())
|
||||
);
|
||||
|
||||
|
||||
label DESpresent = false;
|
||||
if (mesh.foundObject<icoModel>("turbulenceModel"))
|
||||
@ -151,7 +180,7 @@ void Foam::DESModelRegions::write()
|
||||
{
|
||||
const icoDESModel& des =
|
||||
dynamic_cast<const icoDESModel&>(model);
|
||||
tresult = des.LESRegion();
|
||||
DESModelRegions == des.LESRegion();
|
||||
DESpresent = true;
|
||||
}
|
||||
}
|
||||
@ -164,19 +193,18 @@ void Foam::DESModelRegions::write()
|
||||
{
|
||||
const cmpDESModel& des =
|
||||
dynamic_cast<const cmpDESModel&>(model);
|
||||
tresult = des.LESRegion();
|
||||
DESModelRegions == des.LESRegion();
|
||||
DESpresent = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (DESpresent)
|
||||
{
|
||||
const volScalarField& result = tresult();
|
||||
|
||||
scalar prc =
|
||||
gSum(result.internalField()*mesh.V())/gSum(mesh.V())*100.0;
|
||||
gSum(DESModelRegions.internalField()*mesh.V())
|
||||
/gSum(mesh.V())*100.0;
|
||||
|
||||
if (Pstream::master())
|
||||
if (Pstream::master() && log_)
|
||||
{
|
||||
file() << obr_.time().timeName() << token::TAB
|
||||
<< prc << token::TAB << 100.0 - prc << endl;
|
||||
@ -186,11 +214,11 @@ void Foam::DESModelRegions::write()
|
||||
{
|
||||
Info<< " LES = " << prc << " % (volume)" << nl
|
||||
<< " RAS = " << 100.0 - prc << " % (volume)" << nl
|
||||
<< " writing field " << result.name() << nl
|
||||
<< " writing field " << DESModelRegions.name() << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
result.write();
|
||||
DESModelRegions.write();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -65,7 +65,7 @@ Foam::Lambda2::Lambda2
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating." << nl
|
||||
) << "No fvMesh available, deactivating " << name_ << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ Foam::Peclet::Peclet
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating." << nl
|
||||
) << "No fvMesh available, deactivating " << name_ << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ Foam::Q::Q
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating." << nl
|
||||
) << "No fvMesh available, deactivating " << name_ << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ Foam::dsmcFields::dsmcFields
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating." << nl
|
||||
) << "No fvMesh available, deactivating " << name_ << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
@ -213,7 +213,7 @@ Foam::pressureTools::pressureTools
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating." << nl
|
||||
) << "No fvMesh available, deactivating " << name_ << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ Foam::wallShearStress::wallShearStress
|
||||
name_(name),
|
||||
obr_(obr),
|
||||
active_(true),
|
||||
log_(false),
|
||||
log_(true),
|
||||
patchSet_()
|
||||
{
|
||||
// Check if the available mesh is an fvMesh, otherwise deactivate
|
||||
@ -117,10 +117,39 @@ Foam::wallShearStress::wallShearStress
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating." << nl
|
||||
) << "No fvMesh available, deactivating " << name_ << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
if (active_)
|
||||
{
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
|
||||
volVectorField* wallShearStressPtr
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
type(),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector
|
||||
(
|
||||
"0",
|
||||
sqr(dimLength)/sqr(dimTime),
|
||||
vector::zero
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
mesh.objectRegistry::store(wallShearStressPtr);
|
||||
}
|
||||
|
||||
read(dict);
|
||||
}
|
||||
|
||||
@ -137,7 +166,7 @@ void Foam::wallShearStress::read(const dictionary& dict)
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
log_ = dict.lookupOrDefault<Switch>("log", false);
|
||||
log_ = dict.lookupOrDefault<Switch>("log", true);
|
||||
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
|
||||
@ -148,7 +177,7 @@ void Foam::wallShearStress::read(const dictionary& dict)
|
||||
wordReList(dict.lookupOrDefault("patches", wordReList()))
|
||||
);
|
||||
|
||||
Info<< type() << " output:" << nl;
|
||||
Info<< type() << " " << name_ << ":" << nl;
|
||||
|
||||
if (patchSet_.empty())
|
||||
{
|
||||
@ -219,18 +248,11 @@ void Foam::wallShearStress::write()
|
||||
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
|
||||
volVectorField wallShearStress
|
||||
(
|
||||
IOobject
|
||||
volVectorField& wallShearStress =
|
||||
const_cast<volVectorField&>
|
||||
(
|
||||
"wallShearStress",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mesh,
|
||||
dimensionedVector("0", sqr(dimLength)/sqr(dimTime), vector::zero)
|
||||
);
|
||||
mesh.lookupObject<volVectorField>(type())
|
||||
);
|
||||
|
||||
if (log_)
|
||||
{
|
||||
@ -256,7 +278,7 @@ void Foam::wallShearStress::write()
|
||||
else
|
||||
{
|
||||
FatalErrorIn("void Foam::wallShearStress::write()")
|
||||
<< "Unable to find incompressible turbulence model in the "
|
||||
<< "Unable to find turbulence model in the "
|
||||
<< "database" << exit(FatalError);
|
||||
}
|
||||
|
||||
@ -265,7 +287,8 @@ void Foam::wallShearStress::write()
|
||||
|
||||
if (log_)
|
||||
{
|
||||
Info<< " writing field " << wallShearStress.name() << nl
|
||||
Info<< type() << " " << name_ << " output:" << nl
|
||||
<< " writing field " << wallShearStress.name() << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
@ -195,7 +195,7 @@ Foam::yPlusLES::yPlusLES
|
||||
name_(name),
|
||||
obr_(obr),
|
||||
active_(true),
|
||||
log_(false),
|
||||
log_(true),
|
||||
phiName_("phi"),
|
||||
UName_("U")
|
||||
{
|
||||
@ -212,9 +212,33 @@ Foam::yPlusLES::yPlusLES
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating." << nl
|
||||
) << "No fvMesh available, deactivating " << name_ << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
if (active_)
|
||||
{
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
|
||||
volScalarField* yPlusLESPtr
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
type(),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("0", dimless, 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
mesh.objectRegistry::store(yPlusLESPtr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -230,7 +254,7 @@ void Foam::yPlusLES::read(const dictionary& dict)
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
log_ = dict.lookupOrDefault<Switch>("log", false);
|
||||
log_ = dict.lookupOrDefault<Switch>("log", true);
|
||||
phiName_ = dict.lookupOrDefault<word>("phiName", "phi");
|
||||
}
|
||||
}
|
||||
@ -267,18 +291,11 @@ void Foam::yPlusLES::write()
|
||||
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
|
||||
volScalarField yPlusLES
|
||||
(
|
||||
IOobject
|
||||
volScalarField& yPlusLES =
|
||||
const_cast<volScalarField&>
|
||||
(
|
||||
"yPlusLES",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("0", dimless, 0.0)
|
||||
);
|
||||
mesh.lookupObject<volScalarField>(type())
|
||||
);
|
||||
|
||||
if (log_)
|
||||
{
|
||||
@ -296,8 +313,7 @@ void Foam::yPlusLES::write()
|
||||
|
||||
if (log_)
|
||||
{
|
||||
Info<< " writing field " << yPlusLES.name() << nl
|
||||
<< endl;
|
||||
Info<< " writing field " << yPlusLES.name() << nl << endl;
|
||||
}
|
||||
|
||||
yPlusLES.write();
|
||||
|
||||
@ -183,7 +183,7 @@ Foam::yPlusRAS::yPlusRAS
|
||||
name_(name),
|
||||
obr_(obr),
|
||||
active_(true),
|
||||
log_(false),
|
||||
log_(true),
|
||||
phiName_("phi")
|
||||
{
|
||||
// Check if the available mesh is an fvMesh, otherwise deactivate
|
||||
@ -199,9 +199,33 @@ Foam::yPlusRAS::yPlusRAS
|
||||
"const dictionary&, "
|
||||
"const bool"
|
||||
")"
|
||||
) << "No fvMesh available, deactivating." << nl
|
||||
) << "No fvMesh available, deactivating " << name_ << nl
|
||||
<< endl;
|
||||
}
|
||||
|
||||
if (active_)
|
||||
{
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
|
||||
volScalarField* yPlusRASPtr
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
type(),
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("0", dimless, 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
mesh.objectRegistry::store(yPlusRASPtr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -217,7 +241,7 @@ void Foam::yPlusRAS::read(const dictionary& dict)
|
||||
{
|
||||
if (active_)
|
||||
{
|
||||
log_ = dict.lookupOrDefault<Switch>("log", false);
|
||||
log_ = dict.lookupOrDefault<Switch>("log", true);
|
||||
phiName_ = dict.lookupOrDefault<word>("phiName", "phi");
|
||||
}
|
||||
}
|
||||
@ -252,18 +276,11 @@ void Foam::yPlusRAS::write()
|
||||
|
||||
const fvMesh& mesh = refCast<const fvMesh>(obr_);
|
||||
|
||||
volScalarField yPlusRAS
|
||||
(
|
||||
IOobject
|
||||
volScalarField& yPlusRAS =
|
||||
const_cast<volScalarField&>
|
||||
(
|
||||
"yPlusRAS",
|
||||
mesh.time().timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ
|
||||
),
|
||||
mesh,
|
||||
dimensionedScalar("0", dimless, 0.0)
|
||||
);
|
||||
mesh.lookupObject<volScalarField>(type())
|
||||
);
|
||||
|
||||
if (log_)
|
||||
{
|
||||
@ -281,8 +298,7 @@ void Foam::yPlusRAS::write()
|
||||
|
||||
if (log_)
|
||||
{
|
||||
Info<< " writing field " << yPlusRAS.name() << nl
|
||||
<< endl;
|
||||
Info<< " writing field " << yPlusRAS.name() << nl << endl;
|
||||
}
|
||||
|
||||
yPlusRAS.write();
|
||||
|
||||
@ -24,6 +24,9 @@ License
|
||||
Class
|
||||
externalWallHeatFluxTemperatureFvPatchScalarField
|
||||
|
||||
Group
|
||||
grpThermoBoundaryConditions grpWallBoundaryConditions
|
||||
|
||||
Description
|
||||
This boundary condition supplies a heat flux condition for temperature
|
||||
on an external wall. Optional thin thermal layer resistances can be
|
||||
|
||||
Reference in New Issue
Block a user