ENH: Added new ceeateZeroDirectory utility

Uses a system/caseProperties file to select templates from
etc/caseDicts/createZeroDirectoryTemplates to enable high-level setup
of a case.
See
- etc/caseDicts/createZeroDirectoryTemplates
- tutorials/preProcessing/createZeroDirectory
This commit is contained in:
mattijs 2015-11-30 15:52:40 +00:00
parent 7cb12e208d
commit a67be71938
125 changed files with 46406 additions and 0 deletions

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,11 @@
EXE_INC = \
-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,198 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 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 "polyMesh.H"
#include "processorPolyPatch.H"
using namespace Foam;
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTemplateTypeNameAndDebug(IOPtrList<entry>, 0);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::IOPtrList<Foam::entry> Foam::boundaryInfo::readBoundaryDict
(
const Time& runTime,
const word& regionName
) const
{
Info<< " Reading mesh boundaries" << endl;
const_cast<word&>(IOPtrList<entry>::typeName) = polyBoundaryMesh::typeName;
IOPtrList<entry> boundaryPatchList
(
IOobject
(
"boundary",
runTime.findInstance(regionName/polyMesh::meshSubDir, "boundary"),
regionName/polyMesh::meshSubDir,
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
// remove zero-sized patches
PtrList<entry> boundaryPatchListNew;
forAll(boundaryPatchList, patchI)
{
const dictionary& dict = boundaryPatchList[patchI].dict();
const word pType = dict.lookup("type");
bool procPatch = pType == processorPolyPatch::typeName;
bool addPatch = true;
if (!procPatch)
{
label nFaces = readLabel(dict.lookup("nFaces"));
reduce(nFaces, sumOp<label>());
if (nFaces == 0)
{
addPatch = false;
}
}
if (addPatch)
{
boundaryPatchListNew.append(boundaryPatchList[patchI].clone());
}
}
boundaryPatchList.transfer(boundaryPatchListNew);
return boundaryPatchList;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::boundaryInfo::boundaryInfo(const Time& runTime, const word& regionName)
:
boundaryDict_(readBoundaryDict(runTime, regionName)),
names_(),
types_(),
constraint_(),
groups_(),
allGroupNames_()
{
names_.setSize(boundaryDict_.size());
types_.setSize(boundaryDict_.size());
constraint_.setSize(boundaryDict_.size(), false);
groups_.setSize(boundaryDict_.size());
forAll(boundaryDict_, patchI)
{
const dictionary& dict = boundaryDict_[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_;
}
void Foam::boundaryInfo::setType(const label patchI, const word& condition)
{
if (constraint_[patchI])
{
// not overriding constraint types
return;
}
if (wordRe(".*[mM]apped.*", wordRe::DETECT).match(types_[patchI]))
{
// ugly hack to avoid overriding mapped types
return;
}
if (condition == "wall")
{
types_[patchI] = condition;
}
else
{
types_[patchI] = "patch";
}
dictionary& patchDict = boundaryDict_[patchI].dict();
patchDict.add("type", types_[patchI], true);
}
void Foam::boundaryInfo::write() const
{
boundaryDict_.write();
}
// ************************************************************************* //

View File

@ -0,0 +1,124 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 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"
#include "IOPtrList.H"
#include "entry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class Time;
/*---------------------------------------------------------------------------*\
Class boundaryInfo Declaration
\*---------------------------------------------------------------------------*/
class boundaryInfo
{
// Private data
//- Boundary dictionary
IOPtrList<entry> boundaryDict_;
//- 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_;
// Private member functions
//- Read the boundary dict
IOPtrList<entry> readBoundaryDict
(
const Time& runTime,
const word& regionName
) const;
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;
//- Set the patch type based on the condition
void setType(const label patchI, const word& condition);
//- Write the boundary dictionary
void write() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,480 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 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)
{
fileName optFile(BCDir/regionType/patchTypes[i] + "Options");
IFstream is(optFile);
if (is.good())
{
IOdictionary dict
(
IOobject
(
optFile,
runTime,
IOobject::MUST_READ
)
);
regionOptions.add(patchTypes[i], dictionary(dict));
}
}
// add solver type boundary options
forAll(patchTypes, i)
{
// options are optional - however, if file exists, assume that it
// is to be read
fileName optFile
(
BCDir/regionType/solverType/patchTypes[i] + "Options"
);
IFstream is(optFile);
if (is.good())
{
IOdictionary dict
(
IOobject
(
optFile,
runTime,
IOobject::MUST_READ
)
);
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) 2015 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,271 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 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
{
const wordList& patchGroups = boundaryInfo_.groups()[patchI];
// assign condition according to last condition applied, wins
forAllReverse(conditionNames_, conditionI)
{
const wordReList& patchNames = patchNames_[conditionI];
forAll(patchNames, nameI)
{
if (patchNames[nameI] == patchName)
{
// check for explicit match
return conditionI;
}
else if (patchNames[nameI].match(patchName))
{
// check wildcards
return conditionI;
}
else
{
// check for group match
forAll(patchGroups, groupI)
{
if (patchNames[nameI] == patchGroups[groupI])
{
return conditionI;
}
}
}
}
}
FatalErrorIn
(
"Foam::label Foam::caseInfo::findPatchConditionID"
"("
"const label, "
"const word&"
") const"
)
<< "Boundary patch " << patchName << " not defined"
<< exit(FatalError);
return -1;
}
void Foam::caseInfo::updateGeometricBoundaryField()
{
forAll(boundaryInfo_.names(), i)
{
const word& patchName = boundaryInfo_.names()[i];
if (!boundaryInfo_.constraint()[i])
{
// condition ID to apply to mesh boundary patch name
const label conditionI = findPatchConditionID(i, patchName);
const word& category = patchCategories_[conditionI];
boundaryInfo_.setType(i, category);
}
}
boundaryInfo_.write();
}
// * * * * * * * * * * * * * * * * 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];
}
updateGeometricBoundaryField();
}
// * * * * * * * * * * * * * * * 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 patch name
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,141 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 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_;
// Private member functions
//- Update the polyMesh boundary based on the patch categories
void updateGeometricBoundaryField();
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,311 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 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.
\verbatim
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 "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()/runTime.timeName()/regionName);
forAll(fieldNames, i)
{
const_cast<word&>(IOdictionary::typeName) =
getClassType(fieldTypes[i]);
dictionary field;
fileName regionPath = "/";
if (regionName != word::null)
{
regionPath += regionName + '/';
}
field.add
(
"#include",
"${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);
// Expand all of the dictionary redirections and remove unnecessary
// entries
OStringStream os;
os << field;
entry::disableFunctionEntries = 0;
dictionary field2(IStringStream(os.str())());
entry::disableFunctionEntries = 1;
field2.remove("#include");
field2.remove("initialConditions");
field2.remove("boundaryConditions");
// Construct and write field dictionary
IOdictionary fieldOut
(
IOobject
(
fieldNames[i],
"0",
regionName,
runTime,
IOobject::NO_READ
),
field2
);
fieldOut.regIOobject::writeObject
(
IOstream::ASCII,
IOstream::currentVersion,
IOstream::UNCOMPRESSED
);
}
}
// Main program:
int main(int argc, char *argv[])
{
Foam::argList::addOption
(
"templateDir",
"file",
"read case set-up templates from specified location"
);
#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_DIR}/etc/caseDicts/createZeroDirectoryTemplates"
);
if (args.optionFound("templateDir"))
{
baseDir = args["templateDir"];
}
baseDir.expand();
baseDir.toAbsolute();
if (!isDir(baseDir))
{
FatalErrorIn(args.executable())
<< "templateDir " << baseDir
<< " should point to the folder containing the "
<< "case set-up templates" << exit(FatalError);
}
// Keep variable substitutions - delay until after creation of controlDict
// to allow #include files to be processed
entry::disableFunctionEntries = 1;
// Read the solver
const word& solverName = controlDict.lookup("application");
// Generate solver template
const solverTemplate solver(baseDir, 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,438 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 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);
if (turbulenceType == "turbulenceModel")
{
IOdictionary turbulenceProperties
(
IOobject
(
"turbulenceProperties",
runTime.constant(),
regionName,
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
turbulenceProperties.lookup("simulationType") >> simulationType;
if (simulationType == "laminar")
{
// Leave turbulenceModel as laminar
}
else if (simulationType == "RAS")
{
turbulenceProperties.subDict(simulationType).lookup("RASModel")
>> turbulenceModel;
}
else if (simulationType == "LES")
{
turbulenceProperties.subDict(simulationType).lookup("LESModel")
>> turbulenceModel;
}
else
{
FatalErrorIn
(
"Foam::dictionary "
"Foam::solverTemplate::readFluidFieldTemplates"
"("
"const word&, "
"const fileName&, "
"const dictionary&, "
"const Time&"
") const"
) << "Unhandled turbulence model option " << simulationType
<< ". Valid options are laminar, RAS, LES"
<< exit(FatalError);
}
}
else
{
FatalErrorIn
(
"Foam::dictionary Foam::solverTemplate::readFluidFieldTemplates"
"("
"const word&, "
"const fileName&, "
"const dictionary&, "
"const Time&"
") const"
) << "Unhandled turbulence model option " << simulationType
<< ". Valid options are turbulenceModel"
<< exit(FatalError);
}
}
Info<< " Selecting " << turbulenceType << ": " << turbulenceModel
<< endl;
IOdictionary turbModelDict
(
IOobject
(
fileName(turbModelDir/turbulenceModel),
runTime,
IOobject::MUST_READ
)
);
// Merge common fluid fields
fieldTemplates.merge(turbModelDict.subDict("fluidFields"));
// Merge specific compressible or incompressible fluid fields
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 fileName& baseDir,
const Time& runTime,
const word& solverName
)
:
solverType_(stUnknown),
multiRegion_(false),
regionTypes_(),
fieldNames_(),
fieldTypes_(),
fieldDimensions_()
{
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,187 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 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 fileName& baseDir,
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: dev |
| \\ / 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,33 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / 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};
}
alphat
{
type calculated;
value ${:VALUE.alphat};
}
}
// ************************************************************************* //

View File

@ -0,0 +1,78 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / 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 ${:VALUE.U};
}
p
{
type calculated;
value ${:VALUE.p};
}
p_rgh
{
type fixedValue;
value ${:VALUE.p_rgh};
}
}
fixedVelocity
{
U
{
type fixedValue;
value ${:VALUE.U};
}
p
{
type calculated;
value ${:VALUE.p};
}
p_rgh
{
type fixedFluxPressure;
value ${:VALUE.p_rgh};
}
}
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,39 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / 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};
}
alphat
{
type calculated;
value ${:VALUE.alphat};
}
}
// ************************************************************************* //

View File

@ -0,0 +1,67 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object outletOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
returnFlow
{
default
{
p
{
type calculated;
value ${:VALUE.p};
}
p_rgh
{
type fixedValue;
value ${:VALUE.p_rgh};
}
}
wall
{
p
{
type calculated;
value ${:VALUE.p};
}
p_rgh
{
type fixedValue;
value ${:VALUE.p_rgh};
}
}
atmosphere
{
p
{
type calculated;
value ${:VALUE.p};
}
p_rgh
{
type totalPressure;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
p0 ${:VALUE.p_rgh};
value ${:VALUE.p_rgh};
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / 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};
}
alphat
{
type zeroGradient;
}
OPTIONS (heatTransfer);
}
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object wallOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
wallFunction
{
}
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,33 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / 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};
}
alphat
{
type calculated;
value ${:VALUE.alphat};
}
}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / 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 ${:VALUE.U};
}
p
{
type totalPressure;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
p0 ${:VALUE.p};
value ${:VALUE.p};
}
}
flowRate
{
U
{
type flowRateInletVelocity;
massFlowRate ${:VALUE.massFlowRate};
value ${:VALUE.U};
}
p
{
type zeroGradient;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,33 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / 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};
}
alphat
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,37 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object outlet;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
returnFlow
{
atmosphere
{
p
{
type totalPressure;
U U;
phi phi;
rho rho;
psi none;
gamma 1;
p0 ${:VALUE.p};
value ${:VALUE.p};
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,35 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / 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
{
alphat
{
type zeroGradient;
}
OPTIONS (heatTransfer);
}
// ************************************************************************* //

View File

@ -0,0 +1,70 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object wallOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
wallFunction
{
highReynolds
{
alphat
{
type compressible::alphatWallFunction;
value ${:VALUE.alphat};
}
}
lowReynolds
{
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,23 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object inlet;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
subSonic
{
}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / 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 ${:VALUE.U};
}
p
{
type totalPressure;
U U;
phi phi;
rho none;
psi none;
gamma 1;
p0 ${:VALUE.p};
value ${:VALUE.p};
}
}
flowRate
{
U
{
type flowRateInletVelocity;
volumeFlowRate ${:VALUE.volumeFlowRate};
value ${:VALUE.U};
}
p
{
type zeroGradient;
}
}
}
// ************************************************************************* //

View File

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

View File

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

View File

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

View File

@ -0,0 +1,45 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object inlet;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
subSonic
{
nut
{
type calculated;
value ${:VALUE.nut};
}
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: dev |
| \\ / 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 ${:VALUE.U};
}
p
{
type fixedValue;
value ${:VALUE.p};
}
}
fixedVelocity
{
U
{
type fixedValue;
value ${:VALUE.U};
}
p
{
type zeroGradient;
}
}
}
// ************************************************************************* //

View File

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

View File

@ -0,0 +1,117 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object outletOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
returnFlow
{
default
{
p
{
type fixedValue;
value ${:VALUE.p};
}
U
{
type pressureInletOutletVelocity;
value ${:VALUE.U};
}
k
{
type inletOutlet;
inletValue ${:VALUE.k};
value ${:VALUE.k};
}
epsilon
{
type inletOutlet;
inletValue ${:VALUE.epsilon};
value ${:VALUE.epsilon};
}
omega
{
type inletOutlet;
inletValue ${:VALUE.omega};
value ${:VALUE.omega};
}
}
wall
{
p
{
type fixedValue;
value ${:VALUE.p};
}
U
{
type inletOutlet;
inletValue uniform (0 0 0);
value ${:VALUE.U};
}
k
{
type zeroGradient;
}
epsilon
{
type zeroGradient;
}
omega
{
type zeroGradient;
}
}
atmosphere
{
p
{
type totalPressure;
U U;
phi phi;
rho none;
psi none;
gamma 1;
p0 ${:VALUE.p};
value ${:VALUE.p};
}
U
{
type pressureInletOutletVelocity;
value ${:VALUE.U};
}
k
{
type inletOutlet;
inletValue ${:VALUE.k};
value ${:VALUE.k};
}
epsilon
{
type inletOutlet;
inletValue ${:VALUE.epsilon};
value ${:VALUE.epsilon};
}
omega
{
type inletOutlet;
inletValue ${:VALUE.omega};
value ${:VALUE.omega};
}
}
}
// ************************************************************************* //

View File

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

View File

@ -0,0 +1,98 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / 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};
}
k
{
type kqRWallFunction;
value ${:VALUE.k};
}
epsilon
{
type epsilonWallFunction;
value ${:VALUE.epsilon};
}
omega
{
type omegaWallFunction;
value ${:VALUE.omega};
}
}
lowReynolds
{
nut
{
type fixedValue;
value uniform 0;
}
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};
}
}
movingMesh
{
U
{
type movingWallVelocity;
value ${:VALUE.U};
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,30 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / 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.p};
}
OPTIONS (heatTransfer);
}
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object wallOptions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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,52 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object kEpsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
fluidFields
{
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];
}
}
incompressibleFields
{}
compressibleFields
{
alphat
{
type scalar;
dimensions [1 -1 -1 0 0];
}
}
// ************************************************************************* //

View File

@ -0,0 +1,52 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object kOmega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
fluidFields
{
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];
}
}
incompressibleFields
{}
compressibleFields
{
alphat
{
type scalar;
dimensions [1 -1 -1 0 0];
}
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "templates";
object kOmegaSST;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
fluidFields
{
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];
}
}
incompressibleFields
{}
compressibleFields
{
alphat
{
type scalar;
dimensions [1 -1 -1 0 0];
}
}
// ************************************************************************* //

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / 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 turbulenceModel;
}
fluidFields
{
U
{
type vector;
dimensions [0 1 -1 0 0];
}
p
{
type scalar;
dimensions [0 2 -2 0 0];
}
}
// ************************************************************************* //

View File

@ -0,0 +1,8 @@
#!/bin/sh
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
rm -rf 0 > /dev/null 2>&1
cleanCase

View File

@ -0,0 +1,9 @@
#!/bin/sh
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication blockMesh
runApplication createZeroDirectory
runApplication $(getApplication)

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
nu nu [ 0 2 -1 0 0 0 0 ] 0.01;
// ************************************************************************* //

View File

@ -0,0 +1,75 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 0.1;
vertices
(
(0 0 0)
(1 0 0)
(1 1 0)
(0 1 0)
(0 0 0.1)
(1 0 0.1)
(1 1 0.1)
(0 1 0.1)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
movingWall
{
type wall;
faces
(
(3 7 6 2)
);
}
fixedWalls
{
type wall;
faces
(
(0 4 7 3)
(2 6 5 1)
(1 5 4 0)
);
}
frontAndBack
{
type empty;
faces
(
(0 3 2 1)
(4 5 6 7)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,56 @@
/*--------------------------------*- 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 "constant";
object caseProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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;
};
}
}
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application icoFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
//endTime 0.5;
endTime 0.005;
deltaT 0.005;
writeControl timeStep;
writeInterval 20;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss linear;
}
laplacianSchemes
{
default none;
laplacian(nu,U) Gauss linear orthogonal;
laplacian((1|A(U)),p) Gauss linear orthogonal;
}
interpolationSchemes
{
default linear;
interpolate(HbyA) linear;
}
snGradSchemes
{
default orthogonal;
}
fluxRequired
{
default no;
p ;
}
// ************************************************************************* //

View File

@ -0,0 +1,46 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver PCG;
preconditioner DIC;
tolerance 1e-06;
relTol 0;
}
U
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
}
}
PISO
{
nCorrectors 2;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,13 @@
#!/bin/sh
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
# remove surface and features
\rm -f constant/triSurface/motorBike.obj.gz > /dev/null 2>&1
\rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1
\rm -f constant/triSurface/motorBike.eMesh > /dev/null 2>&1
rm -rf 0 > /dev/null 2>&1
cleanCase

View File

@ -0,0 +1,25 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# copy motorbike surface from resources folder
cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/
runApplication surfaceFeatureExtract
runApplication blockMesh
runApplication decomposePar
runParallel snappyHexMesh 6 -overwrite
runParallel createZeroDirectory 6
runParallel patchSummary 6
runParallel potentialFoam 6 -noFunctionObjects
runParallel $(getApplication) 6
runApplication reconstructParMesh -constant
runApplication reconstructPar -latestTime
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,21 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
transportModel Newtonian;
nu nu [0 2 -1 0 0 0 0] 1.5e-05;
// ************************************************************************* //

View File

@ -0,0 +1,4 @@
Folder to house tri-surfaces
The Allrun script copies the surface from the $FOAM_TUTORIALS/resources/geometry
folder

View File

@ -0,0 +1,28 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RAS;
RAS
{
RASModel kOmegaSST;
turbulence on;
printCoeffs on;
}
// ************************************************************************* //

View File

@ -0,0 +1,86 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(-5 -4 0)
(15 -4 0)
(15 4 0)
(-5 4 0)
(-5 -4 8)
(15 -4 8)
(15 4 8)
(-5 4 8)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (20 8 8) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
frontAndBack
{
type patch;
faces
(
(3 7 6 2)
(1 5 4 0)
);
}
inlet
{
type patch;
faces
(
(0 4 7 3)
);
}
outlet
{
type patch;
faces
(
(2 6 5 1)
);
}
lowerWall
{
type wall;
faces
(
(0 3 2 1)
);
}
upperWall
{
type patch;
faces
(
(4 5 6 7)
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,115 @@
/*--------------------------------*- 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 "constant";
object caseProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
initialConditions
{
U uniform (20 0 0);
p uniform 0;
k uniform 0.24;
omega uniform 1.78;
nut uniform 0;
}
boundaryConditions
{
motorbike
{
category wall;
type noSlip;
patches (motorBikeGroup);
options
{
wallFunction highReynolds;
motion stationary;
}
values
{
$:initialConditions;
}
}
inlet
{
category inlet;
type subSonic;
patches (inlet);
options
{
flowSpecification fixedVelocity;
}
values
{
$:initialConditions;
}
}
lowerWall
{
category wall;
type noSlip;
patches (lowerWall);
options
{
wallFunction highReynolds;
motion stationary;
}
values
{
$:initialConditions;
}
}
outlet
{
category outlet;
type subSonic;
patches (outlet);
options
{
returnFlow default;
}
values
{
$:initialConditions;
}
}
upperWall
{
category wall;
type slip;
patches (upperWall);
values
{
$:initialConditions;
}
}
frontAndBack
{
category wall;
type slip;
patches (frontAndBack);
values
{
$:initialConditions;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,51 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// For patchSummary to find the boundary conditions
libs ("libincompressibleTurbulenceModels.so");
application simpleFoam;
startFrom startTime; // latestTime;
startTime 0;
stopAt writeNow; //endTime;
endTime 500;
deltaT 1;
writeControl timeStep;
writeInterval 100;
purgeWrite 0;
writeFormat binary;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
// ************************************************************************* //

View File

@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 6;
method hierarchical;
// method ptscotch;
simpleCoeffs
{
n (4 1 1);
delta 0.001;
}
hierarchicalCoeffs
{
n (3 2 1);
delta 0.001;
order xyz;
}
manualCoeffs
{
dataFile "cellDecomposition";
}
// ************************************************************************* //

View File

@ -0,0 +1,58 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
grad(U) cellLimited Gauss linear 1;
}
divSchemes
{
default none;
div(phi,U) bounded Gauss linearUpwindV grad(U);
div(phi,k) bounded Gauss upwind;
div(phi,omega) bounded Gauss upwind;
div((nuEff*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
wallDist
{
method meshWave;
}
// ************************************************************************* //

View File

@ -0,0 +1,92 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver GAMG;
tolerance 1e-7;
relTol 0.01;
smoother GaussSeidel;
nPreSweeps 0;
nPostSweeps 2;
cacheAgglomeration on;
agglomerator faceAreaPair;
nCellsInCoarsestLevel 10;
mergeLevels 1;
}
Phi
{
$p;
}
U
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-8;
relTol 0.1;
nSweeps 1;
}
k
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-8;
relTol 0.1;
nSweeps 1;
}
omega
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-8;
relTol 0.1;
nSweeps 1;
}
}
SIMPLE
{
nNonOrthogonalCorrectors 0;
consistent yes;
}
potentialFlow
{
nNonOrthogonalCorrectors 10;
}
relaxationFactors
{
equations
{
U 0.9;
k 0.7;
omega 0.7;
}
}
cache
{
grad(U);
}
// ************************************************************************* //

View File

@ -0,0 +1,24 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object meshQualityDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Include defaults parameters from master dictionary
#includeEtc "caseDicts/meshQualityDict"
//- minFaceWeight (0 -> 0.5)
minFaceWeight 0.02;
// ************************************************************************* //

View File

@ -0,0 +1,317 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Which of the steps to run
castellatedMesh true;
snap true;
addLayers true;
// Geometry. Definition of all surfaces. All surfaces are of class
// searchableSurface.
// Surfaces are used
// - to specify refinement for any mesh cell intersecting it
// - to specify refinement for any mesh cell inside/outside/near
// - to 'snap' the mesh boundary to the surface
geometry
{
motorBike.obj
{
type triSurfaceMesh;
name motorBike;
}
refinementBox
{
type searchableBox;
min (-1.0 -0.7 0.0);
max ( 8.0 0.7 2.5);
}
};
// Settings for the castellatedMesh generation.
castellatedMeshControls
{
// Refinement parameters
// ~~~~~~~~~~~~~~~~~~~~~
// If local number of cells is >= maxLocalCells on any processor
// switches from from refinement followed by balancing
// (current method) to (weighted) balancing before refinement.
maxLocalCells 100000;
// Overall cell limit (approximately). Refinement will stop immediately
// upon reaching this number so a refinement level might not complete.
// Note that this is the number of cells before removing the part which
// is not 'visible' from the keepPoint. The final number of cells might
// actually be a lot less.
maxGlobalCells 2000000;
// The surface refinement loop might spend lots of iterations refining just a
// few cells. This setting will cause refinement to stop if <= minimumRefine
// are selected for refinement. Note: it will at least do one iteration
// (unless the number of cells to refine is 0)
minRefinementCells 10;
// Allow a certain level of imbalance during refining
// (since balancing is quite expensive)
// Expressed as fraction of perfect balance (= overall number of cells /
// nProcs). 0=balance always.
maxLoadUnbalance 0.10;
// Number of buffer layers between different levels.
// 1 means normal 2:1 refinement restriction, larger means slower
// refinement.
nCellsBetweenLevels 3;
// Explicit feature edge refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Specifies a level for any cell intersected by its edges.
// This is a featureEdgeMesh, read from constant/triSurface for now.
features
(
{
file "motorBike.eMesh";
level 6;
}
);
// Surface based refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~
// Specifies two levels for every surface. The first is the minimum level,
// every cell intersecting a surface gets refined up to the minimum level.
// The second level is the maximum level. Cells that 'see' multiple
// intersections where the intersections make an
// angle > resolveFeatureAngle get refined up to the maximum level.
refinementSurfaces
{
motorBike
{
// Surface-wise min and max refinement level
level (5 6);
// Optional specification of patch type (default is wall). No
// constraint types (cyclic, symmetry) etc. are allowed.
patchInfo
{
type wall;
inGroups (motorBikeGroup);
}
}
}
// Resolve sharp angles
resolveFeatureAngle 30;
// Region-wise refinement
// ~~~~~~~~~~~~~~~~~~~~~~
// Specifies refinement level for cells in relation to a surface. One of
// three modes
// - distance. 'levels' specifies per distance to the surface the
// wanted refinement level. The distances need to be specified in
// descending order.
// - inside. 'levels' is only one entry and only the level is used. All
// cells inside the surface get refined up to the level. The surface
// needs to be closed for this to be possible.
// - outside. Same but cells outside.
refinementRegions
{
refinementBox
{
mode inside;
levels ((1E15 4));
}
}
// Mesh selection
// ~~~~~~~~~~~~~~
// After refinement patches get added for all refinementSurfaces and
// all cells intersecting the surfaces get put into these patches. The
// section reachable from the locationInMesh is kept.
// NOTE: This point should never be on a face, always inside a cell, even
// after refinement.
locationInMesh (3.0001 3.0001 0.43);
// Whether any faceZones (as specified in the refinementSurfaces)
// are only on the boundary of corresponding cellZones or also allow
// free-standing zone faces. Not used if there are no faceZones.
allowFreeStandingZoneFaces true;
}
// Settings for the snapping.
snapControls
{
//- Number of patch smoothing iterations before finding correspondence
// to surface
nSmoothPatch 3;
//- Relative distance for points to be attracted by surface feature point
// or edge. True distance is this factor times local
// maximum edge length.
tolerance 2.0;
//- Number of mesh displacement relaxation iterations.
nSolveIter 30;
//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
// Feature snapping
//- Number of feature edge snapping iterations.
// Leave out altogether to disable.
nFeatureSnapIter 10;
//- Detect (geometric only) features by sampling the surface
// (default=false).
implicitFeatureSnap false;
//- Use castellatedMeshControls::features (default = true)
explicitFeatureSnap true;
//- Detect points on multiple surfaces (only for explicitFeatureSnap)
multiRegionFeatureSnap false;
}
// Settings for the layer addition.
addLayersControls
{
// Are the thickness parameters below relative to the undistorted
// size of the refined cell outside layer (true) or absolute sizes (false).
relativeSizes true;
// Per final patch (so not geometry!) the layer information
layers
{
"(lowerWall|motorBike).*"
{
nSurfaceLayers 1;
}
}
// Expansion factor for layer mesh
expansionRatio 1.0;
// Wanted thickness of final added cell layer. If multiple layers
// is the thickness of the layer furthest away from the wall.
// Relative to undistorted size of cell outside layer.
// See relativeSizes parameter.
finalLayerThickness 0.3;
// Minimum thickness of cell layer. If for any reason layer
// cannot be above minThickness do not add layer.
// Relative to undistorted size of cell outside layer.
minThickness 0.1;
// If points get not extruded do nGrow layers of connected faces that are
// also not grown. This helps convergence of the layer addition process
// close to features.
// Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x)
nGrow 0;
// Advanced settings
// When not to extrude surface. 0 is flat surface, 90 is when two faces
// are perpendicular
featureAngle 60;
// At non-patched sides allow mesh to slip if extrusion direction makes
// angle larger than slipFeatureAngle.
slipFeatureAngle 30;
// Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 3;
// Number of smoothing iterations of surface normals
nSmoothSurfaceNormals 1;
// Number of smoothing iterations of interior mesh movement direction
nSmoothNormals 3;
// Smooth layer thickness over surface patches
nSmoothThickness 10;
// Stop layer growth on highly warped cells
maxFaceThicknessRatio 0.5;
// Reduce layer growth where ratio thickness to medial
// distance is large
maxThicknessToMedialRatio 0.3;
// Angle used to pick up medial axis points
// Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x.
minMedianAxisAngle 90;
// Create buffer region for new layer terminations
nBufferCellsNoExtrude 0;
// Overall max number of layer addition iterations. The mesher will exit
// if it reaches this number of iterations; possibly with an illegal
// mesh.
nLayerIter 50;
}
// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
#include "meshQualityDict"
// Advanced
//- Number of error distribution iterations
nSmoothScale 4;
//- Amount to scale back displacement at error points
errorReduction 0.75;
}
// Advanced
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1e-6;
// ************************************************************************* //

View File

@ -0,0 +1,48 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object surfaceFeatureExtractDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
motorBike.obj
{
// How to obtain raw features (extractFromFile || extractFromSurface)
extractionMethod extractFromSurface;
extractFromSurfaceCoeffs
{
// Mark edges whose adjacent surface normals are at an angle less
// than includedAngle as features
// - 0 : selects no edges
// - 180: selects all edges
includedAngle 150;
}
subsetFeatures
{
// Keep nonManifold edges (edges with >2 connected faces)
nonManifoldEdges no;
// Keep open edges (edges with 1 connected face)
openEdges yes;
}
// Write options
// Write features to obj format for postprocessing
writeObj yes;
}
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1
rm -f constant/triSurface/*.eMesh > /dev/null 2>&1
rm -f constant/polyMesh/boundary
cleanCase
rm -rf VTK
rm -rf constant/cellToRegion constant/polyMesh/sets
rm -rf 0
rm -rf constant/bottomAir/polyMesh
rm -rf constant/topAir/polyMesh
rm -rf constant/heater/polyMesh
rm -rf constant/leftSolid/polyMesh
rm -rf constant/rightSolid/polyMesh
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,39 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
rm -rf constant/polyMesh/sets
runApplication blockMesh
runApplication surfaceFeatureExtract
runApplication snappyHexMesh -overwrite
runApplication splitMeshRegions -cellZones -overwrite
for i in bottomAir topAir heater leftSolid rightSolid
do
runApplication changeDictionary -region $i
mv log.changeDictionary log.changeDictionary.$i 2>&1
done
runApplication decomposePar -allRegions
runParallel createZeroDirectory 4
#-- Run in parallel
runParallel $(getApplication) 4
# Reconstruct
runApplication reconstructPar -allRegions
echo
echo "creating files for paraview post-processing"
echo
paraFoam -touchAll
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value (0 -9.81 0);
// ************************************************************************* //

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object radiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant/bottomAir";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type heRhoThermo;
mixture pureMixture;
transport const;
thermo hConst;
equationOfState perfectGas;
specie specie;
energy sensibleEnthalpy;
}
mixture
{
specie
{
nMoles 1;
molWeight 28.9;
}
thermodynamics
{
Cp 1000;
Hf 0;
}
transport
{
mu 1.8e-05;
Pr 0.7;
}
}
// ************************************************************************* //

View File

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

View File

@ -0,0 +1,34 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object radiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiationModel opaqueSolid;
absorptionEmissionModel constantAbsorptionEmission;
constantAbsorptionEmissionCoeffs
{
absorptivity absorptivity [ 0 -1 0 0 0 0 0 ] 0.0; //opaque
emissivity emissivity [ 0 -1 0 0 0 0 0 ] 0.1;
E E [ 1 -1 -3 0 0 0 0 ] 0;
}
scatterModel none;
transmissivityModel none;
// ************************************************************************* //

View File

@ -0,0 +1,53 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type heSolidThermo;
mixture pureMixture;
transport constIso;
thermo hConst;
equationOfState rhoConst;
specie specie;
energy sensibleEnthalpy;
}
mixture
{
specie
{
nMoles 1;
molWeight 12;
}
transport
{
kappa 80;
}
thermodynamics
{
Hf 0;
Cp 450;
}
equationOfState
{
rho 8000;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,34 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object radiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiationModel opaqueSolid;
absorptionEmissionModel constantAbsorptionEmission;
constantAbsorptionEmissionCoeffs
{
absorptivity absorptivity [ 0 -1 0 0 0 0 0 ] 0.0; //opaque
emissivity emissivity [ 0 -1 0 0 0 0 0 ] 0.1;
E E [ 1 -1 -3 0 0 0 0 ] 0;
}
scatterModel none;
transmissivityModel none;
// ************************************************************************* //

View File

@ -0,0 +1 @@
../heater/thermophysicalProperties

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object regionProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
regions
(
fluid (bottomAir topAir)
solid (heater leftSolid rightSolid)
);
// ************************************************************************* //

View File

@ -0,0 +1,34 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object radiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiationModel opaqueSolid;
absorptionEmissionModel constantAbsorptionEmission;
constantAbsorptionEmissionCoeffs
{
absorptivity absorptivity [ 0 -1 0 0 0 0 0 ] 0.0; //opaque
emissivity emissivity [ 0 -1 0 0 0 0 0 ] 0.1;
E E [ 1 -1 -3 0 0 0 0 ] 0;
}
scatterModel none;
transmissivityModel none;
// ************************************************************************* //

View File

@ -0,0 +1 @@
../heater/thermophysicalProperties

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class uniformDimensionedVectorField;
object g;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -2 0 0 0 0];
value (0 -9.81 0);
// ************************************************************************* //

View File

@ -0,0 +1,22 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object radiationProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
radiation off;
radiationModel none;
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant/topAir";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type heRhoThermo;
mixture pureMixture;
transport const;
thermo hConst;
equationOfState perfectGas;
specie specie;
energy sensibleEnthalpy;
}
mixture
{
specie
{
nMoles 1;
molWeight 28.9;
}
thermodynamics
{
Cp 1000;
Hf 0;
}
transport
{
mu 1.8e-05;
Pr 0.7;
}
}
// ************************************************************************* //

View File

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

View File

@ -0,0 +1,3 @@
fvSolution is used for outer correctors specification.
fvSchemes is only so that pre-processing activities can proceed

View File

@ -0,0 +1,96 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(-0.1 -0.04 -0.05)
( 0.1 -0.04 -0.05)
( 0.1 0.04 -0.05)
(-0.1 0.04 -0.05)
(-0.1 -0.04 0.05)
( 0.1 -0.04 0.05)
( 0.1 0.04 0.05)
(-0.1 0.04 0.05)
);
blocks
(
hex (0 1 2 3 4 5 6 7) (30 10 10) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
maxY
{
type wall;
faces
(
(3 7 6 2)
);
}
minX
{
type patch;
faces
(
(0 4 7 3)
);
}
maxX
{
type patch;
faces
(
(2 6 5 1)
);
}
minY
{
type wall;
faces
(
(1 5 4 0)
);
}
minZ
{
type wall;
faces
(
(0 3 2 1)
);
}
maxZ
{
type wall;
faces
(
(4 5 6 7)
);
}
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,66 @@
/*--------------------------------*- 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 "constant";
object caseProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
initialConditions
{
alphat uniform 0;
U uniform (0.01 0 0);
p uniform 100000;
p_rgh uniform 100000;
rho uniform 8000;
T uniform 300;
}
boundaryConditions
{
thermalWalls
{
category wall;
type noSlip;
patches (minX maxX minY minZ maxZ);
options
{
wallFunction highReynolds;
motion stationary;
heatTransfer adiabatic;
}
values
{
$:initialConditions;
}
}
thermalCoupledWalls
{
category wall;
type noSlip;
patches (".*_to_.*");
options
{
wallFunction highReynolds;
motion stationary;
heatTransfer thermalCoupled;
}
values
{
$:initialConditions;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,32 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object changeDictionaryDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dictionaryReplacement
{
boundary
{
minX
{
type wall;
}
maxX
{
type wall;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,72 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
note "mesh decomposition control dictionary";
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 4;
//- Keep owner and neighbour on same processor for faces in zones:
// preserveFaceZones (heater solid1 solid3);
method scotch;
// method hierarchical;
// method simple;
// method manual;
simpleCoeffs
{
n (2 2 1);
delta 0.001;
}
hierarchicalCoeffs
{
n (2 2 1);
delta 0.001;
order xyz;
}
scotchCoeffs
{
//processorWeights
//(
// 1
// 1
// 1
// 1
//);
//writeGraph true;
//strategy "b";
}
manualCoeffs
{
dataFile "decompositionData";
}
//// Is the case distributed
//distributed yes;
//// Per slave (so nProcs-1 entries) the directory above the case.
//roots
//(
// "/tmp"
// "/tmp"
//);
// ************************************************************************* //

View File

@ -0,0 +1,61 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss upwind;
div(phi,K) Gauss linear;
div(phi,h) Gauss upwind;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,R) Gauss upwind;
div(R) Gauss linear;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear limited corrected 0.333;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default limited corrected 0.333;
}
fluxRequired
{
default no;
p_rgh;
}
// ************************************************************************* //

View File

@ -0,0 +1,85 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"(rho|rhoFinal)"
{
solver PCG
preconditioner DIC;
tolerance 1e-7;
relTol 0;
}
p_rgh
{
solver GAMG;
tolerance 1e-7;
relTol 0.01;
smoother GaussSeidel;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
maxIter 100;
}
p_rghFinal
{
$p_rgh;
tolerance 1e-7;
relTol 0;
}
"(U|h|k|epsilon|R)"
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-7;
relTol 0.1;
}
"(U|h|k|epsilon|R)Final"
{
$U;
tolerance 1e-07;
relTol 0;
}
}
PIMPLE
{
momentumPredictor on;
nCorrectors 2;
nNonOrthogonalCorrectors 0;
}
relaxationFactors
{
fields
{
}
equations
{
"h.*" 1;
"U.*" 1;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,54 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.2 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application chtMultiRegionFoam;
startFrom latestTime;
startTime 0.001;
stopAt writeNow; //endTime;
endTime 75;
deltaT 0.001;
writeControl adjustableRunTime;
writeInterval 15;
purgeWrite 0;
writeFormat ascii;
writePrecision 7;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
maxCo 0.3;
maxDi 10.0;
adjustTimeStep yes;
// ************************************************************************* //

Some files were not shown because too many files have changed in this diff Show More