Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2012-09-27 15:21:32 +01:00
359 changed files with 10715 additions and 2207 deletions

View File

@ -0,0 +1,8 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
wmake libso helpTypes
wmake
# ----------------------------------------------------------------- end-of-file

View File

@ -0,0 +1,3 @@
foamHelp.C
EXE = $(FOAM_APPBIN)/foamHelp

View File

@ -0,0 +1,15 @@
EXE_INC = \
-IhelpTypes/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lhelpTypes \
-lfiniteVolume \
-lincompressibleTurbulenceModel \
-lcompressibleTurbulenceModel \
-lincompressibleRASModels \
-lcompressibleRASModels \
-lincompressibleLESModels \
-lcompressibleLESModels \
-lradiationModels \
-lfluidThermophysicalModels

View File

@ -21,50 +21,47 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
foamHelp
Description
Top level wrapper utility around foam help utilities
\*---------------------------------------------------------------------------*/
#include "basicThermo.H"
#include "fvCFD.H"
#include "helpType.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::basicThermo> Foam::basicThermo::New
(
const fvMesh& mesh
)
int main(int argc, char *argv[])
{
// get model name, but do not register the dictionary
// otherwise it is registered in the database twice
const word modelType
(
IOdictionary
(
IOobject
(
"thermophysicalProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
).lookup("thermoType")
);
Info<< "Selecting thermodynamics package " << modelType << endl;
fvMeshConstructorTable::iterator cstrIter =
fvMeshConstructorTablePtr_->find(modelType);
if (cstrIter == fvMeshConstructorTablePtr_->end())
#include "addRegionOption.H"
if (argc < 2)
{
FatalErrorIn("basicThermo::New(const fvMesh&)")
<< "Unknown basicThermo type " << modelType << nl << nl
<< "Valid basicThermo types are:" << nl
<< fvMeshConstructorTablePtr_->sortedToc() << nl
FatalError
<< "No help utility has been supplied" << nl
<< exit(FatalError);
}
return autoPtr<basicThermo>(cstrIter()(mesh));
const word utilityName = argv[1];
Foam::autoPtr<Foam::helpType> utility
(
helpType::New(utilityName)
);
utility().init();
#include "setRootCase.H"
#include "createTime.H"
#include "createNamedMesh.H"
utility().execute(args, mesh);
Info<< "End\n" << endl;
}

View File

@ -0,0 +1,8 @@
helpType/helpType.C
helpType/helpTypeNew.C
helpBoundary/helpBoundary.C
helpFunctionObject/helpFunctionObject.C
doxygenXmlParser/doxygenXmlParser.C
LIB = $(FOAM_LIBBIN)/libhelpTypes

View File

@ -0,0 +1,13 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lincompressibleTurbulenceModel \
-lcompressibleTurbulenceModel \
-lincompressibleRASModels \
-lcompressibleRASModels \
-lincompressibleLESModels \
-lcompressibleLESModels \
-lradiationModels \
-lbasicThermophysicalModels

View File

@ -0,0 +1,246 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 "doxygenXmlParser.H"
#include "wordRe.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::doxygenXmlParser::doxygenXmlParser
(
const fileName& fName,
const string& startTag,
const string& searchStr,
const bool exactMatch
)
:
dictionary(dictionary::null)
{
IFstream is(fName);
char c;
// skip forward to entry name
skipForward(is, startTag);
while (is.get(c))
{
if (c == '<')
{
// if in block, read block name
string blockName = "";
string params = "";
bool readingParam = false;
while (is.get(c) && c != '>')
{
if (c == ' ')
{
readingParam = true;
}
else
{
if (readingParam)
{
params = params + c;
}
else
{
blockName = blockName + c;
}
}
}
if (blockName == '/' + startTag)
{
break;
}
if ((blockName == "compound") && (params == "kind=\"file\""))
{
// keep entry
word name = "";
fileName path = "";
word fName = "";
bool foundName = false;
bool foundPath = false;
bool foundFName = false;
bool earlyExit = false;
while (!foundName || !foundPath || !foundFName)
{
word entryName;
getEntry<word>(is, entryName);
if (entryName == "name")
{
getValue<word>(is, name);
if (wordRe(".*.H", wordRe::DETECT).match(name))
{
foundName = true;
}
else
{
// not interested in this compound
break;
}
}
else if (entryName == "path")
{
getValue<fileName>(is, path);
// filter path on regExp
if (wordRe(searchStr, wordRe::DETECT).match(path))
{
foundPath = true;
}
else
{
// not interested in this compound
break;
}
}
else if (entryName == "filename")
{
getValue<word>(is, fName);
foundFName = true;
}
else
{
skipBlock(is, entryName);
}
}
if (foundPath && !earlyExit)
{
word tName(path.components().last());
// only insert if type is not already known
// NOTE: not ideal for cases where there are multiple types
// but contained within different namespaces
// preferentially take exact match if it exists
if (exactMatch && (tName + ".H") == name)
{
dictionary dict(dictionary::null);
dict.add("name", name);
dict.add("filename", fName + ".html");
dict.add("path", path);
this->add(tName, dict);
}
else if
(
!exactMatch
&& !found(tName)
&& wordRe(".*" + tName + ".*", wordRe::DETECT).match(name)
)
{
dictionary dict(dictionary::null);
dict.add("name", name);
dict.add("filename", fName + ".html");
dict.add("path", path);
this->add(tName, dict);
}
}
// skip remanining entries
skipBlock(is, blockName);
}
else
{
skipBlock(is, blockName);
}
}
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::doxygenXmlParser::skipBlock(IFstream& is, const word blockName) const
{
// recurse to move forward in 'is' until come across </blockName>
string closeName = "";
// fast-forward until we reach a '<'
char c;
while (is.get(c) && c != '<')
{}
// check to see if this is a closing block
if (is.get(c) && c == '/')
{
while (is.get(c) && c != '>')
{
closeName += c;
}
if (closeName == blockName)
{
// finished reading block
return;
}
else
{
skipBlock(is, blockName);
}
}
else
{
skipBlock(is, blockName);
}
}
void Foam::doxygenXmlParser::skipForward
(
IFstream& is,
const word blockName
) const
{
// recurse to move forward in 'is' until come across <blockName>
// fast-forward until we reach a '<'
char c;
while (is.get(c) && c != '<')
{}
string entryName = "";
while (is.get(c) && c != '>')
{
entryName = entryName + c;
}
if (entryName == blockName)
{
return;
}
else
{
skipForward(is, blockName);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,97 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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::doxygenXmlParser
Description
SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef doxygenXmlParser_H
#define doxygenXmlParser_H
#include "dictionary.H"
#include "IFstream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class doxygenXmlParser Declaration
\*---------------------------------------------------------------------------*/
class doxygenXmlParser
:
public dictionary
{
public:
//- Construct from components
doxygenXmlParser
(
const fileName& fName,
const string& startTag,
const string& searchStr,
const bool exactMatch
);
// Member functions
//- Skip past a block
void skipBlock(IFstream& is, const word blockName) const;
//- Skip forward to block
void skipForward(IFstream& is, const word blockName) const;
//- Return the entry
template<class Type>
void getEntry(IFstream& is, Type& entry) const;
//- Return the entry value
template<class Type>
void getValue(IFstream& is, Type& entry) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "doxygenXmlParserTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,67 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 "doxygenXmlParser.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::doxygenXmlParser::getEntry(IFstream& is, Type& entry) const
{
char c;
while (is.get(c) && c != '<')
{}
entry = "";
if (is.get(c) && c == '/')
{
return;
}
else
{
entry = entry + c;
}
while (is.get(c) && c != '>')
{
entry = entry + c;
}
}
template<class Type>
void Foam::doxygenXmlParser::getValue(IFstream& is, Type& entry) const
{
char c;
entry = "";
while (is.get(c) && c != '<')
{
entry = entry + c;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,192 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 "helpBoundary.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace helpTypes
{
defineTypeNameAndDebug(helpBoundary, 0);
addNamedToRunTimeSelectionTable
(
helpType,
helpBoundary,
dictionary,
boundary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::helpTypes::helpBoundary::helpBoundary()
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::helpTypes::helpBoundary::~helpBoundary()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::helpTypes::helpBoundary::init()
{
helpType::init();
argList::validArgs.append("boundary");
argList::addOption
(
"field",
"word",
"list available conditions for field"
);
argList::addBoolOption
(
"constraint",
"list constraint patches"
);
argList::addBoolOption
(
"fixedValue",
"list fixed value patches (use with -field option)"
);
}
void Foam::helpTypes::helpBoundary::execute
(
const argList& args,
const fvMesh& mesh
)
{
bool abortVar(env("FOAM_ABORT"));
if (abortVar)
{
FatalErrorIn
(
"void Foam::helpTypes::helpBoundary::execute"
"("
"const argList&, "
"const fvMesh&"
")"
)
<< "Please unset FOAM_ABORT to use this utlity"
<< exit(FatalError);
}
word condition(word::null);
word fieldName(word::null);
if (args.optionReadIfPresent("browse", condition))
{
// TODO: strip scoping info if present?
// e.g. conditions with leading "compressible::" will not be found
// ".*[fF]vPatchField.*" + className + ".*"
displayDoc(condition, ".*[fF]vPatchField.*", false);
}
else if (args.optionFound("constraint"))
{
HashSet<word> constraintTypes(fvPatch::constraintTypes());
Info<< "Constraint types:" << nl;
forAllConstIter(HashSet<word>, constraintTypes, iter)
{
Info<< " " << iter.key() << nl;
}
Info<< endl;
}
else if (args.optionReadIfPresent("field", fieldName))
{
IOobject fieldHeader
(
fieldName,
mesh.time().timeName(),
mesh,
IOobject::MUST_READ
);
if (fieldHeader.headerOk())
{
if (args.optionFound("fixedValue"))
{
fixedValueFieldConditions<scalar>(fieldHeader);
fixedValueFieldConditions<vector>(fieldHeader);
fixedValueFieldConditions<sphericalTensor>(fieldHeader);
fixedValueFieldConditions<symmTensor>(fieldHeader);
fixedValueFieldConditions<tensor>(fieldHeader);
}
else
{
(void)fieldConditions<scalar>(fieldHeader, true);
(void)fieldConditions<vector>(fieldHeader, true);
(void)fieldConditions<sphericalTensor>(fieldHeader, true);
(void)fieldConditions<symmTensor>(fieldHeader, true);
(void)fieldConditions<tensor>(fieldHeader, true);
}
}
else
{
FatalErrorIn
(
"void Foam::helpTypes::helpBoundary::execute"
"("
"const argList&, "
"const fvMesh&"
")"
)
<< "Unable to read field " << fieldName << exit(FatalError);
}
}
else if (args.optionReadIfPresent("fixedValue", fieldName))
{
FatalErrorIn
(
"void Foam::helpTypes::helpBoundary::execute"
"("
"const argList&, "
"const fvMesh&"
")"
)
<< "-field option must be specified when using the -fixedValue "
<< "option" << exit(FatalError);
}
else
{
// TODO: strip scoping info if present?
// e.g. conditions with leading "compressible::" will not be found
// ".*[fF]vPatchField.*" + className + ".*"
displayDocOptions(".*[fF]vPatchField.*", false);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,126 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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::helpBoundary
Description
This class provides help for boundary conditions (patch fields). When no
additional arguments are given, the utility outputs all known boundary
conditions.
Usage:
\plaintable
\c -browse \<patch type\> | open documentation for patch in browser
\c -field \<name\> | boundary conditions for a given field
\c -constraint | list constraint boundary conditions
\c -fixedValue | list \c fixedValue type boundary conditions
\endplaintable
Note
To use the \c -fixedValue option, the \c -field option should also be used
SeeAlso
Foam::helpType
Foam::fvPatchField
SourceFiles
helpBoundary.C
helpBoundaryTemplates.C
\*---------------------------------------------------------------------------*/
#ifndef helpBoundary_H
#define helpBoundary_H
#include "helpType.H"
#include "IOobject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace helpTypes
{
/*---------------------------------------------------------------------------*\
Class helpBoundary Declaration
\*---------------------------------------------------------------------------*/
class helpBoundary
:
public helpType
{
protected:
// Protected Member Functions
//- Return/output the available boundary conditions for fields of Type
template<class Type>
wordList fieldConditions(const IOobject& io, const bool write) const;
//- Output the available fixed boundary conditions for fields of Type
template<class Type>
void fixedValueFieldConditions(const IOobject& io) const;
public:
//- Runtime type information
TypeName("helpBoundary");
//- Constructor
helpBoundary();
//- Destructor
virtual ~helpBoundary();
// Member Functions
//- Initialise - typically setting static variables,
// e.g. command line arguments
virtual void init();
//- Execute the help
virtual void execute(const argList& args, const fvMesh& mesh);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace helpTypes
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "helpBoundaryTemplates.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,161 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 "GeometricField.H"
#include "fvPatchField.H"
#include "volMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
Foam::wordList Foam::helpTypes::helpBoundary::fieldConditions
(
const IOobject& io,
const bool write
) const
{
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
if (io.headerClassName() == fieldType::typeName)
{
wordList types
(
fvPatchField<Type>::dictionaryConstructorTablePtr_->sortedToc()
);
if (write)
{
Info<< "Available boundary conditions for "
<< pTraits<Type>::typeName << " field: " << io.name() << nl;
forAll(types, i)
{
Info<< " " << types[i] << nl;
}
Info<< endl;
}
return types;
}
return wordList();
}
template<class Type>
void Foam::helpTypes::helpBoundary::fixedValueFieldConditions
(
const IOobject& io
) const
{
wordList types(fieldConditions<Type>(io, false));
if (!types.size())
{
return;
}
typedef GeometricField<Type, fvPatchField, volMesh> fieldType;
const fvMesh& mesh = dynamic_cast<const fvMesh&>(io.db());
fieldType fld
(
IOobject
(
"dummy",
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
mesh,
dimensioned<Type>("zero", dimless, pTraits<Type>::zero)
);
Info<< "Fixed value boundary conditions for "
<< pTraits<Type>::typeName << " field: " << io.name() << nl;
// throw exceptions to avoid fatal errors when casting from generic patch
// type to incompatible patch type
FatalIOError.throwExceptions();
FatalError.throwExceptions();
bool foundFixed = false;
forAll(types, i)
{
const word& patchType = types[i];
try
{
polyPatch pp
(
"defaultFaces",
0,
mesh.nInternalFaces(),
0,
mesh.boundaryMesh(),
patchType
);
fvPatch fvp(pp, mesh.boundary());
tmp<fvPatchField<Type> > pf
(
fvPatchField<Type>::New
(
patchType,
fvp,
fld
)
);
if (pf().fixesValue())
{
Info<< " " << patchType << nl;
foundFixed = true;
}
}
catch (...)
{
// do nothing
}
}
if (!foundFixed)
{
// no conditions???
Info<< " none" << nl;
}
Info<< endl;
}
// ************************************************************************* //

View File

@ -0,0 +1,88 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 "helpFunctionObject.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace helpTypes
{
defineTypeNameAndDebug(helpFunctionObject, 0);
addNamedToRunTimeSelectionTable
(
helpType,
helpFunctionObject,
dictionary,
functionObject
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::helpTypes::helpFunctionObject::helpFunctionObject()
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::helpTypes::helpFunctionObject::~helpFunctionObject()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::helpTypes::helpFunctionObject::init()
{
helpType::init();
argList::validArgs.append("functionObject");
}
void Foam::helpTypes::helpFunctionObject::execute
(
const argList& args,
const fvMesh& mesh
)
{
word function(word::null);
if (args.optionReadIfPresent("browse", function))
{
displayDoc(function, ".*[fF]unctionObject.*", true);
}
else
{
displayDocOptions(".*[fF]unctionObject.*", true);
}
}
// ************************************************************************* //

View File

@ -0,0 +1,98 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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::helpFunctionObject
Description
This class provides help for functionObjects. When no additional arguments
are given, the utility outputs all known function objects.
Usage:
\plaintable
\c -browse \<patch type\> | open documentation for object in browser
\endplaintable
SeeAlso
Foam::helpType
Foam::functionObject
SourceFiles
helpFunctionObject.C
\*---------------------------------------------------------------------------*/
#ifndef helpFunctionObject_H
#define helpFunctionObject_H
#include "helpType.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace helpTypes
{
/*---------------------------------------------------------------------------*\
Class helpFunctionObject Declaration
\*---------------------------------------------------------------------------*/
class helpFunctionObject
:
public helpType
{
public:
//- Runtime type information
TypeName("helpFunctionObject");
//- Constructor
helpFunctionObject();
//- Destructor
virtual ~helpFunctionObject();
// Member Functions
//- Initialise - typically setting static variables,
// e.g. command line arguments
virtual void init();
//- Execute the help
virtual void execute(const argList& args, const fvMesh& mesh);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace helpTypes
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,185 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 "helpType.H"
#include "doxygenXmlParser.H"
#include "SortableList.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(helpType, 0);
defineRunTimeSelectionTable(helpType, dictionary);
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
Foam::fileName Foam::helpType::doxygenPath() const
{
const dictionary& docDict = debug::controlDict().subDict("Documentation");
List<fileName> docDirs(docDict.lookup("doxyDocDirs"));
label dirI = -1;
forAll(docDirs, i)
{
if (isDir(docDirs[i].expand()))
{
dirI = i;
break;
}
}
if (dirI == -1)
{
Info<< "No Doxygen sources found under search paths: "
<< docDirs << endl;
return fileName();
}
return docDirs[dirI];
}
void Foam::helpType::displayDocOptions
(
const string& searchStr,
const bool exactMatch
) const
{
fileName doxyPath(doxygenPath());
if (doxyPath.empty())
{
return;
}
Info<< "Found doxygen help in " << doxyPath.c_str() << nl << endl;
doxygenXmlParser parser
(
doxyPath/"../DTAGS",
"tagfile",
searchStr,
exactMatch
);
Info<< "Valid types include:" << nl << SortableList<word>(parser.toc());
}
void Foam::helpType::displayDoc
(
const word& className,
const string& searchStr,
const bool exactMatch
) const
{
fileName doxyPath(doxygenPath());
if (doxyPath.empty())
{
return;
}
Info<< "Found doxygen help in " << doxyPath.c_str() << nl << endl;
string docBrowser = getEnv("FOAM_DOC_BROWSER");
if (docBrowser.empty())
{
const dictionary& docDict =
debug::controlDict().subDict("Documentation");
docDict.lookup("docBrowser") >> docBrowser;
}
doxygenXmlParser parser
(
doxyPath/"../DTAGS",
"tagfile",
searchStr,
exactMatch
);
if (debug)
{
Info<< parser;
}
if (parser.found(className))
{
fileName docFile(doxyPath/parser.subDict(className).lookup("filename"));
// can use FOAM_DOC_BROWSER='application file://%f' if required
docBrowser.replaceAll("%f", docFile);
fileName classFolder(parser.subDict(className).lookup("path"));
word classFile(parser.subDict(className).lookup("name"));
Info<< "Showing documentation for type " << className << nl << endl;
Info<< "Source file: " << classFolder.c_str() << classFile << nl
<< endl;
system(docBrowser);
}
else
{
FatalErrorIn
(
"void Foam::helpType::displayDoc(const word, const string)"
)
<< "No help for type " << className << " found."
<< " Valid options include:" << SortableList<word>(parser.toc())
<< exit(FatalError);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::helpType::helpType()
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::helpType::~helpType()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::helpType::init()
{
argList::addOption
(
"browse",
"word",
"display documentation for boundary condition in browser"
);
}
// ************************************************************************* //

View File

@ -0,0 +1,125 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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::helpType
Description
Base class for foam help classes
SourceFiles
helpType.C
helpTypeNew.C
\*---------------------------------------------------------------------------*/
#ifndef helpType_H
#define helpType_H
#include "runTimeSelectionTables.H"
#include "autoPtr.H"
#include "argList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// forward declaration of classes
class fvMesh;
/*---------------------------------------------------------------------------*\
Class helpType Declaration
\*---------------------------------------------------------------------------*/
class helpType
{
protected:
//- Return file path to the Doxygen sources (if available)
fileName doxygenPath() const;
//- Display the list of documentation options
void displayDocOptions
(
const string& searchStr,
const bool exactMatch
) const;
//- Display the help documentation in a browser
void displayDoc
(
const word& className,
const string& searchStr,
const bool exactMatch
) const;
public:
//- Runtime type information
TypeName("helpType");
// Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
helpType,
dictionary,
(),
()
);
//- Constructor
helpType();
//- Selector
static autoPtr<helpType> New(const word& helpTypeName);
//- Destructor
virtual ~helpType();
// Member Functions
//- Initialise - typically setting static variables,
// e.g. command line arguments
virtual void init();
//- Execute the help
virtual void execute(const argList& args, const fvMesh& mesh) = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -23,49 +23,42 @@ License
\*---------------------------------------------------------------------------*/
#include "rhoThermo.H"
#include "helpType.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::rhoThermo> Foam::rhoThermo::New
Foam::autoPtr<Foam::helpType> Foam::helpType::New
(
const fvMesh& mesh
const word& helpTypeName
)
{
// get model name, but do not register the dictionary
// otherwise it is registered in the database twice
const word modelType
(
IOdictionary
(
IOobject
(
"thermophysicalProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
).lookup("thermoType")
);
Info<< "Selecting helpType " << helpTypeName << endl;
Info<< "Selecting thermodynamics package " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(helpTypeName);
fvMeshConstructorTable::iterator cstrIter =
fvMeshConstructorTablePtr_->find(modelType);
if (cstrIter == fvMeshConstructorTablePtr_->end())
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn("rhoThermo::New(const fvMesh&)")
<< "Unknown rhoThermo type "
<< modelType << nl << nl
<< "Valid rhoThermo types are:" << nl
<< fvMeshConstructorTablePtr_->sortedToc() << nl
<< exit(FatalError);
// special treatment for -help
// exit without stack trace
if (helpTypeName == "-help")
{
FatalErrorIn("helpType::New()")
<< "Valid helpType selections are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc() << nl
<< exit(FatalError);
}
else
{
FatalErrorIn("helpType::New()")
<< "Unknown helpType type " << helpTypeName << nl
<< "Valid helpType selections are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc() << nl
<< abort(FatalError);
}
}
return autoPtr<rhoThermo>(cstrIter()(mesh));
return autoPtr<helpType>(cstrIter()());
}

View File

@ -62,6 +62,9 @@ pqPV3FoamReaderPanel::pqPV3FoamReaderPanel
QGridLayout* form = new QGridLayout();
this->PanelLayout->addLayout(form, 0, 0, 1, -1);
// ROW 0
// ~~~~~
vtkSMProperty* prop = 0;
// refresh button for updating times/fields
@ -107,10 +110,16 @@ pqPV3FoamReaderPanel::pqPV3FoamReaderPanel
);
}
// ROW 1
// ~~~~~
QFrame* hline1 = new QFrame(this);
hline1->setFrameStyle(QFrame::HLine | QFrame::Sunken);
form->addWidget(hline1, 1, 0, 1, 3);
// ROW 2
// ~~~~~
// checkbox for caching mesh
if ((prop = this->proxy()->GetProperty("UiCacheMesh")) != 0)
{
@ -137,62 +146,10 @@ pqPV3FoamReaderPanel::pqPV3FoamReaderPanel
);
}
// cell 2,1 empty
// checkbox for patch names
if ((prop = this->proxy()->GetProperty("UiShowPatchNames")) != 0)
{
// immediate update on the Server Manager side
prop->SetImmediateUpdate(true);
ShowPatchNames_ = new QCheckBox("Patch Names");
ShowPatchNames_->setChecked
(
vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0)
);
ShowPatchNames_->setToolTip
(
"Show patch names in render window."
);
// row/col 0,1
form->addWidget(ShowPatchNames_, 2, 1, Qt::AlignLeft);
connect
(
ShowPatchNames_,
SIGNAL(stateChanged(int)),
this,
SLOT(ShowPatchNamesToggled())
);
}
// checkbox for Groups Only
if ((prop = this->proxy()->GetProperty("UiShowGroupsOnly")) != 0)
{
// immediate update on the Server Manager side
prop->SetImmediateUpdate(true);
ShowGroupsOnly_ = new QCheckBox("Groups Only");
ShowGroupsOnly_->setChecked
(
vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0)
);
ShowGroupsOnly_->setToolTip
(
"Show patchGroups only."
);
// row/col 2, 2
form->addWidget(ShowGroupsOnly_, 2, 2, Qt::AlignLeft);
connect
(
ShowGroupsOnly_,
SIGNAL(stateChanged(int)),
this,
SLOT(ShowGroupsOnlyToggled())
);
}
// ROW 3
// ~~~~~
// checkbox for include sets
if ((prop = this->proxy()->GetProperty("UiIncludeSets")) != 0)
@ -221,6 +178,36 @@ pqPV3FoamReaderPanel::pqPV3FoamReaderPanel
);
}
// checkbox for Groups Only
if ((prop = this->proxy()->GetProperty("UiShowGroupsOnly")) != 0)
{
// immediate update on the Server Manager side
prop->SetImmediateUpdate(true);
ShowGroupsOnly_ = new QCheckBox("Groups Only");
ShowGroupsOnly_->setChecked
(
vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0)
);
ShowGroupsOnly_->setToolTip
(
"Show patchGroups only."
);
// row/col 2, 2
form->addWidget(ShowGroupsOnly_, 3, 1, Qt::AlignLeft);
connect
(
ShowGroupsOnly_,
SIGNAL(stateChanged(int)),
this,
SLOT(ShowGroupsOnlyToggled())
);
}
// ROW 4
// ~~~~~
// checkbox for include zones
if ((prop = this->proxy()->GetProperty("UiIncludeZones")) != 0)
@ -240,7 +227,7 @@ pqPV3FoamReaderPanel::pqPV3FoamReaderPanel
);
// row/col 1,1
form->addWidget(IncludeZones_, 3, 1, Qt::AlignLeft);
form->addWidget(IncludeZones_, 4, 0, Qt::AlignLeft);
connect
(
IncludeZones_,
@ -250,6 +237,43 @@ pqPV3FoamReaderPanel::pqPV3FoamReaderPanel
);
}
// checkbox for patch names
if ((prop = this->proxy()->GetProperty("UiShowPatchNames")) != 0)
{
// immediate update on the Server Manager side
prop->SetImmediateUpdate(true);
ShowPatchNames_ = new QCheckBox("Patch Names");
ShowPatchNames_->setChecked
(
vtkSMIntVectorProperty::SafeDownCast(prop)->GetElement(0)
);
ShowPatchNames_->setToolTip
(
"Show patch names in render window."
);
// row/col 0,1
form->addWidget(ShowPatchNames_, 4, 1, Qt::AlignLeft);
connect
(
ShowPatchNames_,
SIGNAL(stateChanged(int)),
this,
SLOT(ShowPatchNamesToggled())
);
}
// ROW 5
// ~~~~~
QFrame* hline2 = new QFrame(this);
hline2->setFrameStyle(QFrame::HLine | QFrame::Sunken);
form->addWidget(hline2, 5, 0, 1, 3);
// ROW 6
// ~~~~~
// checkbox for vol field interpolation
if ((prop = this->proxy()->GetProperty("UiInterpolateVolFields")) != 0)
{
@ -267,7 +291,7 @@ pqPV3FoamReaderPanel::pqPV3FoamReaderPanel
);
// row/col 1,1
form->addWidget(InterpolateVolFields_, 4, 0, Qt::AlignLeft);
form->addWidget(InterpolateVolFields_, 6, 0, Qt::AlignLeft);
connect
(
InterpolateVolFields_,
@ -294,7 +318,7 @@ pqPV3FoamReaderPanel::pqPV3FoamReaderPanel
);
// row/col 1,1
form->addWidget(ExtrapolatePatches_, 4, 1, Qt::AlignLeft);
form->addWidget(ExtrapolatePatches_, 6, 1, Qt::AlignLeft);
connect
(
ExtrapolatePatches_,
@ -304,9 +328,12 @@ pqPV3FoamReaderPanel::pqPV3FoamReaderPanel
);
}
QFrame* hline2 = new QFrame(this);
hline2->setFrameStyle(QFrame::HLine | QFrame::Sunken);
form->addWidget(hline2, 5, 0, 1, 3);
// ROW 7
// ~~~~~
QFrame* hline3 = new QFrame(this);
hline3->setFrameStyle(QFrame::HLine | QFrame::Sunken);
form->addWidget(hline3, 7, 0, 1, 3);
}

View File

@ -54,7 +54,8 @@ then
# ;;
esac
awk -f $awkScript $1 | \
awk -f $WM_PROJECT_DIR/bin/tools/doxyFilter-table.awk $1 | \
awk -f $awkScript | \
sed -f $WM_PROJECT_DIR/bin/tools/doxyFilter.sed \
-e s@%filePath%@$filePath@g \
-e s@%fileName%@$fileName@g \

View File

@ -0,0 +1,135 @@
BEGIN {
FS = "|";
data = "";
flag = 0;
firstRow = 0;
}
/\\table/ {
flag = 1;
firstRow = 1;
next;
}
/\\endtable/ {
if (data != "")
{
printf "<table class=\"OFTable\">\n";
printf data;
printf "</table>\n";
}
data = "";
flag = 0;
next;
}
/\\vartable/ {
flag = 2;
firstRow = 1;
next;
}
/\\endvartable/ {
if (data != "")
{
printf "<table border="0">\n";
printf data;
printf "</table>\n";
}
data = "";
flag = 0;
next;
}
/\\plaintable/ {
flag = 3;
firstRow = 1;
next;
}
/\\endplaintable/ {
if (data != "")
{
printf "<table border="0">\n";
printf data;
printf "</table>\n";
}
data = "";
flag = 0;
next;
}
{
if (flag > 0)
{
data = (data "<tr>\n");
if (flag == 1)
{
for (i = 0; i <= NF; i++)
{
if ((i != 0) && (firstRow == 1))
{
data = (data " <th align=\"center\"><b>"$i"</b></th>\n");
}
else
{
if (i == 1)
{
data = (data " <td>\\c "$i"</td>\n");
}
else if (i > 1)
{
data = (data " <td>"$i"</td>\n");
}
}
}
}
else if (flag == 2)
{
for (i = 0; i <= NF; i++)
{
if (i == 1)
{
data = (data " <td style=\"padding-left: 10px\">\\f$"$i"\\f$</td>\n");
data = (data " <td style=\"padding-left: 10px; padding-right: 10px;\">=</td>\n");
}
else if (i > 1)
{
data = (data " <td>"$i"</td>\n");
}
}
}
else if (flag == 3)
{
for (i = 0; i <= NF; i++)
{
if (i == 1)
{
data = (data " <td style=\"padding-left: 10px\">"$i"</td>\n");
data = (data " <td style=\"padding-left: 10px; padding-right: 10px;\">:</td>\n");
}
else if (i > 1)
{
data = (data " <td>"$i"</td>\n");
}
}
}
data = (data "</tr>\n");
firstRow = 0;
}
else
{
print $0
}
}

View File

@ -64,6 +64,17 @@ s/^ /\\class /
}
# Group
# groupName
# =>
# \ingroup namespaceName
#
/^Group *$/,/^[^ ]/{
s/^Group//
s/^ /\\ingroup /
}
# Namespace
# namespaceName
# =>
@ -150,6 +161,13 @@ s? *\([a-zA-Z0-9]*\.[a-zA-Z]*\)? <li><a href="%dirName%/\1">\1</a></li>?
s/.*\*\//\*\//
# convert /heading in source files to bold font and add some space
s#\\heading \(.*\)#<br><b>\1</b>#g
# add a linebreak
s#\\linebreak#<br>#g
}
# -----------------------------------------------------------------------------

View File

@ -608,7 +608,8 @@ INPUT_ENCODING = UTF-8
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
FILE_PATTERNS = *.H \
*.C
*.C \
*.dox
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.

View File

@ -61,3 +61,19 @@ tr.memlist
margin-top: 0px;
width: 200px;
}
.OFTable {
width: 100%;
border: 1px solid rgb(175,175,175);
margin-top: 10px;
margin-bottom: 10px;
/* background-color: #F0F0F0; */
padding: 5px;
}
.OFTable th {
padding: 5px;
border-bottom: 2px solid rgb(175,175,175);
}

View File

@ -29,12 +29,12 @@ Description
generate the entry itself. So
- codeStream reads three entries: 'code', 'codeInclude' (optional),
'codeOptions' (optional)
and uses those to generate library sources inside \f codeStream/
and uses those to generate library sources inside \c codeStream/
- these get compiled using 'wmake libso'
- the resulting library is loaded in executed with as arguments
\code
(const dictionary& dict, Ostream& os)
\endcode
\endcode
where the dictionary is the current dictionary.
- the code has to write into Ostream which is then used to construct
the actual dictionary entry.
@ -77,12 +77,12 @@ Description
\c \$ and \c ~ sequences)
Note
The code to be compiled is stored under the local \f codeStream directory
The code to be compiled is stored under the local \c codeStream directory
with a subdirectory name corresponding to the SHA1 of the contents.
The corresponding library code is located under the local
\f codeStream/platforms/$WM_OPTIONS/lib directory in a library
\f libcodeStream_SHA1.so
\c codeStream/platforms/$WM_OPTIONS/lib directory in a library
\c libcodeStream_SHA1.so
SourceFiles
codeStream.C

View File

@ -0,0 +1,31 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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/>.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
\defgroup grpFunctionObjects Function objects
@{
This group contains function objects
@}
\*---------------------------------------------------------------------------*/

View File

@ -26,7 +26,7 @@ Class
Description
Extract command arguments and options from the supplied
\a argc and @a argv parameters.
\a argc and \a argv parameters.
Sequences with "(" ... ")" are transformed into a stringList.
For example,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -21,6 +21,8 @@ License
You should have received a copy of the GNU General Public License along with
OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
\mainpage OpenFOAM&reg;: open source CFD
\section about About OpenFOAM
@ -34,4 +36,29 @@ License
turbulence and heat transfer, to solid dynamics and electromagnetics.
<a href="http://www.openfoam.org/features">More ...</a>
\section layout Code Layout
The OpenFOAM source code comprises of four main components:
- src:
the core OpenFOAM source code
- applications:
collections of library functionality wrapped up into applications,
such as solvers and utilities
- tutorials:
a suite of test cases that highlight a broad cross-section of
OpenFOAM's capabilities
- doc:
supporting documentation
\section usingTheCode Using the code
- \subpage pagePostProcessing
- \subpage pageBoundaryConditions
\*---------------------------------------------------------------------------*/

View File

@ -37,4 +37,42 @@ namespace Foam
defineTemplateTypeNameAndDebugWithName(wordListIOList, "wordListList", 0);
}
void Foam::printTable(const List<wordList>& wll, Ostream& os)
{
if (!wll.size()) return;
// Find the maximum word length for each column
List<string::size_type> columnWidth(wll[0].size(), string::size_type(0));
forAll(columnWidth, j)
{
forAll(wll, i)
{
columnWidth[j] = max(columnWidth[j], wll[i][j].size());
}
}
// Print the rows adding spacing for the columns
forAll(wll, i)
{
forAll(wll[i], j)
{
os << wll[i][j];
for
(
string::size_type k=0;
k<columnWidth[j] - wll[i][j].size() + 2;
k++
)
{
os << ' ';
}
}
os << nl;
if (i == 0) os << nl;
}
}
// ************************************************************************* //

View File

@ -41,6 +41,9 @@ namespace Foam
{
typedef IOList<word> wordIOList;
typedef IOList<wordList> wordListIOList;
// Print word list list as a table
void printTable(const List<wordList>&, Ostream&);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -102,8 +102,7 @@ singleStepCombustion<CombThermoType, ThermoType>::~singleStepCombustion()
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
template<class CombThermoType, class ThermoType>
Foam::tmp<Foam::fvScalarMatrix>
singleStepCombustion<CombThermoType, ThermoType>::R
tmp<fvScalarMatrix> singleStepCombustion<CombThermoType, ThermoType>::R
(
volScalarField& Y
) const
@ -131,8 +130,8 @@ singleStepCombustion<CombThermoType, ThermoType>::R
template<class CombThermoType, class ThermoType>
Foam::tmp<Foam::volScalarField>
singleStepCombustion< CombThermoType, ThermoType>::Sh() const
tmp<volScalarField>
singleStepCombustion<CombThermoType, ThermoType>::Sh() const
{
const label fuelI = singleMixturePtr_->fuelIndex();
volScalarField& YFuel =
@ -143,8 +142,8 @@ singleStepCombustion< CombThermoType, ThermoType>::Sh() const
template<class CombThermoType, class ThermoType>
Foam::tmp<Foam::volScalarField>
singleStepCombustion< CombThermoType, ThermoType>::dQ() const
tmp<volScalarField>
singleStepCombustion<CombThermoType, ThermoType>::dQ() const
{
tmp<volScalarField> tdQ
(
@ -175,7 +174,7 @@ singleStepCombustion< CombThermoType, ThermoType>::dQ() const
template<class CombThermoType, class ThermoType>
bool singleStepCombustion< CombThermoType, ThermoType>::read()
bool singleStepCombustion<CombThermoType, ThermoType>::read()
{
if (CombThermoType::read())
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,19 +25,23 @@ Class
Foam::explicitSetValue
Description
Explicit set values on fields.
Set values field values explicity.
Sources described by:
<Type>ExplicitSetValueCoeffs
\verbatim
<Type>ExplicitSetValueCoeffs
{
injectionRate
{
injectionRate
{
k 30.7;
epsilon 1.5;
}
k 30.7;
epsilon 1.5;
}
}
\endverbatim
SeeAlso
Foam::basicSource
SourceFiles
explicitSetValue.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,20 +29,24 @@ Description
Sources described by:
<Type>ExplicitSourceCoeffs
\verbatim
<Type>ExplicitSourceCoeffs
{
volumeMode absolute; // specific
injectionRate
{
volumeMode absolute; // specific
injectionRate
{
k 30.7;
epsilon 1.5;
}
k 30.7;
epsilon 1.5;
}
}
\verbatim
If volumeMode =
- absolute: values are given as <quantity>
- specific: values are given as <quantity>/m3
Valid options for the \c volumeMode entry include:
- absolute: values are given as \<quantity\>
- specific: values are given as \<quantity\>/m3
SeeAlso
Foam::basicSource
SourceFiles
ExplicitSource.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,8 +25,43 @@ Class
Foam::SRFVelocityFvPatchVectorField
Description
Freestream velocity patch to be used with SRF model
to apply the appropriate rotation transformation in time and space.
Freestream velocity condition to be used in conjunction with the single
rotating frame (SRF) model (see: SRFModel class)
Given the free stream velocity in the absolute frame, the condition
applies the appropriate rotation transformation in time and space to
determine the local velocity using:
\f[
U_p = cos(\theta)*U_{Inf} + sin(theta) (n^UInf) - U_{p,srf}
\f]
where
\vartable
U_p = patch velocity [m/s]
U_{Inf} = free stream velocity in the absolute frame [m/s]
theta = swept angle [rad]
n = axis direction of the SRF
U_{p,srf} = SRF velocity of the patch
\endvartable
\heading Patch usage
\table
Property | Description | Required | Default value
UInf | free stream velocity | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type SRFFreestreamVelocity;
UInf (0 0 0);
value uniform (0 0 0); // optional value entry
}
\endverbatim
SourceFiles
SRFVelocityFvPatchVectorField.C
@ -44,7 +79,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class SRFFreestreamVelocityFvPatchVectorField Declaration
Class SRFFreestreamVelocityFvPatchVectorField Declaration
\*---------------------------------------------------------------------------*/
class SRFFreestreamVelocityFvPatchVectorField
@ -53,7 +88,7 @@ class SRFFreestreamVelocityFvPatchVectorField
{
// Private data
//- Velocity of the free stream in the absolute frame
//- Velocity of the free stream in the absolute frame [m/s]
vector UInf_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,61 @@ License
Class
Foam::SRFVelocityFvPatchVectorField
Group
grpInletBoundaryConditions grpWallBoundaryConditions
Description
Velocity patch to be used with SRF model
Velocity condition to be used in conjunction with the single
rotating frame (SRF) model (see: SRFModel class)
Given the free stream velocity in the absolute frame, the condition
applies the appropriate rotation transformation in time and space to
determine the local velocity.
The optional \c relative flag switches the behaviour of the patch
such that:
- relative = yes: inlet velocity applied 'as is':
\f[
U_p = U_{in}
\f]
- relative = no : SRF velocity is subtracted from the inlet velocity:
\f[
U_p = U_{in} - U_{p,srf}
\f]
where
\vartable
U_p = patch velocity [m/s]
U_{in} = user-specified inlet velocity
U_{p,srf} = SRF velocity
\endvartable
\heading Patch usage
\table
Property | Description | Required | Default value
relative | relative motion to the SRF? | yes |
inletValue | inlet velocity | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type SRFVelocity;
relative yes;
inletValue uniform (0 0 0);
value uniform (0 0 0); // initial value
}
\endverbatim
SeeAlso
Foam::fixedValueFvPatchField
SourceFiles
SRFVelocityFvPatchVectorField.C
@ -57,7 +110,7 @@ class SRFVelocityFvPatchVectorField
//- Is the supplied inlet value relative to the SRF
Switch relative_;
//- Inlet value
//- Inlet value [m/s]
vectorField inletValue_;

View File

@ -165,6 +165,12 @@ void Foam::solutionControl::storePrevIterFields() const
Foam::solutionControl::solutionControl(fvMesh& mesh, const word& algorithmName)
:
IOobject
(
"solutionControl",
mesh.time().timeName(),
mesh
),
mesh_(mesh),
residualControl_(),
algorithmName_(algorithmName),

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,6 +44,8 @@ namespace Foam
\*---------------------------------------------------------------------------*/
class solutionControl
:
public IOobject
{
public:

View File

@ -24,6 +24,9 @@ License
Class
Foam::basicSymmetryFvPatchField
Group
grpConstraintBoundaryConditions
Description
A symmetry patch

View File

@ -28,19 +28,17 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
template<class Type>
const word& fvPatchField<Type>::calculatedType()
const Foam::word& Foam::fvPatchField<Type>::calculatedType()
{
return calculatedFvPatchField<Type>::typeName;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
calculatedFvPatchField<Type>::calculatedFvPatchField
Foam::calculatedFvPatchField<Type>::calculatedFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
@ -51,7 +49,7 @@ calculatedFvPatchField<Type>::calculatedFvPatchField
template<class Type>
calculatedFvPatchField<Type>::calculatedFvPatchField
Foam::calculatedFvPatchField<Type>::calculatedFvPatchField
(
const calculatedFvPatchField<Type>& ptf,
const fvPatch& p,
@ -64,7 +62,7 @@ calculatedFvPatchField<Type>::calculatedFvPatchField
template<class Type>
calculatedFvPatchField<Type>::calculatedFvPatchField
Foam::calculatedFvPatchField<Type>::calculatedFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
@ -77,7 +75,7 @@ calculatedFvPatchField<Type>::calculatedFvPatchField
template<class Type>
calculatedFvPatchField<Type>::calculatedFvPatchField
Foam::calculatedFvPatchField<Type>::calculatedFvPatchField
(
const calculatedFvPatchField<Type>& ptf
)
@ -87,7 +85,7 @@ calculatedFvPatchField<Type>::calculatedFvPatchField
template<class Type>
calculatedFvPatchField<Type>::calculatedFvPatchField
Foam::calculatedFvPatchField<Type>::calculatedFvPatchField
(
const calculatedFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
@ -98,7 +96,8 @@ calculatedFvPatchField<Type>::calculatedFvPatchField
template<class Type>
tmp<fvPatchField<Type> > fvPatchField<Type>::NewCalculatedType
Foam::tmp<Foam::fvPatchField<Type> >
Foam::fvPatchField<Type>::NewCalculatedType
(
const fvPatch& p
)
@ -130,7 +129,7 @@ tmp<fvPatchField<Type> > fvPatchField<Type>::NewCalculatedType
template<class Type>
template<class Type2>
tmp<fvPatchField<Type> > fvPatchField<Type>::NewCalculatedType
Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::NewCalculatedType
(
const fvPatchField<Type2>& pf
)
@ -142,7 +141,8 @@ tmp<fvPatchField<Type> > fvPatchField<Type>::NewCalculatedType
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
tmp<Field<Type> > calculatedFvPatchField<Type>::valueInternalCoeffs
Foam::tmp<Foam::Field<Type> >
Foam::calculatedFvPatchField<Type>::valueInternalCoeffs
(
const tmp<scalarField>&
) const
@ -165,7 +165,8 @@ tmp<Field<Type> > calculatedFvPatchField<Type>::valueInternalCoeffs
template<class Type>
tmp<Field<Type> > calculatedFvPatchField<Type>::valueBoundaryCoeffs
Foam::tmp<Foam::Field<Type> >
Foam::calculatedFvPatchField<Type>::valueBoundaryCoeffs
(
const tmp<scalarField>&
) const
@ -186,8 +187,10 @@ tmp<Field<Type> > calculatedFvPatchField<Type>::valueBoundaryCoeffs
return *this;
}
template<class Type>
tmp<Field<Type> > calculatedFvPatchField<Type>::gradientInternalCoeffs() const
Foam::tmp<Foam::Field<Type> >
Foam::calculatedFvPatchField<Type>::gradientInternalCoeffs() const
{
FatalErrorIn
(
@ -206,8 +209,10 @@ tmp<Field<Type> > calculatedFvPatchField<Type>::gradientInternalCoeffs() const
return *this;
}
template<class Type>
tmp<Field<Type> > calculatedFvPatchField<Type>::gradientBoundaryCoeffs() const
Foam::tmp<Foam::Field<Type> >
Foam::calculatedFvPatchField<Type>::gradientBoundaryCoeffs() const
{
FatalErrorIn
(
@ -227,17 +232,12 @@ tmp<Field<Type> > calculatedFvPatchField<Type>::gradientBoundaryCoeffs() const
}
// Write
template<class Type>
void calculatedFvPatchField<Type>::write(Ostream& os) const
void Foam::calculatedFvPatchField<Type>::write(Ostream& os) const
{
fvPatchField<Type>::write(os);
this->writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,24 @@ License
Class
Foam::calculatedFvPatchField
Group
grpGenericBoundaryConditions
Description
Foam::calculatedFvPatchField
This boundary condition is not designed to be evaluated; it is assmued
that the value is assigned via field assignment, and not via a call to
e.g. \c updateCoeffs or \c evaluate.
\heading Patch usage
Example of the boundary condition specification:
\verbatim
myPatch
{
type calculated;
value uniform (0 0 0); // optional value entry
}
\endverbatim
SourceFiles
calculatedFvPatchField.C
@ -43,7 +59,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class calculatedFvPatch Declaration
Class calculatedFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -24,8 +24,11 @@ License
Class
Foam::coupledFvPatchField
Group
grpCoupledBoundaryConditions
Description
Foam::coupledFvPatchField
Abstract base class for coupled patches.
SourceFiles
coupledFvPatchField.C
@ -45,7 +48,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class coupledFvPatch Declaration
Class coupledFvPatch Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,11 @@ License
Class
Foam::directionMixedFvPatchField
Group
grpGenericBoundaryConditions
Description
Foam::directionMixedFvPatchField
Base class for direction-mixed boundary conditions.
SourceFiles
directionMixedFvPatchField.C
@ -43,7 +46,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class directionMixedFvPatch Declaration
Class directionMixedFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,40 @@ License
Class
Foam::fixedGradientFvPatchField
Group
grpGenericBoundaryConditions
Description
Foam::fixedGradientFvPatchField
This boundary condition supplies a fixed gradient condition, such that
the patch values are calculated using:
\f[
x_p = x_c + \frac{\nabla(x)}{\Delta}
\f]
where
\vartable
x_p | patch values
x_c | internal field values
\nabla(x)| gradient (user-specified)
\Delta | inverse distance from patch face centre to cell centre
\endvartable
\heading Patch usage
\table
Property | Description | Required | Default value
gradient | gradient | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type fixedGradient;
gradient uniform 0;
}
\endverbatim
SourceFiles
fixedGradientFvPatchField.C
@ -43,7 +75,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class fixedGradientFvPatch Declaration
Class fixedGradientFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,28 @@ License
Class
Foam::fixedValueFvPatchField
Group
grpGenericBoundaryConditions
Description
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base
class for a number of other boundary conditions.
\heading Patch usage
\table
Property | Description | Required | Default value
value | values | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type fixedValue;
value uniform 0; // example for scalar field usage
}
\endverbatim
SourceFiles
fixedValueFvPatchField.C
@ -43,7 +63,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class fixedValueFvPatch Declaration
Class fixedValueFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,45 @@ License
Class
Foam::mixedFvPatchField
Group
grpGenericBoundaryConditions
Description
Foam::mixedFvPatchField
This boundary condition provides a base class for 'mixed' type boundary
conditions, i.e. conditions that mix fixed value and patch-normal gradient
conditions.
The respective contributions from each is determined by a weight field:
\f[
x_p = w x_p + (1-w) \left(x_c + \frac{\nabla_\perp x}{\Delta}\right)
\f]
where
\vartable
x_p | patch values
x_c | patch internal cell values
w | weight field
\Delta| inverse distance from face centre to internal cell centre
w | weighting (0-1)
\endvartable
\heading Patch usage
\table
Property | Description | Required | Default value
valueFraction | weight field | yes |
refValue | fixed value | yes |
refGrad | patch normal gradient | yes |
\endtable
Note
This condition is not usually applied directly; instead, use a derived
mixed condition such as \c inletOutlet
SeeAlso
Foam::inletOutletFvPatchField
SourceFiles
mixedFvPatchField.C
@ -43,7 +80,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class mixedFvPatch Declaration
Class mixedFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -24,6 +24,9 @@ License
Class
Foam::slicedFvPatchField
Group
grpGenericBoundaryConditions
Description
Specialization of fvPatchField which creates the underlying
fvPatchField as a slice of the given complete field.
@ -33,6 +36,9 @@ Description
Should only used as a template argument for SlicedGeometricField.
SeeAlso
Foam::fvPatchField
SourceFiles
slicedFvPatchField.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,6 +24,9 @@ License
Class
Foam::transformFvPatchField
Group
grpGenericBoundaryConditions
Description
Foam::transformFvPatchField

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,22 @@ License
Class
Foam::zeroGradientFvPatchField
Group
grpGenericBoundaryConditions
Description
Foam::zeroGradientFvPatchField
This boundary condition applies a zero-gradient condition from the patch
internal field onto the patch faces.
\heading Patch usage
Example of the boundary condition specification:
\verbatim
myPatch
{
type zeroGradient;
}
\endverbatim
SourceFiles
zeroGradientFvPatchField.C
@ -43,7 +57,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class zeroGradientFvPatch Declaration
Class zeroGradientFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -24,8 +24,27 @@ License
Class
Foam::cyclicFvPatchField
Group
grpCoupledBoundaryConditions
Description
Foam::cyclicFvPatchField
This boundary condition enforces a cyclic condition between a pair of
boundaries.
\heading Patch usage
Example of the boundary condition specification:
\verbatim
myPatch
{
type cyclic;
}
\endverbatim
Note
The patches must be topologically similar, i.e. if the owner patch is
transformed to the neighbour patch, the patches should be identical (or
very similar).
SourceFiles
cyclicFvPatchField.C
@ -45,7 +64,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class cyclicFvPatch Declaration
Class cyclicFvPatch Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -24,8 +24,31 @@ License
Class
Foam::cyclicAMIFvPatchField
Group
grpCoupledBoundaryConditions
Description
Foam::cyclicAMIFvPatchField
This boundary condition enforces a cyclic condition between a pair of
boundaries, whereby communication between the patches is performed using
an arbitrary mesh interface (AMI) interpolation.
\heading Patch usage
Example of the boundary condition specification:
\verbatim
myPatch
{
type cyclicAMI;
}
\endverbatim
Note
The outer boundary of the patch pairs must be similar, i.e. if the owner
patch is transformed to the neighbour patch, the outer perimiter of each
patch should be identical (or very similar).
SeeAlso
Foam::AMIInterpolation
SourceFiles
cyclicAMIFvPatchField.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,15 +25,10 @@ License
#include "cyclicSlipFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
Foam::cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
@ -44,7 +39,7 @@ cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
template<class Type>
cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
Foam::cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
(
const cyclicSlipFvPatchField<Type>& ptf,
const fvPatch& p,
@ -57,7 +52,7 @@ cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
template<class Type>
cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
Foam::cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
@ -69,7 +64,7 @@ cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
template<class Type>
cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
Foam::cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
(
const cyclicSlipFvPatchField<Type>& ptf
)
@ -79,7 +74,7 @@ cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
template<class Type>
cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
Foam::cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
(
const cyclicSlipFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
@ -89,8 +84,4 @@ cyclicSlipFvPatchField<Type>::cyclicSlipFvPatchField
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,25 @@ License
Class
Foam::cyclicSlipFvPatchField
Group
grpCoupledBoundaryConditions
Description
Foam::cyclicSlipFvPatchField
This boundary condition is a light wrapper around the cyclicFvPatchField
condition, providing no new functionality.
\heading Patch usage
Example of the boundary condition specification:
\verbatim
myPatch
{
type cyclicSlip;
}
\endverbatim
SeeAlso
Foam::cyclicFvPatchField
SourceFiles
cyclicSlipFvPatchField.C
@ -44,7 +61,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class cyclicSlipFvPatch Declaration
Class cyclicSlipFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
@ -52,7 +69,6 @@ class cyclicSlipFvPatchField
:
public cyclicFvPatchField<Type>
{
// Private data
public:
@ -119,7 +135,6 @@ public:
new cyclicSlipFvPatchField<Type>(*this, iF)
);
}
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,24 @@ License
Class
Foam::emptyFvPatchField
Group
grpConstraintBoundaryConditions
Description
Foam::emptyFvPatchField
This boundary condition provides an 'empty' condition for reduced
dimensions cases, i.e. 1- and 2-D geometries. Apply this condition to
patches whose normal is aligned to geometric directions that do not
constitue solution directions.
\heading Patch usage
Example of the boundary condition specification:
\verbatim
myPatch
{
type empty;
}
\endverbatim
SourceFiles
emptyFvPatchField.C
@ -44,7 +60,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class emptyFvPatch Declaration
Class emptyFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -24,8 +24,15 @@ License
Class
Foam::jumpCyclicFvPatchField
Group
grpCoupledBoundaryConditions
Description
Foam::jumpCyclicFvPatchField
This boundary condition provides a base class for coupled-cyclic
conditions with a specified 'jump' (or offset) between the values
SeeAlso
Foam::cyclicFvPatchField
SourceFiles
jumpCyclicFvPatchField.C
@ -43,7 +50,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class cyclicFvPatch Declaration
Class jumpCyclicFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,11 +24,18 @@ License
Class
Foam::nonuniformTransformCyclicFvPatchField
Group
grpCoupledBoundaryConditions
Description
Foam::nonuniformTransformCyclicFvPatchField
This boundary condition enforces a cyclic condition between a pair of
boundaries, incorporating a non-uniform transformation.
SourceFiles
nonuniformTransformCyclicFvPatchField.C
nonuniformTransformCyclicFvPatchFields.H
nonuniformTransformCyclicFvPatchFields.C
nonuniformTransformCyclicFvPatchFieldsFwd.H
\*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,21 @@ License
Class
Foam::processorFvPatchField
Group
grpCoupledBoundaryConditions
Description
Foam::processorFvPatchField
This boundary condition enables processor communication across patches.
\heading Patch usage
Example of the boundary condition specification:
\verbatim
myPatch
{
type processor;
}
\endverbatim
SourceFiles
processorFvPatchField.C
@ -45,7 +58,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class processorFvPatch Declaration
Class processorFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -24,11 +24,31 @@ License
Class
Foam::processorCyclicFvPatchField
Group
grpCoupledBoundaryConditions
Description
Foam::processorCyclicFvPatchField
This boundary condition enables processor communication across cyclic
patches.
\heading Patch usage
Example of the boundary condition specification:
\verbatim
myPatch
{
type processor;
}
\endverbatim
SeeAlso
Foam::processorFvPatchField
SourceFiles
processorCyclicFvPatchField.C
processorCyclicFvPatchFields.H
processorCyclicFvPatchFields.C
processorCyclicFvPatchFieldsFwd.H
\*---------------------------------------------------------------------------*/
@ -44,7 +64,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class processorCyclicFvPatch Declaration
Class processorCyclicFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -24,11 +24,27 @@ License
Class
Foam::symmetryFvPatchField
Group
grpConstraintBoundaryConditions
Description
Foam::symmetryFvPatchField
This boundary condition enforces a symmetry constraint
\heading Patch usage
Example of the boundary condition specification:
\verbatim
myPatch
{
type symmetryPlane;
}
\endverbatim
SourceFiles
symmetryFvPatchField.C
symmetryFvPatchFields.C
symmetryFvPatchFields.H
symmetryFvPatchFieldsFwd.H
\*---------------------------------------------------------------------------*/
@ -44,7 +60,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class symmetryFvPatch Declaration
Class symmetryFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,25 @@ License
Class
Foam::wedgeFvPatchField
Group
grpConstraintBoundaryConditions
Description
Foam::wedgeFvPatchField
This boundary condition is similar to the cyclic condition, except that
it is applied to 2-D geometries.
\heading Patch usage
Example of the boundary condition specification:
\verbatim
myPatch
{
type wedge;
}
\endverbatim
SeeAlso
Foam::cyclicFvPatchField
SourceFiles
wedgeFvPatchField.C
@ -44,7 +61,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class wedgeFvPatch Declaration
Class wedgeFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -292,6 +292,7 @@ void Foam::activeBaffleVelocityFvPatchVectorField::updateCoeffs()
void Foam::activeBaffleVelocityFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
writeEntryIfDifferent<word>(os, "p", "p", pName_);
os.writeKeyword("cyclicPatch")
<< cyclicPatchName_ << token::END_STATEMENT << nl;
os.writeKeyword("orientation")

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,65 @@ License
Class
Foam::activeBaffleVelocityFvPatchVectorField
Group
grpCoupledBoundaryConditions
Description
Boundary condition that modifies mesh areas based on velocity.
This velocity boundary condition simulates the opening of a baffle due
to local flow conditions, by merging the behaviours of wall and cyclic
conditions. The baffle joins two mesh regions, where the open fraction
determines the interpolation weights applied to each cyclic- and
neighbour-patch contribution.
We determine whether the baffle is opening or closing from the sign of
the net force across the baffle, from which the baffle open fraction is
updated using:
\f[
x = x_{old} + sign(F_{net})\frac{dt}{DT}
\f]
where
\vartable
x | baffle open fraction [0-1]
x_{old} | baffle open fraction on previous evaluation
dt | simulation time step
DT | time taken to open the baffle
F_{net} | net force across the baffle
\endvartable
The open fraction is then applied to scale the patch areas.
\heading Patch usage
\table
Property | Description | Required | Default value
p | pressure field name | no | p
cyclicPatch | cylclic patch name | yes |
orientation | 1 or -1 used to switch flow direction | yes|
openFraction | current opatch open fraction [0-1]| yes |
openingTime | time taken to open the baffle | yes |
maxOpenFractionDelta | max open fraction change per timestep | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type activeBaffleVelocity;
p p;
cyclicPatch cyclic1;
orientation 1;
openFraction 0.2;
openingTime 5.0;
maxOpenFractionDelta 0.1;
}
\endverbatim
SeeAlso
Foam::fixedValueFvPatchField
Foam::cyclicFvPatchField
SourceFiles
activeBaffleVelocityFvPatchVectorField.C
@ -44,7 +101,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class activeBaffleVelocityFvPatch Declaration
Class activeBaffleVelocityFvPatchVectorField Declaration
\*---------------------------------------------------------------------------*/
class activeBaffleVelocityFvPatchVectorField
@ -163,17 +220,10 @@ public:
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap
(
const fvPatchFieldMapper&
);
virtual void autoMap(const fvPatchFieldMapper&);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchVectorField&,
const labelList&
);
virtual void rmap(const fvPatchVectorField&, const labelList&);
//- Update the coefficients associated with the patch field

View File

@ -92,7 +92,7 @@ activePressureForceBaffleVelocityFvPatchVectorField
)
:
fixedValueFvPatchVectorField(p, iF),
pName_("p"),
pName_(dict.lookupOrDefault<word>("p", "p")),
cyclicPatchName_(dict.lookup("cyclicPatch")),
cyclicPatchLabel_(p.patch().boundaryMesh().findPatchID(cyclicPatchName_)),
orientation_(readLabel(dict.lookup("orientation"))),
@ -278,6 +278,8 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::updateCoeffs()
{
valueDiff -=p[nbrFaceCells[facei]]*mag(initCyclicSf_[facei]);
}
Info<< "Force difference = " << valueDiff << endl;
}
else //pressure based
{
@ -290,6 +292,8 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::updateCoeffs()
{
valueDiff -= p[nbrFaceCells[facei]];
}
Info<< "Pressure difference = " << valueDiff << endl;
}
if ((mag(valueDiff) > mag(minThresholdValue_) || baffleActivated_))
@ -316,7 +320,6 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::updateCoeffs()
}
Info<< "Open fraction = " << openFraction_ << endl;
Info<< "Pressure difference = " << valueDiff << endl;
vectorField::subField Sfw = patch().patch().faceAreas();
vectorField newSfw((1 - openFraction_)*initWallSf_);
@ -351,6 +354,7 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::
write(Ostream& os) const
{
fvPatchVectorField::write(os);
writeEntryIfDifferent<word>(os, "p", "p", pName_);
os.writeKeyword("cyclicPatch")
<< cyclicPatchName_ << token::END_STATEMENT << nl;
os.writeKeyword("orientation")
@ -361,8 +365,6 @@ write(Ostream& os) const
<< maxOpenFractionDelta_ << token::END_STATEMENT << nl;
os.writeKeyword("openFraction")
<< openFraction_ << token::END_STATEMENT << nl;
os.writeKeyword("p")
<< pName_ << token::END_STATEMENT << nl;
os.writeKeyword("minThresholdValue")
<< minThresholdValue_ << token::END_STATEMENT << nl;
os.writeKeyword("forceBased")

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,12 +24,64 @@ License
Class
Foam::activePressureForceBaffleVelocityFvPatchVectorField
Description
Bounday which emulates the operation of a release pressure panel.
Group
grpCoupledBoundaryConditions
The boundary condition modifies mesh areas based on difference
of pressure or force face beween both sides of the panel. Once opened the
panel continues to open at a fixed rate.
Description
This boundary condition is applied to the flow velocity, to simulate the
opening of a baffle due to local flow conditions, by merging the behaviours
of wall and cyclic conditions.
The baffle joins two mesh regions, where the open fraction determines
the interpolation weights applied to each cyclic- and neighbour-patch
contribution.
Once opened the baffle continues to open at a fixed rate using
\f[
x = x_{old} + \frac{dt}{DT}
\f]
where
\vartable
x | baffle open fraction [0-1]
x_{old} | baffle open fraction on previous evaluation
dt | simulation time step
DT | time taken to open the baffle
\endvartable
The open fraction is then applied to scale the patch areas.
\heading Patch usage
\table
Property | Description | Required | Default value
p | pressure field name | no | p
cyclicPatch | cylclic patch name | yes |
orientation | 1 or -1 used to switch flow direction | yes|
openFraction | current opatch open fraction [0-1]| yes |
openingTime | time taken to open the baffle | yes |
maxOpenFractionDelta | max open fraction change per timestep | yes |
minThresholdValue | minimum open fraction for activation | yes |
forceBased | force (true) or pressure-based (false) activation | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type activePressureForceBaffleVelocity;
p p;
cyclicPatch cyclic1;
orientation 1;
openFraction 0.2;
openingTime 5.0;
maxOpenFractionDelta 0.1;
minThresholdValue 0.01;
forceBased false;
}
\endverbatim
SourceFiles
activePressureForceBaffleVelocityFvPatchVectorField.C
@ -48,7 +100,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class activePressureForceBaffleVelocityFvPatch Declaration
Class activePressureForceBaffleVelocityFvPatchVectorField Declaration
\*---------------------------------------------------------------------------*/
class activePressureForceBaffleVelocityFvPatchVectorField
@ -102,6 +154,7 @@ class activePressureForceBaffleVelocityFvPatchVectorField
//- Baffle is activated
bool baffleActivated_;
public:
//- Runtime type information

View File

@ -24,37 +24,53 @@ License
Class
Foam::advectiveFvPatchField
Group
grpOutletBoundaryConditions
Description
Advective outflow boundary condition based on solving DDt(psi, U) = 0
at the boundary.
This boundary condition provides an advective outflow condition, based on
solving DDt(psi, U) = 0 at the boundary.
The standard (Euler, backward, CrankNicholson) time schemes are
supported. Additionally an optional mechanism to relax the value at
the boundary to a specified far-field value is provided which is
switched on by specifying the relaxation length-scale lInf and the
far-field value fieldInf.
switched on by specifying the relaxation length-scale \c lInf and the
far-field value \c fieldInf.
The flow/wave speed at the outlet is provided by the virtual function
advectionSpeed() the default implementation of which requires the name of
the flux field (phi) and optionally the density (rho) if the mass-flux
rather than the volumetric-flux is given.
\verbatim
outlet
{
type advective;
phi phi;
// rho rho; // Not needed, phi volumetric
// fieldInf 1e5; // Optional
// lInf 0.1; // Optional
}
\endverbatim
the flux field \c (phi) and optionally the density \c (rho) if the
mass-flux rather than the volumetric-flux is given.
The flow/wave speed at the outlet can be changed by deriving a specialised
BC from this class and overriding advectionSpeed() e.g. in
BC from this class and over-riding advectionSpeed() e.g. in
waveTransmissiveFvPatchField the advectionSpeed() calculates and returns
the flow-speed plus the acoustic wave speed creating an acoustic wave
transmissive boundary condition.
\heading Patch usage
\table
Property | Description | Required | Default value
phi | flux field name | no | phi
rho | density field name | no | rho
fieldInf | value of field beyond patch | no |
lInf | distance beyond patch for \c fieldInf | no |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type advective;
phi phi;
}
\endverbatim
Note
If \c lInf is specified, \c fieldInf will be required; \c rho is only
required in the case of a mass-based flux.
SourceFiles
advectiveFvPatchField.C
@ -71,7 +87,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class advectiveFvPatch Declaration
Class advectiveFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,11 +24,58 @@ License
Class
Foam::buoyantPressureFvPatchScalarField
Description
Set the pressure gradient boundary condition appropriately for buoyant flow.
Group
grpGenericBoundaryConditions grpWallBoundaryConditions
If the variable name is "pd" assume it is p - rho*g.h and set the gradient
appropriately. Otherwise assume the variable is the static pressure.
Description
This boundary condition sets the pressure gradient appropriately for
buoyant flow.
If the variable name is one of:
- \c pd
- \c p_rgh
- \c ph_rgh
we assume that the pressure variable is \f$p - \rho(g \cdot h)\f$ and the
gradient set using:
\f[
\nabla(p) = -\nabla_\perp(\rho)(g \cdot h)
\f]
where
\vartable
\rho | density [kg/m3]
g | acceleration due to gravity [m/s2]
h | patch face centres [m]
\endvartable
Otherwise we assume that it is the static pressure, and the gradient
calculated using:
\f[
\nabla(p) = \rho(g \cdot n)
\f]
where
\vartable
n | patch face normal vectors
\endvartable
\heading Patch usage
\table
Property | Description | Required | Default value
rho | density field name | no | rho
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type buoyantPressure;
rho rho;
value uniform 0;
}
\endverbatim
SourceFiles
buoyantPressureFvPatchScalarField.C
@ -47,7 +94,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class buoyantPressureFvPatch Declaration
Class buoyantPressureFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class buoyantPressureFvPatchScalarField

View File

@ -24,41 +24,46 @@ License
Class
Foam::codedFixedValueFvPatchField
Group
grpGenericBoundaryConditions
Description
Constructs on-the-fly a new boundary condition (derived from
fixedValueFvPatchField) which is then used to evaluate.
\heading Patch usage
Example:
\verbatim
movingWall
{
type codedFixedValue;
value uniform 0;
redirectType rampedFixedValue; // name of generated bc
myPatch
{
type codedFixedValue;
value uniform 0;
redirectType rampedFixedValue; // name of generated BC
code
#{
operator==(min(10, 0.1*this->db().time().value()));
#};
code
#{
operator==(min(10, 0.1*this->db().time().value()));
#};
//codeInclude
//#{
// #include "fvCFD.H"
//#};
//codeInclude
//#{
// #include "fvCFD.H"
//#};
//codeOptions
//#{
// -I$(LIB_SRC)/finiteVolume/lnInclude
//#};
}
//codeOptions
//#{
// -I$(LIB_SRC)/finiteVolume/lnInclude
//#};
}
\endverbatim
A special form is if the 'code' section is not supplied. In this case
the code gets read from a (runTimeModifiable!) dictionary system/codeDict
which would have a corresponding entry
the code is read from a (runTimeModifiable!) dictionary system/codeDict
which would have a corresponding entry:
\verbatim
rampedFixedValue
myPatch
{
code
#{
@ -68,7 +73,8 @@ Description
\endverbatim
SeeAlso
Foam::dynamicCode and Foam::functionEntries::codeStream
Foam::dynamicCode
Foam::functionEntries::codeStream
SourceFiles
codedFixedValueFvPatchField.C
@ -92,7 +98,7 @@ class dynamicCodeContext;
class IOdictionary;
/*---------------------------------------------------------------------------*\
Class codedFixedValueFvPatch Declaration
Class codedFixedValueFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
@ -110,6 +116,7 @@ class codedFixedValueFvPatchField
mutable autoPtr<fvPatchField<Type> > redirectPatchFieldPtr_;
// Private Member Functions
const IOdictionary& dict() const;
@ -132,6 +139,7 @@ class codedFixedValueFvPatchField
// Get the dictionary to initialize the codeContext
virtual const dictionary& codeDict() const;
public:
// Static data members
@ -209,8 +217,6 @@ public:
}
// Member functions
//- Get reference to the underlying patch

View File

@ -24,41 +24,42 @@ License
Class
Foam::codedMixedFvPatchField
Group
grpGenericBoundaryConditions
Description
Constructs on-the-fly a new boundary condition (derived from
mixedFvPatchField) which is then used to evaluate.
\heading Patch usage
Example:
\verbatim
movingWall
{
type codedMixed;
myPatch
{
type codedMixed;
value uniform 0;
redirectType rampedMixed; // name of generated BC
refValue uniform (0 0 0);
refGradient uniform (0 0 0);
valueFraction uniform 1;
code
#{
this->refValue() =
vector(1, 0, 0)
*min(10, 0.1*this->db().time().value());
this->refGrad() = vector::zero;
this->valueFraction() = 1.0;
#};
redirectType rampedMixed; // name of generated bc
//codeInclude
//#{
// #include "fvCFD.H"
//#};
code
#{
this->refValue() =
vector(1, 0, 0)
*min(10, 0.1*this->db().time().value());
this->refGrad() = vector::zero;
this->valueFraction() = 1.0;
#};
//codeInclude
//#{
// #include "fvCFD.H"
//#};
//codeOptions
//#{
// -I$(LIB_SRC)/finiteVolume/lnInclude
//#};
}
//codeOptions
//#{
// -I$(LIB_SRC)/finiteVolume/lnInclude
//#};
}
\endverbatim
A special form is if the 'code' section is not supplied. In this case
@ -66,19 +67,20 @@ Description
which would have a corresponding entry
\verbatim
rampedMixed
{
code
#{
this->refValue() = min(10, 0.1*this->db().time().value());
this->refGrad() = vector::zero;
this->valueFraction() = 1.0;
#};
}
myPatch
{
code
#{
this->refValue() = min(10, 0.1*this->db().time().value());
this->refGrad() = vector::zero;
this->valueFraction() = 1.0;
#};
}
\endverbatim
SeeAlso
Foam::dynamicCode and Foam::functionEntries::codeStream
Foam::dynamicCode
Foam::functionEntries::codeStream
SourceFiles
codedMixedFvPatchField.C
@ -102,7 +104,7 @@ class dynamicCodeContext;
class IOdictionary;
/*---------------------------------------------------------------------------*\
Class codedMixedFvPatch Declaration
Class codedMixedFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
@ -120,6 +122,7 @@ class codedMixedFvPatchField
mutable autoPtr<mixedFvPatchField<Type> > redirectPatchFieldPtr_;
// Private Member Functions
const IOdictionary& dict() const;
@ -142,6 +145,7 @@ class codedMixedFvPatchField
// Get the dictionary to initialize the codeContext
virtual const dictionary& codeDict() const;
public:
// Static data members
@ -219,8 +223,6 @@ public:
}
// Member functions
//- Get reference to the underlying patchField

View File

@ -2,16 +2,16 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 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 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
@ -19,19 +19,33 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::cylindricalInletVelocityFvPatchVectorField
Group
grpInletBoundaryConditions
Description
Describes an inlet vector boundary condition in cylindrical coordinates
given a central axis, central point, rpm, axial and radial velocity.
This boundary condition describes an inlet vector boundary condition in
cylindrical co-ordinates given a central axis, central point, rpm, axial
and radial velocity.
\heading Patch usage
\table
Property | Description | Required | Default value
axis | axis of rotation | yes |
centre | centre of rotation | yes |
axialVelocity | axial velocity profile [m/s] | yes |
radialVelocity | radial velocity profile [m/s] | yes |
rpm | rotational speed (revolutions per minute) | yes|
\endtable
Example of the boundary condition specification:
\verbatim
inlet
myPatch
{
type cylindricalInletVelocity;
axis (0 0 1);
@ -42,9 +56,14 @@ Description
}
\endverbatim
The axialVelocity, radialVelocity and rpm entries are DataEntry types, able
to describe time varying functions. The example above gives the usage for
supplying constant values.
Note
The \c axialVelocity, \c radialVelocity and \c rpm entries are DataEntry
types, able to describe time varying functions. The example above gives
the usage for supplying constant values.
SeeAlso
Foam::fixedValueFvPatchField
Foam::DataEntry
SourceFiles
cylindricalInletVelocityFvPatchVectorField.C

View File

@ -24,47 +24,59 @@ License
Class
Foam::fanFvPatchField
Group
grpCoupledBoundaryConditions
Description
Jump boundary condition. Operates on cyclic. Jump specified as a DataEntry.
(table, fileTable, csv etc.)
This boundary condition provides a jump condition, using the \c cyclic
condition as a base.
The jump is specified as a \c DataEntry type, to enable the use of, e.g.
contant, polynomial, table values.
\heading Patch usage
\table
Property | Description | Required | Default value
patchType | underlying patch type should be \c cyclic| yes |
jump | current jump value | yes |
jumpTable | jump data, e.g. \c csvFile | yes |
\endtable
Example of the boundary condition specification:
\verbatim
fan_half0
myPatch
{
type fan;
patchType cyclic;
jump uniform 0;
jumpTable csvFile;
csvFileCoeffs
{
type fan;
patchType cyclic;
jump uniform 0;
jumpTable csvFile;
csvFileCoeffs
{
hasHeaderLine 1;
refColumn 0;
componentColumns 1(1);
separator ",";
fileName "$FOAM_CASE/constant/pressureVsU";
}
value uniform 0;
hasHeaderLine 1;
refColumn 0;
componentColumns 1(1);
separator ",";
fileName "$FOAM_CASE/constant/pressureVsU";
}
value uniform 0;
}
\endverbatim
The above example shows the use of a comma separated (CSV) file to specify
the jump condition.
Backwards compatibility: if the 'f' keyword is detected it assumes
it is a power of the flowrate.
Note
The underlying \c patchType should be set to \c cyclic
\verbatim
fan_half0
{
type fan;
patchType cyclic;
jump uniform 0;
f 2(100 -0.1);
value uniform 0;
}
\endverbatim
SeeAlso
Foam::DataEntry
SourceFiles
fanFvPatchField.C
fanFvPatchFields.H
fanFvPatchFields.C
fanFvPatchFieldsFwd.H
\*---------------------------------------------------------------------------*/

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,43 +24,53 @@ License
Class
Foam::fanPressureFvPatchScalarField
Description
Assigns pressure inlet or outlet total pressure condition for a fan.
Group
grpInletBoundaryConditions grpOutletBoundaryConditions
User specifies:
- pressure drop vs volumetric flow rate table (fan curve) file name;
- direction of normal flow through the fan, in or out;
- total pressure of the environment.
Description
This boundary condition can be applied to assign either a pressure inlet
or outlet total pressure condition for a fan.
\heading Patch usage
\table
Property | Description | Required | Default value
fileName | fan curve file name | yes |
outOfBounds | out of bounds handling | yes |
direction | direction of flow through fan [in/out] | yes |
p0 | environmental total pressure | yes |
\endtable
Example of the boundary condition specification:
\verbatim
inlet
{
type fanPressure;
fileName "fanCurve"; // Fan curve file name
outOfBounds clamp; // (error|warn|clamp|repeat)
direction in; // Direction of flow through fan
p0 uniform 0; // Environmental total pressure
value uniform 0; // Initial pressure
}
inlet
{
type fanPressure;
fileName "fanCurve";
outOfBounds clamp;
direction in;
p0 uniform 0;
value uniform 0;
}
outlet
{
type fanPressure;
fileName "fanCurve"; // Fan curve file name
outOfBounds clamp; // (error|warn|clamp|repeat)
direction out; // Direction of flow through fan
p0 uniform 0; // Environmental total pressure
value uniform 0; // Initial pressure
}
outlet
{
type fanPressure;
fileName "fanCurve";
outOfBounds clamp;
direction out;
p0 uniform 0;
value uniform 0;
}
\endverbatim
See Also
Foam::totalPressureFvPatchScalarField and
Foam::fanFvPatchField
Foam::totalPressureFvPatchScalarField
Foam::interpolationTable
SourceFiles
fanPressureFvPatchScalarField.C
fanPressureFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
@ -93,8 +103,10 @@ public:
ffdOut
};
//- Fan flow directions names
static const NamedEnum<fanFlowDirection, 2> fanFlowDirectionNames_;
private:
// Private data

View File

@ -24,15 +24,53 @@ License
Class
Foam::fixedFluxPressureFvPatchScalarField
Group
grpOutletBoundaryConditions
Description
Adjusts the pressure gradient such that the flux on the boundary is that
specified by the velocity boundary condition.
This boundary condition adjusts the pressure gradient such that the flux
on the boundary is that specified by the velocity boundary condition.
The predicted flux to be compensated by the pressure gradient is evaluated
as (phi - phiHbyA), both of which are looked-up from the database as is
the pressure diffusivity Dp used to calculate the gradient.
as \f$(\phi - \phi_{H/A})\f$, both of which are looked-up from the database,
as is the pressure diffusivity used to calculate the gradient using:
The names of the phi, phiHbyA and Dp fields may be optionally specified.
\f[
\nabla(p) = \frac{\phi_{H/A} - \phi}{|Sf| D_p}
\f]
where
\vartable
phi | flux
D_p | pressure diffusivity
Sf | patch face areas [m2]
\endvartable
\heading Patch usage
\table
Property | Description | Required | Default value
phiHbyA | name of predicted flux field | no | phiHbyA
phi | name of flux field | no | phi
rho | name of density field | no | rho
Dp | name of pressure diffusivity field | no | Dp
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type fixedFluxPressure;
phiHbyA phiHbyA;
phi phi;
rho rho;
Dp Dp;
}
\endverbatim
SeeAlso
Foam::fixedGradientFvPatchField
SourceFiles
fixedFluxPressureFvPatchScalarField.C
@ -52,7 +90,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class fixedFluxPressureFvPatch Declaration
Class fixedFluxPressureFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class fixedFluxPressureFvPatchScalarField

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,11 +24,33 @@ License
Class
Foam::fixedInternalValueFvPatchField
Group
grpGenericBoundaryConditions
Description
Boundary condition providing mechanism to set boundary (cell) values
directly into a matrix, i.e. to set a constraint condition. Default
This boundary condition provides a mechanism to set boundary (cell) values
directly into a matrix, i.e. to set a constraint condition. Default
behaviour is to act as a zero gradient condition.
\heading Patch usage
Example of the boundary condition specification:
\verbatim
myPatch
{
type fixedInternalValue;
value uniform 0; // place holder
}
\endverbatim
Note
This is used as a base for conditions such as the turbulence \c epsilon
wall function, which applies a near-wall constraint for high Reynolds
number flows.
SeeAlso
Foam::epsilonWallFunctionFvPatchScalarField
SourceFiles
fixedInternalValueFvPatchField.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,9 +24,19 @@ License
Class
Foam::fixedJumpFvPatchField
Group
grpCoupledBoundaryConditions
Description
Base class for "jump" of a field<type>
Note
not used directly
SeeAlso
Foam::fanFvPatchScalarField
Foam::fanPressureFvPatchScalarField
SourceFiles
fixedJumpFvPatchField.C
@ -62,7 +72,6 @@ protected:
public:
// Constructors
//- Construct from patch and internal field

View File

@ -24,9 +24,31 @@ License
Class
Foam::fixedMeanFvPatchField
Group
grpGenericBoundaryConditions
Description
Extrapolates field to the patch using the near-cell values and adjusts
the distribution to match the specified meanValue.
This boundary condition extrapolates field to the patch using the near-cell
values and adjusts the distribution to match the specified mean value.
\heading Patch usage
\table
Property | Description | Required | Default value
meanValue | mean value | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type fixedMean;
meanValue 1.0;
}
\endverbatim
SeeAlso
Foam::fixedValueFvPatchField
SourceFiles
fixedMeanFvPatchField.C
@ -44,7 +66,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class fixedMeanFvPatch Declaration
Class fixedMeanFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,30 @@ License
Class
Foam::fixedNormalSlipFvPatchField
Group
grpGenericBoundaryConditions grpWallBoundaryConditions
Description
Foam::fixedNormalSlipFvPatchField
This boundary condition sets the patch-normal component to a fixed value.
\heading Patch usage
\table
Property | Description | Required | Default value
fixedValue | fixed value | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type fixedNormalSlip;
fixedValue uniform 0; // example entry for a scalar field
}
\endverbatim
SeeAlso
Foam::transformFvPatchField
SourceFiles
fixedNormalSlipFvPatchField.C
@ -43,7 +65,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class fixedNormalSlipFvPatch Declaration
Class fixedNormalSlipFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,20 +24,50 @@ License
Class
Foam::fixedPressureCompressibleDensityFvPatchScalarField
Group
grpInletBoundaryConditions
Description
Calculate compressible density as a function of pressure and fluid
properties.
This boundary condition calculates a (liquid) compressible density as a
function of pressure and fluid properties:
\f[
\rho = \rho_{l,sat} + \psi_l*(p - p_{sat})
\f]
where
\vartable
\rho | density [kg/m3]
\rho_{l,sat} | saturation liquid density [kg/m3]
\psi_l | liquid compressibility
p | pressure [Pa]
p_{sat} | saturation pressure [Pa]
\endvartable
The variables \c rholSat, \c pSat and \c psil are retrieved from the
\c thermodynamicProperties dictionary.
\heading Patch usage
\table
Property | Description | Required | Default value
p | pressure field name | no | p
\endtable
Example of the boundary condition specification:
\verbatim
inlet
{
type fixedPressureCompressibleDensity;
p p; // Name of static pressure field
value uniform 1; // Initial value
}
myPatch
{
type fixedPressureCompressibleDensity;
p p;
value uniform 1;
}
\endverbatim
SeeAlso
Foam::fixedValueFvPatchField
SourceFiles
fixedPressureCompressibleDensityFvPatchScalarField.C

View File

@ -24,37 +24,67 @@ License
Class
Foam::flowRateInletVelocityFvPatchVectorField
Group
grpInletBoundaryConditions
Description
Describes a volumetric/mass flow normal vector boundary condition by its
magnitude as an integral over its area.
This boundary condition provides a velocity boundary condition, derived
from the flux (volumetric or mass-based), whose direction is assumed
to be normal to the patch.
Either specify 'volumetricFlowRate' or 'massFlowRate' (requires additional
'rho' or 'rhoInlet' entry).
For a mass-based flux:
- the flow rate should be provided in kg/s
- if \c rhoName is "none" the flow rate is in m3/s
- otherwise \c rhoName should correspond to the name of the density field
- if the density field cannot be found in the database, the user must
specify the inlet density using the \c rhoInlet entry
Example of the boundary condition specification:
For a volumetric-based flux:
- the flow rate is in m3/s
\heading Patch usage
\table
Property | Description | Required | Default value
massFlowRate | mass flow rate [kg/s] | no |
volumetricFlowRate | volumetric flow rate [m3/s]| no |
rhoInlet | inlet density | no |
\endtable
Example of the boundary condition specification for a volumetric flow rate:
\verbatim
inlet
myPatch
{
type flowRateInletVelocity;
volumetricFlowRate 0.2; // Volumetric [m3/s]
type flowRateInletVelocity;
volumetricFlowRate 0.2;
value uniform (0 0 0); // placeholder
}
\endverbatim
Example of the boundary condition specification for a mass flow rate:
\verbatim
inlet
myPatch
{
type flowRateInletVelocity;
massFlowRate 0.2; // mass flow rate [kg/s]
rho rho; // rho [m3/s or kg/s]
rhoInlet 1.0 // uniform rho if no rho field registered
// (e.g. at startup)
massFlowRate 0.2;
rho rho;
rhoInlet 1.0;
}
\endverbatim
The \c flowRate entry is a \c DataEntry type, meaning that it can be
specified as constant, a polynomial fuction of time, and ...
Note
- The value is positive inwards
- May not work correctly for transonic inlets
- Strange behaviour with potentialFoam since the U equation is not solved
- \c rhoInlet is required for the case of a mass flow rate, where the
density field is not available at start-up
- the value is positive into the domain (as an inlet)
- may not work correctly for transonic inlets
- strange behaviour with potentialFoam since the U equation is not solved
SeeAlso
Foam::DataEntry
Foam::fixedValueFvPatchField
SourceFiles
flowRateInletVelocityFvPatchVectorField.C
@ -72,7 +102,7 @@ SourceFiles
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class flowRateInletVelocityFvPatch Declaration
Class flowRateInletVelocityFvPatchVectorField Declaration
\*---------------------------------------------------------------------------*/
class flowRateInletVelocityFvPatchVectorField

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,8 +29,6 @@ License
#include "volFields.H"
#include "surfaceFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fluxCorrectedVelocityFvPatchVectorField::

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,11 +24,53 @@ License
Class
Foam::fluxCorrectedVelocityFvPatchVectorField
Group
grpOutletBoundaryConditions
Description
Velocity outlet boundary condition for patches where the pressure is
specified. The outflow velocity is obtained by "zeroGradient" and then
corrected from the flux. If reverse flow is possible or expected use
the "pressureInletOutletVelocityFvPatchVectorField" BC instead.
This boundary condition provides a velocity outlet boundary condition for
patches where the pressure is specified. The outflow velocity is obtained
by "zeroGradient" and then corrected from the flux:
\f[
U_p = U_c - n*(n.U_c) + \frac{n*\phi_p}{|Sf|}
\f]
where
\vartable
U_p | velocity at the patch [m/s]
U_c | velocity in cells adjacent to the patch [m/s]
n | patch normal vectors
\phi_p | flux at the patch [m3/s or kg/s]
Sf | patch face area vectors [m2]
\endvartable
where
\table
Property | Description | Required | Default value
phi | name of flux field | no | phi
rho | name of density field | no | rho
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type fluxCorrectedVelocity;
phi phi;
rho rho;
}
\endverbatim
Note
If reverse flow is possible or expected use the
pressureInletOutletVelocity condition instead.
SeeAlso
Foam::zeroGradientFvPatchField
Foam::pressureInletOutletVelocityFvPatchVectorField
SourceFiles
fluxCorrectedVelocityFvPatchVectorField.C
@ -47,7 +89,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class fluxCorrectedVelocityFvPatch Declaration
Class fluxCorrectedVelocityFvPatchVectorField Declaration
\*---------------------------------------------------------------------------*/
class fluxCorrectedVelocityFvPatchVectorField
@ -56,7 +98,10 @@ class fluxCorrectedVelocityFvPatchVectorField
{
// Private data
//- Name of flux field
word phiName_;
//- Name of density field
word rhoName_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,34 @@ License
Class
Foam::freestreamFvPatchField
Group
grpInletBoundaryConditions grpOutletBoundaryConditions
Description
Foam::freestreamFvPatchField
This boundary condition provides a free-stream condition. It is a 'mixed'
condition derived from the \c inletOutlet condition, whereby the mode of
operation switches between fixed (free stream) value and zero gradient
based on the sign of the flux.
\heading Patch usage
\table
Property | Description | Required | Default value
phi | flux field name | no | phi
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type freestream;
phi phi;
}
\endverbatim
SeeAlso
Foam::mixedFvPatchField
Foam::inletOutletFvPatchField
SourceFiles
freestreamFvPatchField.C
@ -43,7 +69,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class freestreamFvPatch Declaration
Class freestreamFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,30 @@ License
Class
Foam::freestreamPressureFvPatchScalarField
Group
grpInletBoundaryConditions grpOutletBoundaryConditions
Description
Foam::freestreamPressureFvPatchScalarField
This boundary condition provides a free-stream condition for pressure.
It is a zero-gradient condition that constrains the flux across the patch
based on the free-stream velocity.
\heading Patch usage
Example of the boundary condition specification:
\verbatim
myPatch
{
type freestreamPressure;
}
\endverbatim
Note
This condition is designed to operate with a freestream velocity condition
SeeAlso
Foam::zeroGradientFvPatchField
Foam::freestreamFvPatchField
SourceFiles
freestreamPressureFvPatchScalarField.C
@ -44,7 +66,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class freestreamPressureFvPatch Declaration
Class freestreamPressureFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class freestreamPressureFvPatchScalarField

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,43 @@ License
Class
Foam::inletOutletFvPatchField
Group
grpOutletBoundaryConditions
Description
Foam::inletOutletFvPatchField
This boundary condition provides a generic outflow condition, with
specified inflow for the case of return flow.
\heading Patch usage
\table
Property | Description | Required | Default value
phi | flux field name | no | phi
inletValue | inlet value for reverse flow | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type inletOutlet;
phi phi;
inletValue uniform 0;
value uniform 0;
}
\endverbatim
The mode of operation is determined by the sign of the flux across the
patch faces.
Note
Sign conventions:
- positive flux (out of domain): apply zero-gradient condition
- negative flux (into of domain): apply the user-specified fixed value
SeeAlso
Foam::mixedFvPatchField
Foam::zeroGradientFvPatchField
SourceFiles
inletOutletFvPatchField.C
@ -43,7 +78,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class inletOutletFvPatch Declaration
Class inletOutletFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,43 @@ License
Class
Foam::inletOutletTotalTemperatureFvPatchScalarField
Group
grpOutletBoundaryConditions
Description
Foam::inletOutletTotalTemperatureFvPatchScalarField
This boundary condition provides an outflow condition for total
temperature for use with supersonic cases, where a user-specified
value is applied in the case of reverse flow.
\heading Patch usage
\table
Property | Description | Required | Default value
U | velocity field name | no | U
phi | flux field name | no | phi
psi | compressibility field name | no | psi
gamma | heat capacity ration (Cp/Cv) | yes |
inletValue | reverse flow (inlet) value | yes |
T0 | static temperature [K] | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type inletOutletTotalTemperature;
U U;
phi phi;
psi psi;
gamma gamma;
inletValue uniform 0;
T0 uniform 0;
value uniform 0;
}
\endverbatim
SeeAlso
Foam::inletOutletFvPatchField
SourceFiles
inletOutletTotalTemperatureFvPatchScalarField.C
@ -43,7 +78,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class inletOutletTotalTemperatureFvPatch Declaration
Class inletOutletTotalTemperatureFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class inletOutletTotalTemperatureFvPatchScalarField

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,11 +24,47 @@ License
Class
Foam::mappedFieldFvPatchField
Group
grpGenericBoundaryConditions grpCoupledBoundaryConditions
Description
Self-contained version of mapped. Does not use information on
patch, instead holds it locally (and possibly duplicate) so use
normal mapped in preference and only use this if you cannot
change the underlying patch type to mapped.
This boundary condition provides a self-contained version of the \c mapped
condition. It does not use information on the patch; instead it holds
thr data locally.
\heading Patch usage
\table
Property | Description | Required | Default value
fieldName | name of field to be mapped | no | this field name
setAverage | flag to activate setting of average value | yes |
average | average value to apply if \c setAverage = yes | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type mappedField;
fieldName T; // optional field name
setAverage no; // apply an average value
average 0; // average to apply if setAverage
value uniform 0; // place holder
}
\endverbatim
Note
Since this condition can be applied on a per-field and per-patch basis,
it is possible to duplicate the mapping information. If possible, employ
the \c mapped condition in preference to avoid this situation, and only
employ this condition if it is not possible to change the underlying
geometric (poly) patch type to \c mapped.
SeeAlso
Foam::mappedPatchBase
Foam::mappedPolyPatch
Foam::mappedFvPatch
Foam::fixedValueFvPatchField
SourceFiles
mappedFieldFvPatchField.C
@ -48,7 +84,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class mappedFieldFvPatchField Declaration
Class mappedFieldFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,9 +24,42 @@ License
Class
Foam::mappedFixedInternalValueFvPatchField
Group
grpGenericBoundaryConditions grpCoupledBoundaryConditions
Description
Recycles the boundary and internal values of a neighbour patch field to
the boundary and internal values of *this.
This boundary condition maps the boundary and internal values of a
neighbour patch field to the boundary and internal values of *this.
\heading Patch usage
\table
Property | Description | Required | Default value
fieldName | name of field to be mapped | no | this field name
setAverage | flag to activate setting of average value | yes |
average | average value to apply if \c setAverage = yes | yes |
\endtable
\verbatim
myPatch
{
type mappedFixedInternalValue;
fieldName T;
setAverage no;
average 0;
value uniform 0;
}
\endverbatim
Note
This boundary condition can only be applied to patches that are of
the \c mappedPolyPatch type.
SeeAlso
Foam::mappedPatchBase
Foam::mappedPolyPatch
Foam::mappedFvPatch
Foam::mappedFixedValueFvPatchField
SourceFiles
mappedFixedInternalValueFvPatchField.C
@ -44,7 +77,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class mappedFixedInternalValueFvPatchField Declaration
Class mappedFixedInternalValueFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,9 +24,43 @@ License
Class
Foam::mappedFixedPushedInternalValueFvPatchField
Group
grpGenericBoundaryConditions grpCoupledBoundaryConditions
Description
Recycles the boundary values of a neighbour patch field to the boundary
and internal values of *this.
This boundary condition maps the boundary values of a neighbour patch
field to the boundary and internal cell values of *this.
\heading Patch usage
\table
Property | Description | Required | Default value
fieldName | name of field to be mapped | no | this field name
setAverage | flag to activate setting of average value | yes |
average | average value to apply if \c setAverage = yes | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type mappedFixedPushedInternalValue;
fieldName T;
setAverage no;
average 0;
value uniform 0;
}
\endverbatim
Note
This boundary condition can only be applied to patches that are of
the \c mappedPolyPatch type.
SeeAlso
Foam::mappedPatchBase
Foam::mappedPolyPatch
Foam::mappedFvPatch
Foam::mappedFixedValueFvPatchField
SourceFiles
mappedFixedPushedInternalValueFvPatchField.C
@ -44,7 +78,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class mappedFixedPushedInternalValueFvPatchField Declaration
Class mappedFixedPushedInternalValueFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,27 +24,55 @@ License
Class
Foam::mappedFixedValueFvPatchField
Group
grpGenericBoundaryConditions grpCoupledBoundaryConditions
Description
Recycles the value at a set of cells or patch faces back to *this. Can not
sample internal faces (since volField not defined on faces).
This boundary condition maps the value at a set of cells or patch faces
back to *this.
mode = NEARESTCELL : sample nearest cell
mode = NEARESTPATCHFACE : sample nearest face on selected patch
mode = NEARESTFACE : sample nearest face on any patch. Note: does not
warn if nearest actually is on internal face!
mode = NEARESTPATCHFACEAMI : sample nearest face on selected patch
patches can be non-conformal - method uses AMI interpolation
The sample mode is set by the underlying mapping engine, provided by the
mappedPatchBase class.
\heading Patch usage
For NEARESTCELL you have to provide an 'interpolationScheme' entry
which can be any one of the interpolation schemes (cell, cellPoint, etc.)
In case of interpolation (so scheme != cell) the limitation is that
there is only one value per cell. So e.g. if you have a cell with two
boundary faces and both faces sample into the cell both faces will get
the same value.
\table
Property | Description | Required | Default value
fieldName | name of field to be mapped | no | this field name
setAverage | flag to activate setting of average value | yes |
average | average value to apply if \c setAverage = yes | yes |
interpolationScheme | type of interpolation scheme | no |
\endtable
See mappedPatchBase for options on sampling.
Example of the boundary condition specification:
\verbatim
myPatch
{
type mapped;
fieldName T;
setAverage no;
average 0;
interpolationScheme cell;
value uniform 0;
}
\endverbatim
Optional 'fieldName' entry to supply a different filename
When employing the \c nearestCell sample mode, the user must also specify
the interpolation scheme using the \c interpolationScheme entry.
In case of interpolation (where scheme != cell) the limitation is that
there is only one value per cell. For example, if you have a cell with two
boundary faces and both faces sample into the cell, both faces will get the
same value.
Note
It is not possible to sample internal faces since volume fields are not
defined on faces.
SeeAlso
Foam::mappedPatchBase
Foam::interpolation
Foam::fixedValueFvPatchField
SourceFiles
mappedFixedValueFvPatchField.C
@ -63,7 +91,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class mappedFixedValueFvPatch Declaration
Class mappedFixedValueFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,31 +24,39 @@ License
Class
Foam::mappedFlowRateFvPatchVectorField
Group
grpInletBoundaryConditions grpCoupledBoundaryConditions
Description
Describes a volumetric/mass flow normal vector boundary condition by its
magnitude as an integral over its area.
The inlet mass flux is taken from the neighbor region.
phi is used to determine if the flow is compressible or incompressible.
The inlet mass flux is taken from the neighbour region.
The basis of the patch (volumetric or mass) is determined by the
dimensions of the flux, phi.
The current density is used to correct the velocity when applying the
mass basis.
dimensions of the flux, phi. The current density is used to correct the
velocity when applying the mass basis.
\heading Patch usage
\table
Property | Description | Required | Default value
phi | flux field name | no | phi
rho | density field name | no | rho
neigPhi | name of flux field on neighbour mesh | yes |
\endtable
Example of the boundary condition specification:
@verbatim
inlet
\verbatim
myPatch
{
type mappedFlowRate;
phi phi;
rho rho;
neigPhi neigPhiName_; // Volumetric/mass flow rate
// [m3/s or kg/s]
neigPhi phi;
value uniform (0 0 0); // placeholder
}
@endverbatim
\endverbatim
SourceFiles
mappedFlowRateFvPatchVectorField.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,12 +24,42 @@ License
Class
Foam::mappedVelocityFluxFixedValueFvPatchField
Description
Recycles the velocity and flux at a patch to this patch
Group
grpInletBoundaryConditions grpCoupledBoundaryConditions
mode = NEARESTPATCHFACE : sample nearest face on selected patch
mode = NEARESTFACE : sample nearest face on any patch. Note: does not
warn if nearest actually is on internal face!
Description
This boundary condition maps the velocity and flux from a neighbour patch
to this patch
\heading Patch usage
\table
Property | Description | Required | Default value
phi | flux field name | no | phi
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type mappedVelocityFlux;
phi phi;
value uniform 0; // place holder
}
\endverbatim
The underlying sample mode should be set to \c nearestPatchFace or
\c nearestFace
Note
This boundary condition can only be applied to patches that are of
the \c mappedPolyPatch type.
SeeAlso
Foam::mappedPatchBase
Foam::mappedPolyPatch
Foam::mappedFvPatch
Foam::fixedValueFvPatchVectorField
SourceFiles
mappedVelocityFluxFixedValueFvPatchField.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,35 @@ License
Class
Foam::movingWallVelocityFvPatchVectorField
Group
grpWallBoundaryConditions
Description
Foam::movingWallVelocityFvPatchVectorField
This boundary condition provides a velocity condition for cases with
moving walls. In addition, it should also be applied to 'moving' walls
for moving reference frame (MRF) calculations.
\heading Patch usage
\table
Property | Description | Required | Default value
U | velociy field name | no | U
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type movingWallVelocity;
U U;
value uniform 0; // initial value
}
\endverbatim
SeeAlso
Foam::fixedValueFvPatchVectorField
Foam::MRFZone
SourceFiles
movingWallVelocityFvPatchVectorField.C
@ -44,7 +71,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class movingWallVelocityFvPatch Declaration
Class movingWallVelocityFvPatchVectorField Declaration
\*---------------------------------------------------------------------------*/
class movingWallVelocityFvPatchVectorField
@ -125,7 +152,6 @@ public:
}
// Member functions
//- Update the coefficients associated with the patch field

View File

@ -41,7 +41,8 @@ multiphaseFixedFluxPressureFvPatchScalarField
fixedGradientFvPatchScalarField(p, iF),
phiHbyAName_("phiHbyA"),
phiName_("phi"),
rhoName_("rho")
rhoName_("rho"),
DpName_("Dp")
{}
@ -57,7 +58,8 @@ multiphaseFixedFluxPressureFvPatchScalarField
fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
phiHbyAName_(ptf.phiHbyAName_),
phiName_(ptf.phiName_),
rhoName_(ptf.rhoName_)
rhoName_(ptf.rhoName_),
DpName_(ptf.DpName_)
{}
@ -72,7 +74,8 @@ multiphaseFixedFluxPressureFvPatchScalarField
fixedGradientFvPatchScalarField(p, iF),
phiHbyAName_(dict.lookupOrDefault<word>("phiHbyA", "phiHbyA")),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
DpName_(dict.lookupOrDefault<word>("Dp", "Dp"))
{
if (dict.found("gradient"))
{
@ -91,27 +94,29 @@ multiphaseFixedFluxPressureFvPatchScalarField
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
multiphaseFixedFluxPressureFvPatchScalarField
(
const multiphaseFixedFluxPressureFvPatchScalarField& wbppsf
const multiphaseFixedFluxPressureFvPatchScalarField& mfppsf
)
:
fixedGradientFvPatchScalarField(wbppsf),
phiHbyAName_(wbppsf.phiHbyAName_),
phiName_(wbppsf.phiName_),
rhoName_(wbppsf.rhoName_)
fixedGradientFvPatchScalarField(mfppsf),
phiHbyAName_(mfppsf.phiHbyAName_),
phiName_(mfppsf.phiName_),
rhoName_(mfppsf.rhoName_),
DpName_(mfppsf.DpName_)
{}
Foam::multiphaseFixedFluxPressureFvPatchScalarField::
multiphaseFixedFluxPressureFvPatchScalarField
(
const multiphaseFixedFluxPressureFvPatchScalarField& wbppsf,
const multiphaseFixedFluxPressureFvPatchScalarField& mfppsf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedGradientFvPatchScalarField(wbppsf, iF),
phiHbyAName_(wbppsf.phiHbyAName_),
phiName_(wbppsf.phiName_),
rhoName_(wbppsf.rhoName_)
fixedGradientFvPatchScalarField(mfppsf, iF),
phiHbyAName_(mfppsf.phiHbyAName_),
phiName_(mfppsf.phiName_),
rhoName_(mfppsf.rhoName_),
DpName_(mfppsf.DpName_)
{}
@ -155,7 +160,7 @@ void Foam::multiphaseFixedFluxPressureFvPatchScalarField::updateCoeffs()
*/
const fvsPatchField<scalar>& Dpp =
patch().lookupPatchField<surfaceScalarField, scalar>("Dp");
patch().lookupPatchField<surfaceScalarField, scalar>(DpName_);
gradient() = (phiHbyAp - phip)/patch().magSf()/Dpp;
@ -172,6 +177,7 @@ void Foam::multiphaseFixedFluxPressureFvPatchScalarField::write
writeEntryIfDifferent<word>(os, "phiHbyA", "phiHbyA", phiHbyAName_);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
writeEntryIfDifferent<word>(os, "Dp", "Dp", DpName_);
gradient().writeEntry("gradient", os);
writeEntry("value", os);
}

View File

@ -24,15 +24,50 @@ License
Class
Foam::multiphaseFixedFluxPressureFvPatchScalarField
Group
grpWallBoundaryConditions grpGenericBoundaryConditions
Description
Adjusts the pressure gradient such that the flux on the boundary is that
specified by the velocity boundary condition.
This boundary condition adjusts the pressure gradient such that the flux
on the boundary is that specified by the velocity boundary condition.
The predicted flux to be compensated by the pressure gradient is evaluated
as (phi - phiHbyA), both of which are looked-up from the database as is
the pressure diffusivity Dp used to calculate the gradient.
as \f$(\phi - \phi_{H/A})\f$, both of which are looked-up from the database,
as is the pressure diffusivity Dp used to calculate the gradient using:
The names of the phi, phiHbyA and Dp fields may be optionally specified.
\f[
\nabla(p) = \frac{\phi_{H/A} - \phi}{|Sf| Dp}
\f]
where
\vartable
\phi | flux
Dp | pressure diffusivity
Sf | patch face areas [m2]
\endvartable
\heading Patch usage
\table
Property | Description | Required | Default value
phiHbyA | name of predicted flux field | no | phiHbyA
phi | name of flux field | no | phi
rho | name of density field | no | rho
Dp | name of pressure diffusivity field | no | Dp
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type multiphaseFixedFluxPressure;
phiHbyA phiHbyA;
phi phi;
rho rho;
Dp Dp;
}
\endverbatim
SourceFiles
multiphaseFixedFluxPressureFvPatchScalarField.C
@ -71,6 +106,9 @@ class multiphaseFixedFluxPressureFvPatchScalarField
// if neccessary
word rhoName_;
//- Name of the pressure diffusivity field
word DpName_;
public:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,26 +24,58 @@ License
Class
Foam::oscillatingFixedValueFvPatchField
Group
grpGenericBoundaryConditions
Description
Describes an oscillating boundary condition in terms of amplitude and
frequency.
This boundary condition provides an oscillating condition in terms of
amplitude and frequency.
/f[
x_p = (1 + a sin(\pi f t))x_{ref} + x_o
/f]
where
\vartable
x_p | patch values
x_{ref} | patch reference values
x_o | patch offset values
a | amplitude
f | frequency [1/s]
t | time [s]
\endvartable
\heading Patch usage
\table
Property | Description | Required | Default value
refValue | reference value | yes |
offset | offset value | no | 0.0
amplitude | oscillation amplitude | yes |
frequency | oscillation frequency | yes |
\endtable
Example of the boundary condition specification:
\verbatim
inlet
myPatch
{
type oscillatingFixedValue;
refValue uniform 5.0;
offset 0.0; // optional
offset 0.0;
amplitude constant 0.5;
frequency constant 10;
}
\endverbatim
Note
The amplitude and frequency entries are DataEntry types, able to describe
time varying functions. The example above gives the usage for supplying
constant values.
SeeAlso
Foam::DataEntry
SourceFiles
oscillatingFixedValueFvPatchField.C
@ -62,7 +94,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class oscillatingFixedValueFvPatch Declaration
Class oscillatingFixedValueFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,39 @@ License
Class
Foam::outletInletFvPatchField
Group
grpInletBoundaryConditions
Description
Foam::outletInletFvPatchField
This boundary condition provides a generic inflow condition, with
specified outflow for the case of return flow.
\heading Patch usage
\table
Property | Description | Required | Default value
phi | flux field name | no | phi
inletValue | inlet value | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type outletInlet;
phi phi; // name of flux field (default = phi)
outletValue uniform 0; // reverse flow (inlet) value
value uniform 0; // initial value
}
\endverbatim
The mode of operation is determined by the sign of the flux across the
patch faces.
Note
Sign conventions:
- positive flux (out of domain): apply the user-specified fixed value
- negative flux (into of domain): apply zero-gradient condition
SourceFiles
outletInletFvPatchField.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,10 +24,35 @@ License
Class
Foam::outletMappedUniformInletFvPatchField
Group
grpInletBoundaryConditions
Description
Averages the field over the "outlet" patch specified by name
"outletPatchName" and applies this as the uniform value of the field
over this patch.
This boundary conditon averages the field over the "outlet" patch specified
by name "outletPatchName" and applies this as the uniform value of the
field over this patch.
\heading Patch usage
\table
Property | Description | Required | Default value
outletPatchName | name of outlet patch | yes |
phi | flux field name | no | phi
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type outletMappedUniformInlet;
outletPatchName aPatch;
phi phi;
value uniform 0;
}
\endverbatim
SeeAlso
Foam::fixedValueFvPatchField
SourceFiles
outletMappedUniformInletFvPatchField.C
@ -45,7 +70,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class outletMappedUniformInletFvPatch Declaration
Class outletMappedUniformInletFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,8 +24,32 @@ License
Class
Foam::partialSlipFvPatchField
Group
grpWallBoundaryConditions grpGenericBoundaryConditions
Description
Foam::partialSlipFvPatchField
This boundary condition provides a partial slip condition. The amount of
slip is controlled by a user-supplied field.
\heading Patch usage
\table
Property | Description | Required | Default value
valueFraction | fraction od value used for boundary [0-1] | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type partialSlip;
valueFraction uniform 0.1;
value uniform 0;
}
\endverbatim
SeeAlso
Foam::transformFvPatchField
SourceFiles
partialSlipFvPatchField.C
@ -43,7 +67,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class partialSlipFvPatch Declaration
Class partialSlipFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,16 +24,55 @@ License
Class
Foam::phaseHydrostaticPressureFvPatchScalarField
Group
grpGenericBoundaryConditions
Description
Phase hydrostatic pressure boundary condition calculated as
This boundary condition provides a phase-based hydrostatic pressure
condition, calculated as:
pRefValue + rho*g.(x - pRefPoint)
\f[
p_{hyd} = p_{ref} + \rho g (x - x_{ref})
\f]
where rho is provided and assumed uniform
where
\vartable
p_{hyd} | hyrostatic pressure [Pa]
p_{ref} | reference pressure [Pa]
x_{ref} | reference point in Cartesian co-ordinates
\rho | density (assumed uniform)
g | acceleration due to gravity [m/s2]
\endtable
applied according to the phase-fraction field provided:
1 -> fix value to that provided
0 -> zero-gradient
The values are assigned according to the phase-fraction field:
- 1: apply \$fp_{hyd}\$f
- 0: apply a zero-gradient condition
\heading Patch usage
\table
Property | Description | Required | Default value
phaseName | phase field name | no | alpha
rho | density field name | no | rho
pRefValue | reference pressure [Pa] | yes |
pRefPoint | reference pressure location | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type phaseHydrostaticPressure;
phaseName alpha1;
rho rho;
pRefValue 1e5;
pRefPoint (0 0 0);
value uniform 0; // optional initial value
}
\endverbatim
SeeAlso
Foam::mixedFvPatchScalarField
SourceFiles
phaseHydrostaticPressureFvPatchScalarField.C
@ -51,7 +90,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class phaseHydrostaticPressureFvPatch Declaration
Class phaseHydrostaticPressureFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class phaseHydrostaticPressureFvPatchScalarField

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,11 +24,44 @@ License
Class
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
Group
grpInletBoundaryConditions grpOutletBoundaryConditions
Description
Velocity inlet/outlet boundary condition for pressure boundary where the
pressure is specified. zero-gradient is applied for outflow (as defined
by the flux) and for inflow the velocity is obtained from the flux with
the specified `inletDirection'.
This velocity inlet/outlet boundary condition is applied to pressure
boundaries where the pressure is specified. A zero-gradient condtion is
applied for outflow (as defined by the flux); for inflow, the velocity
is obtained from the flux with the specified inlet direction.
\heading Patch usage
\table
Property | Description | Required | Default value
phi | flux field name | no | phi
rho | density field name | no | rho
inletDirection | inlet direction per patch face | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type pressureDirectedInletOutletVelocity;
phi phi;
rho rho;
inletDirection uniform (1 0 0);
value uniform 0;
}
\endverbatim
Note
Sign conventions:
- positive flux (out of domain): apply zero-gradient condition
- negative flux (into of domain): derive from the flux with specified
direction
SeeAlso
Foam::mixedFvPatchVectorField
SourceFiles
pressureDirectedInletOutletVelocityFvPatchVectorField.C
@ -47,7 +80,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class pressureDirectedInletOutletVelocityFvPatch Declaration
Class pressureDirectedInletOutletVelocityFvPatchVectorField Declaration
\*---------------------------------------------------------------------------*/
class pressureDirectedInletOutletVelocityFvPatchVectorField
@ -56,8 +89,13 @@ class pressureDirectedInletOutletVelocityFvPatchVectorField
{
// Private data
//- Flux field name
word phiName_;
//- Density field name
word rhoName_;
//- Inlet direction
vectorField inletDir_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,12 +24,43 @@ License
Class
Foam::pressureDirectedInletVelocityFvPatchVectorField
Group
grpInletBoundaryConditions
Description
Velocity inlet boundary condition for patches where the pressure is
specified. The inflow velocity is obtained from the flux with the
specified "inletDirection" direction. If reverse flow is possible or
expected use the "pressureDirectedInletOutletVelocityFvPatchVectorField"
BC instead.
This velocity inlet boundary condition is applied to patches where the
pressure is specified. The inflow velocity is obtained from the flux with
the specified inlet direction" direction.
\heading Patch usage
\table
Property | Description | Required | Default value
phi | flux field name | no | phi
rho | density field name | no | rho
inletDirection | inlet direction per patch face | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type pressureDirectedInletVelocity;
phi phi;
rho rho;
inletDirection uniform (1 0 0);
value uniform 0;
}
\endverbatim
Note
If reverse flow is possible or expected use the
pressureDirectedInletOutletVelocityFvPatchVectorField condition instead.
SeeAlso
Foam::fixedValueFvPatchField
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
SourceFiles
pressureDirectedInletVelocityFvPatchVectorField.C
@ -48,7 +79,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class pressureDirectedInletVelocityFvPatch Declaration
Class pressureDirectedInletVelocityFvPatchVectorField Declaration
\*---------------------------------------------------------------------------*/
class pressureDirectedInletVelocityFvPatchVectorField
@ -57,8 +88,13 @@ class pressureDirectedInletVelocityFvPatchVectorField
{
// Private data
//- Flux field name
word phiName_;
//- Density field name
word rhoName_;
//- Inlet direction
vectorField inletDir_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,13 +24,45 @@ License
Class
Foam::pressureInletOutletParSlipVelocityFvPatchVectorField
Description
Velocity inlet/outlet boundary condition for pressure boundary where the
pressure is specified. zero-gradient is applied for outflow (as defined
by the flux) and for inflow the velocity is obtained from the flux with
the specified `inletDirection'.
Group
grpInletBoundaryConditions grpOutletBoundaryConditions
Slip condition applied tangential to the patch.
Description
This velocity inlet/outlet boundary condition for pressure boundary where
the pressure is specified. A zero-gradient is applied for outflow (as
defined by the flux); for inflow, the velocity is obtained from the flux
with the specified inlet direction.
A slip condition is applied tangential to the patch.
\heading Patch usage
\table
Property | Description | Required | Default value
phi | flux field name | no | phi
rho | density field name | no | rho
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type pressureInletOutletParSlipVelocity;
phi phi;
rho rho;
value uniform 0;
}
\endverbatim
Note
Sign conventions:
- positive flux (out of domain): apply zero-gradient condition
- negative flux (into of domain): derive from the flux with specified
direction
SeeAlso
Foam::mixedFvPatchVectorField
Foam::pressureDirectedInletOutletVelocityFvPatchVectorField
SourceFiles
pressureInletOutletParSlipVelocityFvPatchVectorField.C
@ -58,7 +90,10 @@ class pressureInletOutletParSlipVelocityFvPatchVectorField
{
// Private data
//- Flux field name
word phiName_;
//- Density field name
word rhoName_;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,11 +24,41 @@ License
Class
Foam::pressureInletOutletVelocityFvPatchVectorField
Group
grpInletletBoundaryConditions grpOutletBoundaryConditions
Description
Velocity inlet/outlet boundary condition patches for where the pressure is
specified. zero-gradient is applied for outflow (as defined by the flux)
and for inflow the velocity is obtained from the patch-face normal
component of the internal-cell value.
This velocity inlet/outlet boundary condition is applied to pressure
boundaries where the pressure is specified. A zero-gradient condtion is
applied for outflow (as defined by the flux); for inflow, the velocity is
obtained from the patch-face normal component of the internal-cell value.
The tangential patch velocity can be optionally specified.
\heading Patch usage
\table
Property | Description | Required | Default value
phi | flux field name | no | phi
tangentialVelocity | tangential velocity field | no |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type pressureInletOutletVelocity;
phi phi;
tangentialVelocity uniform (0 0 0);
value uniform 0;
}
\endverbatim
Note
Sign conventions:
- positive flux (out of domain): apply zero-gradient condition
- negative flux (into of domain): derive from the flux in the patch-normal
direction
SourceFiles
pressureInletOutletVelocityFvPatchVectorField.C
@ -47,7 +77,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class pressureInletOutletVelocityFvPatch Declaration
Class pressureInletOutletVelocityFvPatchVectorField Declaration
\*---------------------------------------------------------------------------*/
class pressureInletOutletVelocityFvPatchVectorField
@ -56,6 +86,7 @@ class pressureInletOutletVelocityFvPatchVectorField
{
// Private data
//- Flux field name
word phiName_;
//- Optional tangential velocity component

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