Merge branch 'master' of ssh://dm/home/dm4/OpenFOAM/repositories/OpenFOAM-dev

This commit is contained in:
Henry
2014-01-10 10:48:15 +00:00
61 changed files with 3922 additions and 138 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -458,6 +458,8 @@ int main(int argc, char *argv[])
regIOobject::fileModificationChecking = regIOobject::timeStamp;
# include "createTime.H"
runTime.functionObjects().off();
word regionName = polyMesh::defaultRegion;
fileName meshSubDir;

View File

@ -0,0 +1,7 @@
boundaryInfo.C
boundaryTemplates.C
caseInfo.C
solverTemplate.C
createZeroDirectory.C
EXE = $(FOAM_APPBIN)/createZeroDirectory

View File

@ -0,0 +1,12 @@
EXE_INC = \
-DFULLDEBUG -g -O0 \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-ldynamicMesh \
-lmeshTools \
-lregionModels

View File

@ -0,0 +1,126 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "boundaryInfo.H"
#include "Time.H"
#include "IOPtrList.H"
#include "polyMesh.H"
using namespace Foam;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTemplateTypeNameAndDebug(IOPtrList<entry>, 0);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::boundaryInfo::boundaryInfo(const Time& runTime, const word& regionName)
:
names_(),
types_(),
constraint_(),
groups_(),
allGroupNames_()
{
// read the mesh boundaries for the current region
Info<< " Reading mesh boundaries" << endl;
const_cast<word&>(IOPtrList<entry>::typeName) = word::null;
IOPtrList<entry> boundaryPatchList
(
IOobject
(
"boundary",
runTime.constant(),
regionName/polyMesh::meshSubDir,
runTime,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
)
);
names_.setSize(boundaryPatchList.size());
types_.setSize(boundaryPatchList.size());
constraint_.setSize(boundaryPatchList.size(), false);
groups_.setSize(boundaryPatchList.size());
forAll(boundaryPatchList, patchI)
{
const dictionary& dict = boundaryPatchList[patchI].dict();
names_[patchI] = dict.dictName();
dict.lookup("type") >> types_[patchI];
if (polyPatch::constraintType(types_[patchI]))
{
constraint_[patchI] = true;
}
if (dict.found("inGroups"))
{
dict.lookup("inGroups") >> groups_[patchI];
allGroupNames_.insert(groups_[patchI]);
}
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::wordList& Foam::boundaryInfo::names() const
{
return names_;
}
const Foam::wordList& Foam::boundaryInfo::types() const
{
return types_;
}
const Foam::boolList& Foam::boundaryInfo::constraint() const
{
return constraint_;
}
const Foam::List<Foam::wordList>& Foam::boundaryInfo::groups() const
{
return groups_;
}
const Foam::wordHashSet& Foam::boundaryInfo::allGroupNames() const
{
return allGroupNames_;
}
// ************************************************************************* //

View File

@ -0,0 +1,103 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::boundaryInfo
Description
Class to interrogate the polyMesh/boundary file to provide mesh patching
information, without the need to read the mesh.
\*---------------------------------------------------------------------------*/
#ifndef boundaryInfo_H
#define boundaryInfo_H
#include "boolList.H"
#include "wordList.H"
#include "HashSet.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class Time;
/*---------------------------------------------------------------------------*\
Class boundaryInfo Declaration
\*---------------------------------------------------------------------------*/
class boundaryInfo
{
// Private data
//- Patch names
wordList names_;
//- Patch types
wordList types_;
//- Constraint flag
boolList constraint_;
//- Groups per patch
List<wordList> groups_;
//- Set of all group names
wordHashSet allGroupNames_;
public:
//- Constructor
boundaryInfo(const Time& runTime, const word& regionName);
// Public member functions
//- Patch names
const wordList& names() const;
//- Patch types
const wordList& types() const;
//- Constraint flag
const boolList& constraint() const;
//- Groups
const List<wordList>& groups() const;
//- Set of all group names
const wordHashSet& allGroupNames() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,463 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "boundaryTemplates.H"
#include "Time.H"
#include "IFstream.H"
#include "OStringStream.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::boundaryTemplates::boundaryTemplates
(
const fileName& baseDir,
const Time& runTime,
const word& solverType
)
:
templates_(dictionary::null),
options_(dictionary::null)
{
Info<< " Reading boundary templates" << endl;
fileName BCDir(baseDir/"boundaryConditions");
IOdictionary regionBCs
(
IOobject
(
fileName(BCDir/"boundaries"),
runTime,
IOobject::MUST_READ
)
);
forAllConstIter(dictionary, regionBCs, iter)
{
const word& regionType = iter().keyword();
wordList patchTypes(regionBCs.lookup(regionType));
dictionary regionTemplate = dictionary::null;
dictionary regionOptions = dictionary::null;
// read general boundary types
forAll(patchTypes, i)
{
IOdictionary dict
(
IOobject
(
fileName(BCDir/regionType/patchTypes[i]),
runTime,
IOobject::MUST_READ
)
);
regionTemplate.add(patchTypes[i], dictionary(dict));
}
// add solver type boundary types
forAll(patchTypes, i)
{
IOobject io
(
fileName(BCDir/regionType/solverType/patchTypes[i]),
runTime,
IOobject::MUST_READ
);
if (io.headerOk())
{
IOdictionary dict(io);
regionTemplate.subDict(patchTypes[i]).merge(dict);
}
}
// read general boundary options
forAll(patchTypes, i)
{
IOobject io
(
fileName(BCDir/regionType/patchTypes[i] + "Options"),
runTime,
IOobject::MUST_READ
);
if (io.headerOk())
{
IOdictionary dict(io);
regionOptions.add(patchTypes[i], dictionary(dict));
}
}
// add solver type boundary options
forAll(patchTypes, i)
{
IOobject io
(
fileName(BCDir/regionType/solverType/patchTypes[i] + "Options"),
runTime,
IOobject::MUST_READ
);
if (io.headerOk())
{
IOdictionary dict(io);
regionOptions.subDict(patchTypes[i]).merge(dict);
}
}
templates_.add(regionType, regionTemplate);
options_.add(regionType, regionOptions);
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::dictionary& Foam::boundaryTemplates::templates() const
{
return templates_;
}
Foam::dictionary Foam::boundaryTemplates::generatePatchDict
(
const word& regionPrefix,
const word& fieldName,
const word& condition,
const word& category,
const word& patchType,
const dictionary& conditionOptions
) const
{
const dictionary& regionTemplates = templates_.subDict(regionPrefix);
// look for inlet, outlet, wall etc
if (regionTemplates.found(category))
{
const dictionary& categoryDict(regionTemplates.subDict(category));
// look for subSonic, slip etc
if (categoryDict.found(patchType))
{
dictionary patchDict = categoryDict.subDict(patchType);
// add any options
if (patchDict.found("OPTIONS"))
{
const dictionary& regionOptions =
options_.subDict(regionPrefix);
if (!regionOptions.found(category))
{
FatalError<< "No options available for category "
<< category << exit(FatalError);
}
const dictionary& dict = regionOptions.subDict(category);
const wordList requiredOptions(patchDict.lookup("OPTIONS"));
forAll(requiredOptions, i)
{
const word& option = requiredOptions[i];
word selected;
if (!conditionOptions.readIfPresent(option, selected))
{
FatalErrorIn
(
"Foam::dictionary "
"Foam::boundaryTemplates::generatePatchDict"
"("
"const word&, "
"const word&, "
"const word&, "
"const word&, "
"const word&, "
"const dictionary&"
") const"
)
<< "Condition " << condition << ": "
<< "No option '" << option
<< "' available for category '" << category
<< "' and patch type '" << patchType
<< "'. Valid options are: "
<< conditionOptions.toc()
<< exit(FatalError);
}
if (!dict.found(option))
{
FatalErrorIn
(
"Foam::dictionary "
"Foam::boundaryTemplates::generatePatchDict"
"("
"const word&, "
"const word&, "
"const word&, "
"const word&, "
"const word&, "
"const dictionary&"
") const"
)
<< "Condition " << condition << ": "
<< "No option '" << option
<< "' available for category '" << category
<< "' and patch type '" << patchType
<< "'. Valid options are " << dict.toc()
<< exit(FatalError);
}
const dictionary& optionDict = dict.subDict(option);
if (!optionDict.found(selected))
{
FatalErrorIn
(
"Foam::dictionary "
"Foam::boundaryTemplates::generatePatchDict"
"("
"const word&, "
"const word&, "
"const word&, "
"const word&, "
"const word&, "
"const dictionary&"
") const"
)
<< "Condition " << condition << ": "
<< "No option '" << selected
<< "' available for category '" << category
<< "' and patch type '" << patchType
<< "'. Valid options are " << optionDict.toc()
<< exit(FatalError);
}
const dictionary& dict = optionDict.subDict(selected);
patchDict.merge(dict);
}
}
// look for field name
if (patchDict.found(fieldName))
{
dictionary dict(dictionary::null);
const dictionary& fieldDict(patchDict.subDict(fieldName));
forAllConstIter(IDLList<entry>, fieldDict, iter)
{
OStringStream oss;
oss << iter();
string s(oss.str());
s.replace(iter().keyword(), "");
s.replace
(
"VALUE",
"boundaryConditions." + condition + ".values"
);
dict.add(iter().keyword(), s.c_str());
}
return dict;
}
else
{
FatalErrorIn
(
"Foam::dictionary "
"Foam::boundaryTemplates::generatePatchDict"
"("
"const word&, "
"const word&, "
"const word&, "
"const word&, "
"const word&, "
"const dictionary&"
") const"
)
<< "Condition " << condition << ": "
<< "No '" << patchType
<< "' condition found for field '" << fieldName
<< "' in category type '" << category << "'"
<< exit(FatalError);
}
}
else
{
FatalErrorIn
(
"Foam::dictionary "
"Foam::boundaryTemplates::generatePatchDict"
"("
"const word&, "
"const word&, "
"const word&, "
"const word&, "
"const word&, "
"const dictionary&"
") const"
)
<< "Condition " << condition << ": "
<< "No '" << patchType << "' boundary types defined in "
<< categoryDict.dictName() << " templates. "
<< "Available types are: " << categoryDict.toc()
<< exit(FatalError);
}
}
else
{
FatalErrorIn
(
"Foam::dictionary "
"Foam::boundaryTemplates::generatePatchDict"
"("
"const word&, "
"const word&, "
"const word&, "
"const word&, "
"const word&, "
"const dictionary&"
") const"
)
<< "Condition " << condition << ": "
<< "Invalid boundary condition type '" << patchType
<< "'. Valid types are:" << regionTemplates.toc()
<< exit(FatalError);
}
return dictionary::null;
}
void Foam::boundaryTemplates::checkPatch
(
const word& regionPrefix,
const word& condition,
const word& category,
const word& patchType
) const
{
const dictionary& regionTemplates = templates_.subDict(regionPrefix);
if (!regionTemplates.found(category))
{
FatalErrorIn
(
"void Foam::boundaryTemplates::checkPatch"
"("
"const word&, "
"const word&"
") const"
)
<< "Condition " << condition << ": "
<< "Unknown category '" << category
<< "'. Valid categories are: " << regionTemplates.toc()
<< exit(FatalError);
}
const dictionary& categoryDict = regionTemplates.subDict(category);
if (!categoryDict.found(patchType))
{
FatalErrorIn
(
"void Foam::boundaryTemplates::checkPatch"
"("
"const word&, "
"const word&"
") const"
)
<< "Condition " << condition << ": "
<< "Unknown type '" << patchType << "' in category '"
<< category << "'. Valid types are: " << categoryDict.toc()
<< exit(FatalError);
}
}
bool Foam::boundaryTemplates::optionsRequired
(
const word& regionPrefix,
const word& category,
const word& patchType
) const
{
const dictionary& regionTemplates = templates_.subDict(regionPrefix);
if (regionTemplates.found(category))
{
const dictionary& categoryDict(regionTemplates.subDict(category));
if (categoryDict.found(patchType))
{
const dictionary& patchDict = categoryDict.subDict(patchType);
if (patchDict.found("OPTIONS"))
{
return true;
}
}
else
{
FatalErrorIn
(
"bool Foam::boundaryTemplates::optionsRequired"
"("
"const word&, "
"const word&"
") const"
)
<< "No type '" << patchType << "' found in category '"
<< category << "'. Valid types are "
<< categoryDict.toc()
<< exit(FatalError);
}
}
else
{
FatalErrorIn
(
"bool Foam::boundaryTemplates::optionsRequired"
"("
"const word&, "
"const word&"
") const"
)
<< "No category '" << category << "' found in templates. "
<< "Valid categories are " << templates_.toc()
<< exit(FatalError);
}
return false;
}
// ************************************************************************* //

View File

@ -0,0 +1,118 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::boundaryTemplates
Description
Class to store boundary template specifications
Templates are typically stored centrally, and constructed in a hierarchical
manner. The main use is to convert the (user) specified conditions into
a form which can be inserted into each field file as dictionary entries.
\*---------------------------------------------------------------------------*/
#ifndef boundaryTemplates_H
#define boundaryTemplates_H
#include "dictionary.H"
#include "wordList.H"
#include "wordReList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class Time;
/*---------------------------------------------------------------------------*\
Class boundaryTemplates Declaration
\*---------------------------------------------------------------------------*/
class boundaryTemplates
{
// Private data
//- Dictionary of boundary templates
dictionary templates_;
//- Dictionary of boundary template options
dictionary options_;
public:
//- Constructor
boundaryTemplates
(
const fileName& baseDir,
const Time& runTime,
const word& solverType
);
// Public member functions
//- Return the dictionary of boundary templates
const dictionary& templates() const;
//- Generate a dictionary representation of patch boundary condition
dictionary generatePatchDict
(
const word& regionPrefix,
const word& fieldName,
const word& condition,
const word& category,
const word& patchType,
const dictionary& conditionOptions
) const;
//- Check that user supplied patch info is valid
void checkPatch
(
const word& regionPrefix,
const word& condition,
const word& category,
const word& patchType
) const;
//- Return true if condition requires additional user options
bool optionsRequired
(
const word& regionPrefix,
const word& category,
const word& patchType
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,261 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "caseInfo.H"
#include "Time.H"
#include "boundaryInfo.H"
#include "boundaryTemplates.H"
using namespace Foam;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::label Foam::caseInfo::findPatchConditionID
(
const label patchI,
const word& patchName
) const
{
// 1. explicit patch names
forAll(patchNames_, i)
{
const wordReList& p = patchNames_[i];
forAll(p, j)
{
if (!p[j].isPattern() && p[j] == patchName)
{
return i;
}
}
}
// 2. patch groups using non-wildcard entries
const wordList& patchGroups = boundaryInfo_.groups()[patchI];
forAll(patchNames_, i)
{
const wordReList& p = patchNames_[i];
forAll(p, j)
{
if (!p[j].isPattern())
{
forAll(patchGroups, groupI)
{
if (p[j] == patchGroups[groupI])
{
return i;
}
}
}
}
}
// 3. wildcard overrides
forAll(patchNames_, i)
{
const wordReList& p = patchNames_[i];
forAll(p, j)
{
if (p[j].match(patchName))
{
return i;
}
}
}
FatalErrorIn
(
"Foam::label Foam::caseInfo::findPatchConditionID"
"("
"const label, "
"const word&"
") const"
)
<< "Boundary patch " << patchName << " not defined"
<< exit(FatalError);
return -1;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::caseInfo::caseInfo(const Time& runTime, const word& regionName)
:
properties_
(
IOobject
(
"caseProperties",
runTime.system(),
regionName,
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
),
boundaryInfo_(runTime, regionName),
bcDict_(properties_.subDict("boundaryConditions")),
conditionNames_(bcDict_.toc()),
patchNames_(conditionNames_.size()),
patchCategories_(conditionNames_.size()),
patchTypes_(conditionNames_.size())
{
// read the (user-supplied) boundary condition information
Info<< " Reading case properties" << endl;
forAll(conditionNames_, i)
{
const dictionary& dict = bcDict_.subDict(conditionNames_[i]);
dict.lookup("category") >> patchCategories_[i];
dict.lookup("type") >> patchTypes_[i];
dict.lookup("patches") >> patchNames_[i];
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::caseInfo::checkPatches
(
const word& regionPrefix,
const boundaryTemplates& bcTemplates
) const
{
// check that all conditions have been specified correctly wrt templates
forAll(conditionNames_, i)
{
bcTemplates.checkPatch
(
regionPrefix,
conditionNames_[i],
patchCategories_[i],
patchTypes_[i]
);
}
}
const Foam::List<Foam::wordReList>& Foam::caseInfo::patchNames() const
{
return patchNames_;
}
const Foam::word& Foam::caseInfo::conditionName(const label patchI) const
{
return conditionNames_[patchI];
}
const Foam::word& Foam::caseInfo::patchCategory(const label patchI) const
{
return patchCategories_[patchI];
}
const Foam::word& Foam::caseInfo::patchType(const label patchI) const
{
return patchTypes_[patchI];
}
Foam::dictionary Foam::caseInfo::generateBoundaryField
(
const word& regionPrefix,
const word& fieldName,
const boundaryTemplates& bcTemplates
) const
{
dictionary boundaryField = dictionary::null;
forAll(boundaryInfo_.names(), j)
{
const word& patchName = boundaryInfo_.names()[j];
if (boundaryInfo_.constraint()[j])
{
dictionary patchDict = dictionary::null;
patchDict.add("type", boundaryInfo_.types()[j]);
// add value for processor patches
patchDict.add("value", "${:internalField}");
boundaryField.add(patchName.c_str(), patchDict);
}
else
{
// condition ID to apply to mesh boundary boundaryPatchName
const label conditionI = findPatchConditionID(j, patchName);
if (conditionI == -1)
{
FatalErrorIn
(
"Foam::dictionary Foam::caseInfo::generateBoundaryField"
"("
"const word&, "
"const word&, "
"const boundaryTemplates&"
") const"
)
<< "Unable to find patch " << patchName
<< " in list of boundary conditions"
<< exit(FatalError);
}
const word& condition = conditionNames_[conditionI];
const word& category = patchCategories_[conditionI];
const word& patchType = patchTypes_[conditionI];
dictionary optionDict = dictionary::null;
if (bcTemplates.optionsRequired(regionPrefix, category, patchType))
{
optionDict = bcDict_.subDict(condition).subDict("options");
}
// create the patch dictionary entry
dictionary patchDict
(
bcTemplates.generatePatchDict
(
regionPrefix,
fieldName,
condition,
category,
patchType,
optionDict
)
);
boundaryField.add(patchName.c_str(), patchDict);
}
}
return boundaryField;
}
// ************************************************************************* //

View File

@ -0,0 +1,135 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::caseInfo
Description
Class to hold information related to the simaulation case.
\*---------------------------------------------------------------------------*/
#ifndef caseInfo_H
#define caseInfo_H
#include "boolList.H"
#include "labelList.H"
#include "wordList.H"
#include "HashSet.H"
#include "wordReList.H"
#include "IOdictionary.H"
#include "boundaryInfo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class Time;
class boundaryTemplates;
/*---------------------------------------------------------------------------*\
Class caseInfo Declaration
\*---------------------------------------------------------------------------*/
class caseInfo
{
// Private data
//- Properties dictionary
IOdictionary properties_;
//- Mesh boundary information (read from mesh boundary file)
boundaryInfo boundaryInfo_;
//- Boundary conditions dictionary
const dictionary& bcDict_;
//- List of condition names
wordList conditionNames_;
// Per-condition information
//- List of patch names
List<wordReList> patchNames_;
//- Patch category
wordList patchCategories_;
//- Patch type
wordList patchTypes_;
public:
//- Constructor
caseInfo(const Time& runTime, const word& regionName);
// Public member functions
//- Check patches
void checkPatches
(
const word& regionPrefix,
const boundaryTemplates& bcTemplates
) const;
//- Return the list of patch names
const List<wordReList>& patchNames() const;
//- Return the condition name for patch with index patchI
const word& conditionName(const label patchI) const;
//- Return the category name for patch with index patchI
const word& patchCategory(const label patchI) const;
//- Return the type name for patch with index patchI
const word& patchType(const label patchI) const;
//- Return the condition ID for a boundary patch
label findPatchConditionID
(
const label patchI,
const word& patchName
) const;
//- Generate boundary field (dictionary)
dictionary generateBoundaryField
(
const word& regionPrefix,
const word& fieldName,
const boundaryTemplates& bcTemplates
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,274 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
createZeroDirectory
Description
Creates a zero directory with fields appropriate for the chosen solver and
turbulence model. Operates on both single and multi-region cases.
Usage
The set-up is configured using a 'caseProperties' dictionary, located under
the $FOAM_CASE/system (or system/regionName if multi-region) directory.
This consists of a lists of initial and boundary conditions, e.g.
\beginverbatim
initialConditions
{
U uniform (0 0 0);
p uniform 0;
}
boundaryConditions
{
topWall
{
category wall;
patches (movingWall);
type noSlip;
options
{
wallFunction highReynolds;
motion moving;
};
values
{
U uniform (1 0 0);
}
}
walls
{
category wall;
patches (fixedWalls);
type noSlip;
options
{
wallFunction highReynolds;
motion stationary;
};
}
}
\endverbatim
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "volFields.H"
#include "IOdictionary.H"
#include "boundaryInfo.H"
#include "caseInfo.H"
#include "boundaryTemplates.H"
#include "solverTemplate.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
const word getClassType(const word& pType)
{
if (pType == pTraits<scalar>::typeName)
{
return GeometricField<scalar, fvPatchField, volMesh>::typeName;
}
else if (pType == pTraits<vector>::typeName)
{
return GeometricField<vector, fvPatchField, volMesh>::typeName;
}
else if (pType == pTraits<sphericalTensor>::typeName)
{
return GeometricField<sphericalTensor, fvPatchField, volMesh>::typeName;
}
else if (pType == pTraits<symmTensor>::typeName)
{
return GeometricField<symmTensor, fvPatchField, volMesh>::typeName;
}
else if (pType == pTraits<tensor>::typeName)
{
return GeometricField<tensor, fvPatchField, volMesh>::typeName;
}
else
{
// error
return word::null;
}
}
void createFieldFiles
(
const Time& runTime,
const word& regionName,
const word& regionPrefix,
const wordList& fieldNames,
const wordList& fieldTypes,
const PtrList<dimensionSet>& fieldDimensions,
const caseInfo& cInfo,
const boundaryTemplates& bcTemplates
)
{
Info<< " Generating field files" << nl << endl;
// create files
mkDir(runTime.path()/"0"/regionName);
forAll(fieldNames, i)
{
const_cast<word&>(IOdictionary::typeName) =
getClassType(fieldTypes[i]);
IOdictionary field
(
IOobject
(
fieldNames[i],
"0",
regionName,
runTime,
IOobject::NO_READ
)
);
word regionPath = "/";
if (regionName != word::null)
{
regionPath += regionName + '/';
}
field.add
(
"#include",
string
(
"${FOAM_CASE}/system" + regionPath + "caseProperties"
)
);
field.add("dimensions", fieldDimensions[i]);
string iField("${:initialConditions." + fieldNames[i] + '}');
field.add("internalField", iField.c_str());
dictionary boundaryField =
cInfo.generateBoundaryField
(
regionPrefix,
fieldNames[i],
bcTemplates
);
field.add("boundaryField", boundaryField);
field.regIOobject::writeObject
(
IOstream::ASCII,
IOstream::currentVersion,
IOstream::UNCOMPRESSED
);
}
}
// Main program:
int main(int argc, char *argv[])
{
// keep variable substitutions
entry::disableFunctionEntries = 1;
#include "setRootCase.H"
#include "createTime.H"
Info<< "Reading controlDict" << nl << endl;
IOdictionary controlDict
(
IOobject
(
"controlDict",
runTime.system(),
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
fileName baseDir("${WM_PROJECT_USER_DIR}/etc/templates");
baseDir.expand();
// read the solver
const word& solverName = controlDict.lookup("application");
// generate solver template
const solverTemplate solver(runTime, solverName);
// read the boundary condition templates
const boundaryTemplates bcTemplates
(
baseDir,
runTime,
solver.type()
);
Info<< endl;
const label nRegion = solver.nRegion();
for (label regionI = 0; regionI < nRegion; regionI++)
{
const word& regionName = solver.regionName(regionI);
if (regionName == word::null)
{
Info<< "Region: " << polyMesh::defaultRegion << " (default)"
<< endl;
}
else
{
Info<< "Region: " << regionName << endl;
}
// read the case set-up info for the current region
const caseInfo cInfo(runTime, regionName);
cInfo.checkPatches(solver.regionType(regionI), bcTemplates);
createFieldFiles
(
runTime,
regionName,
solver.regionType(regionI),
solver.fieldNames(regionI),
solver.fieldTypes(regionI),
solver.fieldDimensions(regionI),
cInfo,
bcTemplates
);
}
Info<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,450 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "solverTemplate.H"
#include "Time.H"
#include "IOPtrList.H"
#include "polyMesh.H"
#include "regionProperties.H"
using namespace Foam;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
template<>
const char* Foam::NamedEnum<Foam::solverTemplate::solverType, 4>::names[] =
{
"compressible",
"incompressible",
"buoyant",
"unknown"
};
}
const Foam::NamedEnum<Foam::solverTemplate::solverType, 4>
Foam::solverTemplate::solverTypeNames_;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::word Foam::solverTemplate::readFromDict
(
IOobject& dictHeader,
const word& entryName
) const
{
if (!dictHeader.headerOk())
{
FatalErrorIn
(
"Foam::word Foam::solverTemplate::readFromDict"
"("
"IOobject&, "
"const word&"
") const"
)
<< "Unable to open file "
<< dictHeader.objectPath()
<< exit(FatalError);
}
IOdictionary dict(dictHeader);
return dict.lookup(entryName);
}
Foam::dictionary Foam::solverTemplate::readFluidFieldTemplates
(
const word& regionName,
const fileName& baseDir,
const dictionary& solverDict,
const Time& runTime
) const
{
Info<< " Reading fluid field templates";
if (regionName == word::null)
{
Info<< endl;
}
else
{
Info<< " for region " << regionName << endl;
}
dictionary fieldTemplates = solverDict.subDict("fluidFields");
const fileName turbModelDir(baseDir/"models"/"turbulence");
word turbulenceModel("laminar"); // default to laminar
const dictionary fieldModels(solverDict.subDict("fluidModels"));
word turbulenceType = "none";
if (fieldModels.readIfPresent("turbulenceModel", turbulenceType))
{
word simulationType(word::null);
IOobject RASHeader
(
"RASProperties",
runTime.constant(),
regionName,
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
IOobject LESHeader
(
"LESProperties",
runTime.constant(),
regionName,
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (turbulenceType == "turbulenceModel")
{
IOobject turbulencePropertiesHeader
(
"turbulenceProperties",
runTime.constant(),
regionName,
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (turbulencePropertiesHeader.headerOk())
{
const IOdictionary turbulenceProperties
(
turbulencePropertiesHeader
);
turbulenceProperties.lookup("simulationType") >> simulationType;
if (simulationType == "RASModel")
{
turbulenceModel = readFromDict(RASHeader, "RASModel");
}
else if (simulationType == "LESModel")
{
turbulenceModel = readFromDict(LESHeader, "LESModel");
}
}
else
{
FatalError<< "Unable to open file "
<< turbulencePropertiesHeader.objectPath()
<< exit(FatalError);
}
}
else if (turbulenceType == "RASModel")
{
turbulenceModel = readFromDict(RASHeader, "RASModel");
}
else if (turbulenceType == "LESModel")
{
turbulenceModel = readFromDict(LESHeader, "LESModel");
}
else
{
FatalErrorIn
(
"Foam::dictionary Foam::solverTemplate::readFluidFieldTemplates"
"("
"const word&, "
"const fileName&, "
"const dictionary&, "
"const Time&"
") const"
)
<< "Unhandled turbulence model option"
<< abort(FatalError);
}
}
IOdictionary turbModelDict
(
IOobject
(
fileName(turbModelDir/turbulenceModel),
runTime,
IOobject::MUST_READ
)
);
switch (solverType_)
{
case stIncompressible:
{
fieldTemplates.merge(turbModelDict.subDict("incompressibleFields"));
break;
}
case stCompressible:
case stBuoyant:
{
fieldTemplates.merge(turbModelDict.subDict("compressibleFields"));
break;
}
default:
{
// do nothing
}
}
return fieldTemplates;
}
Foam::dictionary Foam::solverTemplate::readSolidFieldTemplates
(
const word& regionName,
const dictionary& solverDict
) const
{
Info<< " Reading solid field templates for region " << regionName
<< endl;
// nothing more to do for solids
return solverDict.subDict("solidFields");
}
void Foam::solverTemplate::setRegionProperties
(
const dictionary& fieldDict,
const word& regionType,
const word& regionName,
const label regionI
)
{
regionTypes_[regionI] = regionType,
regionNames_[regionI] = regionName,
fieldNames_[regionI] = fieldDict.toc();
fieldTypes_[regionI].setSize(fieldNames_[regionI].size());
fieldDimensions_[regionI].setSize(fieldNames_[regionI].size());
forAll(fieldNames_[regionI], i)
{
const word& fieldName = fieldNames_[regionI][i];
const dictionary& dict = fieldDict.subDict(fieldName);
dict.lookup("type") >> fieldTypes_[regionI][i];
fieldDimensions_[regionI].set
(
i,
new dimensionSet(dict.lookup("dimensions"))
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::solverTemplate::solverTemplate
(
const Time& runTime,
const word& solverName
)
:
solverType_(stUnknown),
multiRegion_(false),
regionTypes_(),
fieldNames_(),
fieldTypes_(),
fieldDimensions_()
{
fileName baseDir("${WM_PROJECT_USER_DIR}/etc/templates");
baseDir.expand();
IOdictionary solverDict
(
IOobject
(
fileName(baseDir/"solvers"/solverName),
runTime,
IOobject::MUST_READ
)
);
Info<< "Selecting " << solverName << ": ";
solverType_ = solverTypeNames_.read(solverDict.lookup("solverType"));
Info<< solverTypeNames_[solverType_];
multiRegion_ = readBool(solverDict.lookup("multiRegion"));
if (multiRegion_)
{
Info<< ", multi-region";
}
else
{
Info<< ", single-region";
}
Info<< " case" << endl;
if (multiRegion_)
{
// read regionProperties
regionProperties rp(runTime);
const wordList fluidNames(rp["fluid"]);
const wordList solidNames(rp["solid"]);
const label nRegion = fluidNames.size() + solidNames.size();
regionTypes_.setSize(nRegion);
regionNames_.setSize(nRegion);
fieldNames_.setSize(nRegion);
fieldTypes_.setSize(nRegion);
fieldDimensions_.setSize(nRegion);
// read templates for solver lists of avaliable
// - fields and dimensions required for the solver
// - models
label regionI = 0;
forAll(fluidNames, i)
{
const dictionary fieldDict
(
readFluidFieldTemplates
(
fluidNames[i],
baseDir,
solverDict,
runTime
)
);
setRegionProperties(fieldDict, "fluid", fluidNames[i], regionI++);
}
forAll(solidNames, i)
{
const dictionary fieldDict
(
readSolidFieldTemplates
(
solidNames[i],
solverDict
)
);
setRegionProperties(fieldDict, "solid", solidNames[i], regionI++);
}
}
else
{
regionTypes_.setSize(1);
regionNames_.setSize(1);
fieldNames_.setSize(1);
fieldTypes_.setSize(1);
fieldDimensions_.setSize(1);
// read templates for solver lists of avaliable
// - fields and dimensions required for the solver
// - models
const dictionary fieldDict
(
readFluidFieldTemplates
(
word::null, // use region = null for single-region cases
baseDir,
solverDict,
runTime
)
);
setRegionProperties(fieldDict, "fluid", word::null, 0);
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::word Foam::solverTemplate::type() const
{
return solverTypeNames_[solverType_];
}
bool Foam::solverTemplate::multiRegion() const
{
return multiRegion_;
}
label Foam::solverTemplate::nRegion() const
{
return regionTypes_.size();
}
const Foam::word& Foam::solverTemplate::regionType(const label regionI) const
{
return regionTypes_[regionI];
}
const Foam::word& Foam::solverTemplate::regionName(const label regionI) const
{
return regionNames_[regionI];
}
const Foam::wordList& Foam::solverTemplate::fieldNames
(
const label regionI
) const
{
return fieldNames_[regionI];
}
const Foam::wordList& Foam::solverTemplate::fieldTypes
(
const label regionI
) const
{
return fieldTypes_[regionI];
}
const Foam::PtrList<Foam::dimensionSet>& Foam::solverTemplate::fieldDimensions
(
const label regionI
) const
{
return fieldDimensions_[regionI];
}
// ************************************************************************* //

View File

@ -0,0 +1,182 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::solverTemplate
Description
Class to store solver template specifications
\*---------------------------------------------------------------------------*/
#ifndef solverTemplate_H
#define solverTemplate_H
#include "boolList.H"
#include "wordList.H"
#include "dimensionSet.H"
#include "IOobject.H"
#include "NamedEnum.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class Time;
/*---------------------------------------------------------------------------*\
Class solverTemplate Declaration
\*---------------------------------------------------------------------------*/
class solverTemplate
{
public:
// Public enumerations
//- Solver type
enum solverType
{
stCompressible,
stIncompressible,
stBuoyant,
stUnknown
};
//- Solver type names
static const NamedEnum<solverType, 4> solverTypeNames_;
private:
// Private data
//- Solver type
solverType solverType_;
//- Multi-region flag
bool multiRegion_;
// Per-region info
//- Region types
wordList regionTypes_;
//- Region names
wordList regionNames_;
//- Field names
List<wordList> fieldNames_;
//- Field types
List<wordList> fieldTypes_;
//- Field dimensions
List<PtrList<dimensionSet> > fieldDimensions_;
// Public member functions
//- Read a word from a dictionary (offers some protection...)
word readFromDict
(
IOobject& dictHeader,
const word& entryName
) const;
//- Read fluid region templates
dictionary readFluidFieldTemplates
(
const word& regionName,
const fileName& baseDir,
const dictionary& solverDict,
const Time& runTime
) const;
//- Read solid region templates
dictionary readSolidFieldTemplates
(
const word& regionName,
const dictionary& solverDict
) const;
//- Set the properties for region with index regionI
void setRegionProperties
(
const dictionary& dict,
const word& regionType,
const word& regionName,
const label regionI
);
public:
//- Constructor
solverTemplate(const Time& runTime, const word& regionName);
// Public member functions
//- Solver type name
word type() const;
//- Return the multi-region flag
bool multiRegion() const;
//- Return the number of regions
label nRegion() const;
// Per-region info
//- Return the region type
const word& regionType(const label regionI) const;
//- Return the region name
const word& regionName(const label regionI) const;
//- Return the field names
const wordList& fieldNames(const label regionI) const;
//- Return the field types
const wordList& fieldTypes(const label regionI) const;
//- Return the field dimensions
const PtrList<dimensionSet>& fieldDimensions
(
const label regionI
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,31 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object boundaries;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
fluid
(
inlet
outlet
wall
);
solid
(
wall
);
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object inlet;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
subSonic
{
p
{
type calculated;
value ${:VALUE.p};
}
p_rgh
{
type fixedFluxPressure;
value ${:VALUE.p_rgh};
}
T
{
type fixedValue;
value ${:VALUE.T};
}
mut
{
type fixedValue;
value ${:VALUE.mut};
}
alphat
{
type fixedValue;
value ${:VALUE.alphat};
}
}
// ************************************************************************* //

View File

@ -0,0 +1,77 @@
l/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object inlet;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
flowSpecification
{
fixedPressure
{
U
{
type pressureInletVelocity;
value ${:inlet.U};
}
p
{
type calculated;
value ${:inlet.p};
}
p_rgh
{
type fixedValue;
value ${:inlet.p_rgh};
}
}
fixedVelocity
{
U
{
type fixedValue;
value ${:VALUE.U};
}
p
{
type calculated;
value ${:inlet.p};
}
p_rgh
{
type zeroGradient;
}
}
flowRate
{
U
{
type flowRateInletVelocity;
massFlowRate ${:VALUE.massFlowRate};
value ${:VALUE.U};
}
p
{
type calculated;
value ${:VALUE.p};
}
p_rgh
{
type fixedFluxPressure;
value ${:VALUE.p_rgh};
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object outlet;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
subSonic
{
T
{
type inletOutlet;
inletValue ${:VALUE.T};
value ${:VALUE.T};
}
p
{
type calculated;
value ${:VALUE.p};
}
p_rgh
{
type fixedValue;
value ${:VALUE.p_rgh};
}
mut
{
type zeroGradient;
}
alphat
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object wall;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
noSlip
{
p
{
type calculated;
value ${:VALUE.p};
}
p_rgh
{
type fixedFluxPressure;
value ${:VALUE.p_rgh};
}
OPTIONS (wallFunction motion heatTransfer);
}
slip
{
p
{
type calculated;
value ${:VALUE.p};
}
p_rgh
{
type fixedFluxPressure;
value ${:VALUE.p_rgh};
}
mut
{
type zeroGradient;
}
alphat
{
type zeroGradient;
}
OPTIONS (heatTransfer);
}
// ************************************************************************* //

View File

@ -0,0 +1,80 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object wallOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
wallFunction
{
highReynolds
{
mut
{
type compressible::mutkWallFunction;
value ${:VALUE.mut};
}
alphat
{
type compressible::alphatWallFunction;
value ${:VALUE.alphat};
}
}
lowReynolds
{
mut
{
type fixedValue;
value uniform 0;
}
alphat
{
type fixedValue;
value uniform 0;
}
}
}
heatTransfer
{
adiabatic
{
T
{
type zeroGradient;
}
}
fixedTemperature
{
T
{
type fixedValue;
value ${:VALUE.T};
}
}
thermalCoupled
{
T
{
type compressible::turbulentTemperatureCoupledBaffleMixed;
value ${:VALUE.T};
Tnbr T;
kappa fluidThermo;
kappaName none;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,38 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object inlet;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
subSonic
{
T
{
type fixedValue;
value ${:VALUE.T};
}
mut
{
type fixedValue;
value ${:VALUE.mut};
}
alphat
{
type fixedValue;
value ${:VALUE.alphat};
}
}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object inletOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
flowSpecification
{
fixedTotalPressure
{
U
{
type pressureInletVelocity;
value ${:inlet.U};
}
p
{
type totalPressure;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
p0 ${:inlet.p};
value ${:inlet.p};
}
}
flowRate
{
U
{
type flowRateInletVelocity;
massFlowRate ${:VALUE.massFlowRate};
value ${:VALUE.U};
}
p
{
type zeroGradient;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object outlet;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
subSonic
{
T
{
type inletOutlet;
inletValue ${:VALUE.T};
value ${:VALUE.T};
}
mut
{
type zeroGradient;
}
alphat
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,39 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object wall;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
noSlip
{
OPTIONS (wallFunction motion heatTransfer);
}
slip
{
mut
{
type zeroGradient;
}
alphat
{
type zeroGradient;
}
OPTIONS (heatTransfer);
}
// ************************************************************************* //

View File

@ -0,0 +1,80 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object wallOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
wallFunction
{
highReynolds
{
mut
{
type compressible::mutkWallFunction;
value ${:VALUE.nut};
}
alphat
{
type compressible::alphatWallFunction;
value ${:VALUE.alphat};
}
}
lowReynolds
{
mut
{
type fixedValue;
value uniform 0;
}
alphat
{
type fixedValue;
value uniform 0;
}
}
}
heatTransfer
{
adiabatic
{
T
{
type zeroGradient;
}
}
fixedTemperature
{
T
{
type fixedValue;
value ${:VALUE.T};
}
}
thermalCoupled
{
T
{
type compressible::turbulentTemperatureCoupledBaffleMixed;
value ${:VALUE.T};
Tnbr T;
kappa fluidThermo;
kappaName none;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,28 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object inlet;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
subSonic
{
nut
{
type fixedValue;
value ${:VALUE.nut};
}
}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object inletOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
flowSpecification
{
fixedTotalPressure
{
U
{
type pressureInletVelocity;
value ${:inlet.U};
}
p
{
type totalPressure;
U U;
phi phi;
rho none;
psi none;
gamma 1;
p0 ${:inlet.p};
value ${:inlet.p};
}
}
flowRate
{
U
{
type flowRateInletVelocity;
volumeFlowRate ${:VALUE.volumeFlowRate};
value ${:VALUE.U};
}
p
{
type zeroGradient;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,36 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object outlet;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
subSonic
{
nut
{
type zeroGradient;
}
}
subSonicNoReturn
{
nut
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,27 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object wall;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
slip
{
nut
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,39 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object wallOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
wallFunction
{
highReynolds
{
nut
{
type nutkWallFunction;
value ${:VALUE.nut};
}
}
lowReynolds
{
nut
{
type fixedValue;
value uniform 0;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,40 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object inlet;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
subSonic
{
k
{
type fixedValue;
value ${:VALUE.k};
}
epsilon
{
type fixedValue;
value ${:VALUE.epsilon};
}
omega
{
type fixedValue;
value ${:VALUE.omega};
}
OPTIONS (flowSpecification);
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object inletOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
flowSpecification
{
fixedPressure
{
U
{
type pressureInletVelocity;
value ${:inlet.U};
}
p
{
type fixedValue;
value ${:inlet.p};
}
}
fixedVelocity
{
U
{
type fixedValue;
value ${:VALUE.U};
}
p
{
type zeroGradient;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object outlet;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
subSonic
{
p
{
type fixedValue;
value ${:VALUE.p};
}
k
{
type zeroGradient;
}
epsilon
{
type zeroGradient;
}
omega
{
type zeroGradient;
}
OPTIONS (returnFlow);
}
// ************************************************************************* //

View File

@ -0,0 +1,40 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object outlet;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
returnFlow
{
default
{
U
{
type pressureInletOutletVelocity;
value ${:VALUE.U};
}
}
wall
{
U
{
type inletOutlet;
inletValue uniform (0 0 0);
value ${:VALUE.U};
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object wall;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
noSlip
{
p
{
type zeroGradient;
}
OPTIONS (wallFunction motion);
}
slip
{
U
{
type slip;
}
p
{
type zeroGradient;
}
k
{
type zeroGradient;
}
epsilon
{
type zeroGradient;
}
omega
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,79 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object wallOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
wallFunction
{
highReynolds
{
k
{
type kqRWallFunction;
}
epsilon
{
type epsilonWallFunction;
value ${:VALUE.epsilon};
}
omega
{
type omegaWallFunction;
value ${:VALUE.omega};
}
}
lowReynolds
{
k
{
type fixedValue;
value uniform 0;
}
epsilon
{
type fixedValue;
value uniform 1e-8;
}
omega
{
type fixedValue;
value uniform 1e-8;
}
}
}
motion
{
stationary
{
U
{
type fixedValue;
value uniform (0 0 0);
}
}
moving
{
U
{
type fixedValue;
value ${:VALUE.U};
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,30 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object wall;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermal
{
p
{
type calculated;
value ${:VALUE.T};
}
OPTIONS (heatTransfer);
}
// ************************************************************************* //

View File

@ -0,0 +1,80 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object wallOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
wallFunction
{
highReynolds
{
mut
{
type compressible::mutkWallFunction;
value ${:VALUE.nut};
}
alphat
{
type compressible::alphatWallFunction;
value ${:VALUE.alphat};
}
}
lowReynolds
{
mut
{
type fixedValue;
value uniform 0;
}
alphat
{
type fixedValue;
value uniform 0;
}
}
}
heatTransfer
{
adiabatic
{
T
{
type zeroGradient;
}
}
fixedTemperature
{
T
{
type fixedValue;
value ${:VALUE.T};
}
}
thermalCoupled
{
T
{
type compressible::turbulentTemperatureCoupledBaffleMixed;
value ${:VALUE.T};
Tnbr T;
kappa solidThermo;
kappaName none;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,55 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object kEpsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
incompressibleFields
{
k
{
type scalar;
dimensions [0 2 -2 0 0];
}
epsilon
{
type scalar;
dimensions [0 2 -3 0 0];
}
nut
{
type scalar;
dimensions [0 2 -1 0 0];
}
}
compressibleFields
{
k
{
type scalar;
dimensions [0 2 -2 0 0];
}
epsilon
{
type scalar;
dimensions [0 2 -3 0 0];
}
mut
{
type scalar;
dimensions [1 -1 -1 0 0];
}
}
// ************************************************************************* //

View File

@ -0,0 +1,55 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object kOmega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
incompressibleFields
{
k
{
type scalar;
dimensions [0 2 -2 0 0];
}
omega
{
type scalar;
dimensions [0 0 -1 0 0];
}
nut
{
type scalar;
dimensions [0 2 -1 0 0];
}
}
compressibleFields
{
k
{
type scalar;
dimensions [0 2 -2 0 0];
}
omega
{
type scalar;
dimensions [0 0 -1 0 0];
}
mut
{
type scalar;
dimensions [1 -1 -1 0 0];
}
}
// ************************************************************************* //

View File

@ -0,0 +1,55 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object kOmega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
incompressibleFields
{
k
{
type scalar;
dimensions [0 2 -2 0 0];
}
omega
{
type scalar;
dimensions [0 0 -1 0 0];
}
nut
{
type scalar;
dimensions [0 2 -1 0 0];
}
}
compressibleFields
{
k
{
type scalar;
dimensions [0 2 -2 0 0];
}
omega
{
type scalar;
dimensions [0 0 -1 0 0];
}
mut
{
type scalar;
dimensions [1 -1 -1 0 0];
}
}
// ************************************************************************* //

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object laminar;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
incompressibleFields
{
}
compressibleFields
{
}
// ************************************************************************* //

View File

@ -0,0 +1,70 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object chtMultiRegionFoam;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solverType buoyant;
multiRegion yes;
fluidModels
{
turbulenceModel turbulenceModel;
}
fluidFields
{
alphat
{
type scalar;
dimensions [1 -1 -1 0 0];
}
U
{
type vector;
dimensions [0 1 -1 0 0];
}
p
{
type scalar;
dimensions [1 -1 -2 0 0];
}
p_rgh
{
type scalar;
dimensions [1 -1 -2 0 0];
}
T
{
type scalar;
dimensions [0 0 0 1 0];
}
}
solidFields
{
p
{
type scalar;
dimensions [1 -1 -2 0 0];
}
T
{
type scalar;
dimensions [0 0 0 1 0];
}
}
// ************************************************************************* //

View File

@ -0,0 +1,40 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object icoFoam;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solverType incompressible;
multiRegion no;
fluidModels
{
}
fluidFields
{
U
{
type vector;
dimensions [0 1 -1 0 0];
}
p
{
type scalar;
dimensions [0 2 -2 0 0];
}
}
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object simpleFoam;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solverType incompressible;
multiRegion no;
fluidModels
{
turbulenceModel RASModel;
}
fluidFields
{
U
{
type vector;
dimensions [0 1 -1 0 0];
}
p
{
type scalar;
dimensions [0 2 -2 0 0];
}
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -78,6 +78,12 @@ Foam::dimensionSet::dimensionSet
}
Foam::dimensionSet::dimensionSet(const dimensionSet& ds)
{
reset(ds);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::dimensionSet::dimensionless() const

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -158,6 +158,7 @@ private:
label size_;
// Private Member Functions
void push(const token&);
@ -172,6 +173,7 @@ private:
tokeniser(Istream&);
// Member Functions
Istream& stream()
@ -190,7 +192,6 @@ private:
static bool valid(char c);
static label priority(const token& t);
};
@ -244,6 +245,15 @@ public:
const scalar moles
);
//- Copy constructor
dimensionSet(const dimensionSet& ds);
//- Construct and return a clone
autoPtr<dimensionSet> clone() const
{
return autoPtr<dimensionSet>(new dimensionSet(*this));
}
//- Construct from Istream
dimensionSet(Istream&);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -652,7 +652,7 @@ Foam::Ostream& Foam::dimensionSet::write
os << token::BEGIN_SQR;
if (writeUnits.valid())
if (writeUnits.valid() && os.format() == IOstream::ASCII)
{
scalarField exponents(dimensionSet::nDimensions);
for (int d=0; d<dimensionSet::nDimensions; d++)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -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-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -94,10 +94,23 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
if (cellZoneName != "none")
{
zoneID_ = cellZones().findZoneID(cellZoneName);
Info<< "Applying solid body motion to cellZone " << cellZoneName
<< endl;
zoneID_ = cellZones().findZoneID(cellZoneName);
if (zoneID_ == -1)
{
FatalErrorIn
(
"solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject&)"
)
<< "Unable to find cellZone " << cellZoneName
<< ". Valid celLZones are:"
<< cellZones().names()
<< exit(FatalError);
}
const cellZone& cz = cellZones()[zoneID_];

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -81,15 +81,6 @@ private:
const label unmappedIndex
);
//- Map from old to new according to map. Handles map = -1.
template<class Type>
static void map
(
const Field<Type>&,
const labelList& map,
Field<Type>&
);
//- Update single volField.
template<class Type>
static void MapVolField

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -30,26 +30,6 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::fvMeshAdder::map
(
const Field<Type>& oldFld,
const labelList& oldToNew,
Field<Type>& fld
)
{
forAll(oldFld, cellI)
{
label newCellI = oldToNew[cellI];
if (newCellI >= 0 && newCellI < fld.size())
{
fld[newCellI] = oldFld[cellI];
}
}
}
template<class Type>
void Foam::fvMeshAdder::MapVolField
(
@ -73,8 +53,8 @@ void Foam::fvMeshAdder::MapVolField
intFld.setSize(mesh.nCells());
map(oldInternalField, meshMap.oldCellMap(), intFld);
map(fldToAdd.internalField(), meshMap.addedCellMap(), intFld);
intFld.rmap(oldInternalField, meshMap.oldCellMap());
intFld.rmap(fldToAdd.internalField(), meshMap.addedCellMap());
}
@ -156,7 +136,7 @@ void Foam::fvMeshAdder::MapVolField
oldPatchSizes[patchI],
meshMap.oldFaceMap(),
mesh.boundaryMesh()[newPatchI],
0 // unmapped value
-1 // unmapped value
)
);
@ -218,7 +198,7 @@ void Foam::fvMeshAdder::MapVolField
oldPatch.size(),
meshMap.addedFaceMap(),
newPatch,
0 // unmapped values
-1 // unmapped values
)
);
@ -241,34 +221,23 @@ void Foam::fvMeshAdder::MapVolField
// PatchField will have correct size already. Just slot in
// my elements.
// From new patch faces to patch faces on added mesh. This
// time keep unmapped elements -1.
labelList newToAdded
labelList addedToNew(oldPatch.size(), -1);
forAll(addedToNew, i)
{
label addedFaceI = oldPatch.start()+i;
label newFaceI = meshMap.addedFaceMap()[addedFaceI];
label patchFaceI = newFaceI-newPatch.start();
if (patchFaceI >= 0 && patchFaceI < newPatch.size())
{
addedToNew[i] = patchFaceI;
}
}
bfld[newPatchI].rmap
(
calcPatchMap
(
oldPatch.start(),
oldPatch.size(),
meshMap.addedFaceMap(),
newPatch,
-1 // unmapped values
)
fldToAdd.boundaryField()[patchI],
addedToNew
);
const fvPatchField<Type>& addedFld =
fldToAdd.boundaryField()[patchI];
fvPatchField<Type>& newFld = bfld[newPatchI];
forAll(newFld, i)
{
label oldFaceI = newToAdded[i];
if (oldFaceI >= 0 && oldFaceI < addedFld.size())
{
newFld[i] = addedFld[oldFaceI];
}
}
}
}
}
@ -375,8 +344,9 @@ void Foam::fvMeshAdder::MapSurfaceField
intFld.setSize(mesh.nInternalFaces());
map(oldField, meshMap.oldFaceMap(), intFld);
map(fldToAdd, meshMap.addedFaceMap(), intFld);
intFld.rmap(oldField, meshMap.oldFaceMap());
intFld.rmap(fldToAdd, meshMap.addedFaceMap());
// Faces that were boundary faces but are not anymore.
// Use owner value (so lowest numbered cell, i.e. from 'old' not 'added'
@ -474,13 +444,12 @@ void Foam::fvMeshAdder::MapSurfaceField
oldPatchSizes[patchI],
meshMap.oldFaceMap(),
mesh.boundaryMesh()[newPatchI],
0 // unmapped value
-1 // unmapped value
)
);
directFvPatchFieldMapper patchMapper(newToOld);
// Create new patchField with same type as existing one.
// Note:
// - boundaryField already in new order so access with newPatchI
@ -536,7 +505,7 @@ void Foam::fvMeshAdder::MapSurfaceField
oldPatch.size(),
meshMap.addedFaceMap(),
newPatch,
0 // unmapped values
-1 // unmapped values
)
);
@ -559,34 +528,23 @@ void Foam::fvMeshAdder::MapSurfaceField
// PatchField will have correct size already. Just slot in
// my elements.
// From new patch faces to patch faces on added mesh. This
// time keep unmapped elements -1.
labelList newToAdded
labelList addedToNew(oldPatch.size(), -1);
forAll(addedToNew, i)
{
label addedFaceI = oldPatch.start()+i;
label newFaceI = meshMap.addedFaceMap()[addedFaceI];
label patchFaceI = newFaceI-newPatch.start();
if (patchFaceI >= 0 && patchFaceI < newPatch.size())
{
addedToNew[i] = patchFaceI;
}
}
bfld[newPatchI].rmap
(
calcPatchMap
(
oldPatch.start(),
oldPatch.size(),
meshMap.addedFaceMap(),
newPatch,
-1 // unmapped values
)
fldToAdd.boundaryField()[patchI],
addedToNew
);
const fvsPatchField<Type>& addedFld =
fldToAdd.boundaryField()[patchI];
fvsPatchField<Type>& newFld = bfld[newPatchI];
forAll(newFld, i)
{
label oldFaceI = newToAdded[i];
if (oldFaceI >= 0 && oldFaceI < addedFld.size())
{
newFld[i] = addedFld[oldFaceI];
}
}
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -475,7 +475,7 @@ Foam::scalarField Foam::edgeCollapser::calcTargetFaceSizes() const
{
scalarField targetFaceSizes(mesh_.nFaces(), -1);
const scalarField& cellVolumes = mesh_.cellVolumes();
const scalarField& V = mesh_.cellVolumes();
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
const labelList& cellOwner = mesh_.faceOwner();
@ -486,8 +486,8 @@ Foam::scalarField Foam::edgeCollapser::calcTargetFaceSizes() const
// Calculate face size from cell volumes for internal faces
for (label intFaceI = 0; intFaceI < mesh_.nInternalFaces(); ++intFaceI)
{
const scalar cellOwnerVol = cellVolumes[cellOwner[intFaceI]];
const scalar cellNeighbourVol = cellVolumes[cellNeighbour[intFaceI]];
const scalar cellOwnerVol = max(0.0, V[cellOwner[intFaceI]]);
const scalar cellNeighbourVol = max(0.0, V[cellNeighbour[intFaceI]]);
scalar targetFaceSizeA = Foam::pow(cellOwnerVol, 1.0/3.0);
scalar targetFaceSizeB = Foam::pow(cellNeighbourVol, 1.0/3.0);
@ -512,7 +512,7 @@ Foam::scalarField Foam::edgeCollapser::calcTargetFaceSizes() const
forAll(faceCells, facei)
{
neiCellVolumes[bFaceI++] = cellVolumes[faceCells[facei]];
neiCellVolumes[bFaceI++] = max(0.0, V[faceCells[facei]]);
}
}
else
@ -522,7 +522,7 @@ Foam::scalarField Foam::edgeCollapser::calcTargetFaceSizes() const
forAll(patch, patchFaceI)
{
const label extFaceI = patchFaceI + patch.start();
const scalar cellOwnerVol = cellVolumes[cellOwner[extFaceI]];
const scalar cellOwnerVol = max(0.0, V[cellOwner[extFaceI]]);
targetFaceSizes[extFaceI] = Foam::pow(cellOwnerVol, 1.0/3.0);
}
@ -542,7 +542,7 @@ Foam::scalarField Foam::edgeCollapser::calcTargetFaceSizes() const
forAll(patch, patchFaceI)
{
const label localFaceI = patchFaceI + patch.start();
const scalar cellOwnerVol = cellVolumes[cellOwner[localFaceI]];
const scalar cellOwnerVol = max(0.0, V[cellOwner[localFaceI]]);
const scalar cellNeighbourVol = neiCellVolumes[bFaceI++];
scalar targetFaceSizeA = Foam::pow(cellOwnerVol, 1.0/3.0);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -298,7 +298,7 @@ void Foam::LocalInteraction<CloudType>::info(Ostream& os)
this->getModelProperty("massStick", mps0);
// accumulate current data
labelList npe(nEscape_, 0);
labelList npe(nEscape_);
Pstream::listCombineGather(npe, plusEqOp<label>());
npe = npe + npe0;

View File

@ -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) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -36,17 +36,20 @@ Foam::tmp<Foam::Field<Type> > Foam::cyclicACMIPolyPatch::interpolate
{
const scalarField& w = srcMask_;
return
w*AMI().interpolateToSource(fldCouple)
+ (1.0 - w)*fldNonOverlap;
tmp<Field<Type> > interpField(AMI().interpolateToSource(fldCouple));
return w*interpField + (1.0 - w)*fldNonOverlap;
}
else
{
const scalarField& w = neighbPatch().tgtMask();
return
w*neighbPatch().AMI().interpolateToTarget(fldCouple)
+ (1.0 - w)*fldNonOverlap;
tmp<Field<Type> > interpField
(
neighbPatch().AMI().interpolateToTarget(fldCouple)
);
return w*interpField + (1.0 - w)*fldNonOverlap;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -152,8 +152,6 @@ public:
//- Find elements containing patchProbes
virtual void findElements(const fvMesh&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -28,6 +28,7 @@ License
#include "dictionary.H"
#include "Time.H"
#include "IOmanip.H"
#include "mapPolyMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -41,6 +42,11 @@ defineTypeNameAndDebug(probes, 0);
void Foam::probes::findElements(const fvMesh& mesh)
{
if (debug)
{
Info<< "probes: resetting sample locations" << endl;
}
elementList_.clear();
elementList_.setSize(size());
@ -267,7 +273,10 @@ Foam::probes::probes
pointField(0),
name_(name),
mesh_(refCast<const fvMesh>(obr)),
loadFromFiles_(loadFromFiles)
loadFromFiles_(loadFromFiles),
fieldSelection_(),
fixedLocations_(true),
interpolationScheme_("cell")
{
read(dict);
}
@ -323,10 +332,114 @@ void Foam::probes::read(const dictionary& dict)
dict.lookup("probeLocations") >> *this;
dict.lookup("fields") >> fieldSelection_;
// Re-determine all cell locations
dict.readIfPresent("fixedLocations", fixedLocations_);
if (dict.readIfPresent("interpolationScheme", interpolationScheme_))
{
if (!fixedLocations_ && interpolationScheme_ != "cell")
{
WarningIn("void Foam::probes::read(const dictionary&)")
<< "Only cell interpolation can be applied when "
<< "not using fixedLocations. InterpolationScheme "
<< "entry will be ignored";
}
}
// Initialise cells to sample from supplied locations
findElements(mesh_);
prepare();
}
void Foam::probes::updateMesh(const mapPolyMesh& mpm)
{
if (debug)
{
Info<< "probes: updateMesh" << endl;
}
if (fixedLocations_)
{
findElements(mesh_);
}
else
{
if (debug)
{
Info<< "probes: remapping sample locations" << endl;
}
// 1. Update cells
{
DynamicList<label> elems(elementList_.size());
const labelList& reverseMap = mpm.reverseCellMap();
forAll(elementList_, i)
{
label cellI = elementList_[i];
label newCellI = reverseMap[cellI];
if (newCellI == -1)
{
// cell removed
}
else if (newCellI < -1)
{
// cell merged
elems.append(-newCellI - 2);
}
else
{
// valid new cell
elems.append(newCellI);
}
}
elementList_.transfer(elems);
}
// 2. Update faces
{
DynamicList<label> elems(faceList_.size());
const labelList& reverseMap = mpm.reverseFaceMap();
forAll(faceList_, i)
{
label faceI = faceList_[i];
label newFaceI = reverseMap[faceI];
if (newFaceI == -1)
{
// face removed
}
else if (newFaceI < -1)
{
// face merged
elems.append(-newFaceI - 2);
}
else
{
// valid new face
elems.append(newFaceI);
}
}
faceList_.transfer(elems);
}
}
}
void Foam::probes::movePoints(const polyMesh&)
{
if (debug)
{
Info<< "probes: movePoints" << endl;
}
if (fixedLocations_)
{
findElements(mesh_);
}
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -84,7 +84,6 @@ protected:
:
DynamicList<word>(0)
{}
};
@ -106,6 +105,16 @@ protected:
//- Names of fields to probe
wordReList fieldSelection_;
//- Fixed locations, default = yes
// Note: set to false for moving mesh calations where locations
// should move with the mesh
bool fixedLocations_;
//- Interpolation scheme name
/// Note: only possible when fixedLocations_ is true
word interpolationScheme_;
// Calculated
//- Categorized scalar/vector/tensor vol fields
@ -143,13 +152,14 @@ protected:
//- Classify field types, returns the number of fields
label classifyFields();
//- Find cells containing probes
//- Find cells and faces containing probes
virtual void findElements(const fvMesh&);
//- Classify field type and Open/close file streams,
// returns number of fields
// returns number of fields to sample
label prepare();
private:
//- Sample and write a particular volume field
@ -253,12 +263,10 @@ public:
virtual void read(const dictionary&);
//- Update for changes of mesh
virtual void updateMesh(const mapPolyMesh&)
{}
virtual void updateMesh(const mapPolyMesh&);
//- Update for changes of mesh
virtual void movePoints(const polyMesh&)
{}
virtual void movePoints(const polyMesh&);
//- Update for changes of mesh due to readUpdate
virtual void readUpdate(const polyMesh::readUpdateState state)
@ -285,7 +293,6 @@ public:
(
const GeometricField<Type, fvsPatchField, surfaceMesh>&
) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,6 +27,7 @@ License
#include "volFields.H"
#include "surfaceFields.H"
#include "IOmanip.H"
#include "interpolation.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -226,6 +227,30 @@ Foam::probes::sample
Field<Type>& values = tValues();
if (fixedLocations_)
{
autoPtr<interpolation<Type> > interpolator
(
interpolation<Type>::New(interpolationScheme_, vField)
);
forAll(*this, probeI)
{
if (elementList_[probeI] >= 0)
{
const vector& position = operator[](probeI);
values[probeI] = interpolator().interpolate
(
position,
elementList_[probeI],
-1
);
}
}
}
else
{
forAll(*this, probeI)
{
if (elementList_[probeI] >= 0)
@ -233,6 +258,7 @@ Foam::probes::sample
values[probeI] = vField[elementList_[probeI]];
}
}
}
Pstream::listCombineGather(values, isNotEqOp<Type>());
Pstream::listCombineScatter(values);