adding tabulated U wall function BC and utility to generate tables

This commit is contained in:
andy
2009-10-26 18:54:10 +00:00
parent 6a62baae2c
commit cbe5974c26
23 changed files with 2182 additions and 0 deletions

View File

@ -0,0 +1,71 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "tabulatedWallFunction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace tabulatedWallFunctions
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
autoPtr<tabulatedWallFunction> tabulatedWallFunction::New
(
const dictionary& dict,
const polyMesh& mesh
)
{
word twfTypeName = dict.lookup("tabulatedWallFunction");
Info<< "Selecting tabulatedWallFunction " << twfTypeName << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(twfTypeName);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"tabulatedWallFunction::New(const dictionary&, const polyMesh&)"
) << "Unknown tabulatedWallFunction type " << twfTypeName
<< nl << nl << "Valid tabulatedWallFunction types are:" << nl
<< dictionaryConstructorTablePtr_->toc()
<< exit(FatalError);
}
return autoPtr<tabulatedWallFunction>(cstrIter()(dict, mesh));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace tabulatedWallFunctions
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,88 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "tabulatedWallFunction.H"
#include "Time.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace tabulatedWallFunctions
{
defineTypeNameAndDebug(tabulatedWallFunction, 0);
defineRunTimeSelectionTable(tabulatedWallFunction, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::tabulatedWallFunctions::tabulatedWallFunction::tabulatedWallFunction
(
const dictionary& dict,
const polyMesh& mesh,
const word& name
)
:
dict_(dict),
mesh_(mesh),
coeffDict_(dict.subDict(name + "Coeffs")),
invertedTableName_(dict.lookup("invertedTableName")),
invertedTable_(invertedTableName_, mesh_, dict, true)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::tabulatedWallFunctions::tabulatedWallFunction::~tabulatedWallFunction()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::tabulatedWallFunctions::tabulatedWallFunction::write()
{
if (invertedTable_.log10())
{
invertedTable_.note() =
"U+ as a function of log10(Re) computed using " + type();
}
else
{
invertedTable_.note() =
"U+ as a function of Re computed using " + type();
}
Info<< "Writing inverted table to\n " << invertedTable_.objectPath()
<< endl;
invertedTable_.write();
}
// ************************************************************************* //

View File

@ -0,0 +1,147 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::tabulatedWallFunctions::tabulatedWallFunction
Description
Base class for models that generate tabulated wall function data.
SourceFiles
tabulatedWallFunction.C
\*---------------------------------------------------------------------------*/
#ifndef tabulatedWallFunction_H
#define tabulatedWallFunction_H
#include "dictionary.H"
#include "polyMesh.H"
#include "runTimeSelectionTables.H"
#include "Switch.H"
#include "uniformInterpolationTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace tabulatedWallFunctions
{
/*---------------------------------------------------------------------------*\
Class tabulatedWallFunction Declaration
\*---------------------------------------------------------------------------*/
class tabulatedWallFunction
{
protected:
// Proteced data
//- Main dictionary
const dictionary dict_;
//- Reference to the mesh database
const polyMesh& mesh_;
//- Coefficients dictionary
const dictionary coeffDict_;
//- Name of inverted table
word invertedTableName_;
//- Inverted table
uniformInterpolationTable invertedTable_;
public:
//- Run-time type information
TypeName("tabulatedWallFunction");
//- Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
tabulatedWallFunction,
dictionary,
(
const dictionary& dict,
const polyMesh& mesh
),
(dict, mesh)
);
//- Constructor
tabulatedWallFunction
(
const dictionary& dict,
const polyMesh& mesh,
const word& name
);
//- Destructor
virtual ~tabulatedWallFunction();
//- Selector
static autoPtr<tabulatedWallFunction> New
(
const dictionary& dict,
const polyMesh& mesh
);
// Member Functions
// Access
//- Return the inverted table name
inline const word& invertedTableName() const;
//- Return the inverted table
inline const uniformInterpolationTable& invertedTable() const;
// I-O
//- Write
virtual void write();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace tabulatedWallFunctions
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "tabulatedWallFunctionI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "tabulatedWallFunction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline const Foam::word&
Foam::tabulatedWallFunctions::tabulatedWallFunction::invertedTableName() const
{
return invertedTableName_;
}
inline const Foam::uniformInterpolationTable&
Foam::tabulatedWallFunctions::tabulatedWallFunction::invertedTable() const
{
return invertedTable_;
}
// ************************************************************************* //