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

This commit is contained in:
mattijs
2009-07-21 13:29:43 +01:00
30 changed files with 446 additions and 707 deletions

View File

@ -474,20 +474,20 @@ Foam::fileName::Type Foam::type(const fileName& name)
// Does the name exist in the filing system?
bool Foam::exists(const fileName& name)
bool Foam::exists(const fileName& name, const bool checkGzip)
{
return mode(name) || isFile(name);
return mode(name) || isFile(name, checkGzip);
}
// Does the directory exist
// Does the directory exist?
bool Foam::isDir(const fileName& name)
{
return S_ISDIR(mode(name));
}
// Does the file exist
// Does the file exist?
bool Foam::isFile(const fileName& name, const bool checkGzip)
{
return S_ISREG(mode(name)) || (checkGzip && S_ISREG(mode(name + ".gz")));
@ -757,31 +757,70 @@ bool Foam::ln(const fileName& src, const fileName& dst)
// Rename srcFile dstFile
bool Foam::mv(const fileName& srcFile, const fileName& dstFile)
bool Foam::mv(const fileName& src, const fileName& dst)
{
if (POSIX::debug)
{
Info<< "Move : " << srcFile << " to " << dstFile << endl;
Info<< "Move : " << src << " to " << dst << endl;
}
if
(
dstFile.type() == fileName::DIRECTORY
&& srcFile.type() != fileName::DIRECTORY
dst.type() == fileName::DIRECTORY
&& src.type() != fileName::DIRECTORY
)
{
const fileName dstName(dstFile/srcFile.name());
const fileName dstName(dst/src.name());
return rename(srcFile.c_str(), dstName.c_str()) == 0;
return rename(src.c_str(), dstName.c_str()) == 0;
}
else
{
return rename(srcFile.c_str(), dstFile.c_str()) == 0;
return rename(src.c_str(), dst.c_str()) == 0;
}
}
// Remove a file returning true if successful otherwise false
//- Rename to a corresponding backup file
// If the backup file already exists, attempt with "01" .. "99" index
bool Foam::mvBak(const fileName& src, const std::string& ext)
{
if (POSIX::debug)
{
Info<< "mvBak : " << src << " to extension " << ext << endl;
}
if (exists(src, false))
{
const int maxIndex = 99;
char index[3];
for (int n = 0; n <= maxIndex; n++)
{
fileName dstName(src + "." + ext);
if (n)
{
sprintf(index, "%02d", n);
dstName += index;
}
// avoid overwriting existing files, except for the last
// possible index where we have no choice
if (!exists(dstName, false) || n == maxIndex)
{
return rename(src.c_str(), dstName.c_str()) == 0;
}
}
}
// fall-through: nothing to do
return false;
}
// Remove a file, returning true if successful otherwise false
bool Foam::rm(const fileName& file)
{
if (POSIX::debug)

View File

@ -132,6 +132,7 @@ $(dictionaryEntry)/dictionaryEntryIO.C
functionEntries = $(dictionary)/functionEntries
$(functionEntries)/functionEntry/functionEntry.C
$(functionEntries)/includeEntry/includeEntry.C
$(functionEntries)/includeIfPresentEntry/includeIfPresentEntry.C
$(functionEntries)/inputModeEntry/inputModeEntry.C
$(functionEntries)/removeEntry/removeEntry.C

View File

@ -62,7 +62,7 @@ namespace functionEntries
}
}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
Foam::fileName Foam::functionEntries::includeEntry::includeFileName
(
@ -112,6 +112,7 @@ bool Foam::functionEntries::includeEntry::execute
}
}
bool Foam::functionEntries::includeEntry::execute
(
const dictionary& parentDict,

View File

@ -67,15 +67,19 @@ class includeEntry
{
// Private Member Functions
//- Read the include fileName from Istream, expand and return
static fileName includeFileName(Istream&);
//- Disallow default bitwise copy construct
includeEntry(const includeEntry&);
//- Disallow default bitwise assignment
void operator=(const includeEntry&);
protected:
// Protected Member Functions
//- Read the include fileName from Istream, expand and return
static fileName includeFileName(Istream&);
public:

View File

@ -0,0 +1,101 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-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 "includeIfPresentEntry.H"
#include "dictionary.H"
#include "IFstream.H"
#include "addToMemberFunctionSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::word Foam::functionEntries::includeIfPresentEntry::typeName
(
Foam::functionEntries::includeIfPresentEntry::typeName_()
);
// Don't lookup the debug switch here as the debug switch dictionary
// might include includeIfPresentEntry
int Foam::functionEntries::includeIfPresentEntry::debug(0);
namespace Foam
{
namespace functionEntries
{
addToMemberFunctionSelectionTable
(
functionEntry,
includeIfPresentEntry,
execute,
dictionaryIstream
);
addToMemberFunctionSelectionTable
(
functionEntry,
includeIfPresentEntry,
execute,
primitiveEntryIstream
);
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::functionEntries::includeIfPresentEntry::execute
(
dictionary& parentDict,
Istream& is
)
{
IFstream ifs(includeFileName(is));
if (ifs)
{
parentDict.read(ifs);
}
return true;
}
bool Foam::functionEntries::includeIfPresentEntry::execute
(
const dictionary& parentDict,
primitiveEntry& entry,
Istream& is
)
{
IFstream ifs(includeFileName(is));
if (ifs)
{
entry.read(parentDict, ifs);
}
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,101 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-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::functionEntries::includeIfPresentEntry
Description
Specify a file to include if it exists. Expects a single string to follow.
The @c \#includeIfPresent directive is similar to the @c \#include
directive, but does not generate an error if the file does not exist.
See Also
Foam::functionEntries::includeEntry
SourceFiles
includeIfPresentEntry.C
\*---------------------------------------------------------------------------*/
#ifndef includeIfPresentEntry_H
#define includeIfPresentEntry_H
#include "includeEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace functionEntries
{
/*---------------------------------------------------------------------------*\
Class includeIfPresentEntry Declaration
\*---------------------------------------------------------------------------*/
class includeIfPresentEntry
:
public includeEntry
{
// Private Member Functions
//- Disallow default bitwise copy construct
includeIfPresentEntry(const includeIfPresentEntry&);
//- Disallow default bitwise assignment
void operator=(const includeIfPresentEntry&);
public:
//- Runtime type information
ClassName("includeIfPresent");
// Member Functions
//- Execute the functionEntry in a sub-dict context
static bool execute(dictionary& parentDict, Istream&);
//- Execute the functionEntry in a primitiveEntry context
static bool execute
(
const dictionary& parentDict,
primitiveEntry&,
Istream&
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace functionEntries
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -119,7 +119,8 @@ mode_t mode(const fileName&);
fileName::Type type(const fileName&);
//- Does the name exist (as DIRECTORY or FILE) in the file system?
bool exists(const fileName&);
// Optionally enable/disable check for gzip file.
bool exists(const fileName&, const bool checkGzip=true);
//- Does the name exist as a DIRECTORY in the file system?
bool isDir(const fileName&);
@ -143,15 +144,19 @@ fileNameList readDir
);
//- Copy, recursively if necessary, the source to the destination
bool cp(const fileName& srcFile, const fileName& destFile);
bool cp(const fileName& src, const fileName& dst);
//- Create a softlink. destFile should not exist. Returns true if successful.
bool ln(const fileName& srcFile, const fileName& destFile);
//- Create a softlink. dst should not exist. Returns true if successful.
bool ln(const fileName& src, const fileName& dst);
//- Rename srcFile destFile
bool mv(const fileName& srcFile, const fileName& destFile);
//- Rename src to dst
bool mv(const fileName& src, const fileName& dst);
//- Remove a file returning true if successful otherwise false
//- Rename to a corresponding backup file
// If the backup file already exists, attempt with "01" .. "99" suffix
bool mvBak(const fileName&, const std::string& ext = "bak");
//- Remove a file, returning true if successful otherwise false
bool rm(const fileName&);
//- Remove a dirctory and its contents

View File

@ -928,7 +928,7 @@ Foam::labelList Foam::fvMeshDistribute::mapBoundaryData
{
label newFaceI = map.oldFaceMap()[oldBFaceI + map.nOldInternalFaces()];
// Face still exists (is nessecary?) and still boundary face
// Face still exists (is necessary?) and still boundary face
if (newFaceI >= 0 && newFaceI >= mesh.nInternalFaces())
{
newBoundaryData[newFaceI - mesh.nInternalFaces()] =

View File

@ -38,7 +38,5 @@ derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLe
derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C
backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet.C
backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthFrequencyInlet.C
LIB = $(FOAM_LIBBIN)/libcompressibleRASModels

View File

@ -1,156 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2006-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 "backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "surfaceFields.H"
#include "volFields.H"
#include "RASModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField::
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedValueFvPatchField<scalar>(p, iF),
mixingLength_(0.001)
{}
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField::
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField
(
const backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
mixingLength_(ptf.mixingLength_)
{}
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField::
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchField<scalar>(p, iF, dict),
mixingLength_(readScalar(dict.lookup("mixingLength")))
{}
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField::
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField
(
const backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf
)
:
fixedValueFvPatchField<scalar>(ptf),
mixingLength_(ptf.mixingLength_)
{}
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField::
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField
(
const backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField& ptf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedValueFvPatchField<scalar>(ptf, iF),
mixingLength_(ptf.mixingLength_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
// Lookup Cmu corresponding to the turbulence model selected
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar Cmu = readScalar(rasModel.coeffDict().lookup("Cmu"));
const scalar Cmu75 = pow(Cmu, 0.75);
const fvPatchField<scalar>& kp =
patch().lookupPatchField<volScalarField, scalar>("k");
operator==(Cmu75*kp*sqrt(kp)/mixingLength_);
fixedValueFvPatchField<scalar>::updateCoeffs();
}
void backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField::write
(
Ostream& os
) const
{
// write with prefix for forwards compatibility
// mimic - fvPatchField<scalar>::write(os);
os.writeKeyword("type")
<< "compressible::" << type() << token::END_STATEMENT << nl;
os.writeKeyword("mixingLength")
<< mixingLength_ << token::END_STATEMENT << nl;
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,158 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2006-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::compressible::
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField
Description
Compatibility for the new namespace qualifier
Foam::compressible::turbulentMixingLengthDissipationRateInletFvPatchScalarField
SourceFiles
backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet.C
\*---------------------------------------------------------------------------*/
#ifndef backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet_H
#define backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet_H
#include "fixedValueFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
/*---------------------------------------------------------------------------*\
Class backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField
:
public fixedValueFvPatchScalarField
{
// Private data
//- turbulent length scale
scalar mixingLength_;
public:
//- Runtime type information
TypeName("turbulentMixingLengthDissipationRateInlet");
// Constructors
//- Construct from patch and internal field
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField
// onto a new patch
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField
(
const backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField
(
const backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField
(
*this
)
);
}
//- Construct as copy setting internal field reference
backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField
(
const backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new backwardsCompatibilityTurbulentMixingLengthDissipationRateInletFvPatchScalarField
(
*this,
iF
)
);
}
// Member functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,163 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2006-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 "backwardsCompatibilityTurbulentMixingLengthFrequencyInlet.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "surfaceFields.H"
#include "volFields.H"
#include "RASModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField::
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedValueFvPatchField<scalar>(p, iF),
mixingLength_(0.0),
kName_("k")
{}
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField::
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField
(
const backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchField<scalar>(ptf, p, iF, mapper),
mixingLength_(ptf.mixingLength_),
kName_(ptf.kName_)
{}
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField::
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchField<scalar>(p, iF, dict),
mixingLength_(readScalar(dict.lookup("mixingLength"))),
kName_(dict.lookupOrDefault<word>("k", "k"))
{}
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField::
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField
(
const backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField& ptf
)
:
fixedValueFvPatchField<scalar>(ptf),
mixingLength_(ptf.mixingLength_),
kName_(ptf.kName_)
{}
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField::
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField
(
const backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField& ptf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedValueFvPatchField<scalar>(ptf, iF),
mixingLength_(ptf.mixingLength_),
kName_(ptf.kName_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
// Lookup Cmu corresponding to the turbulence model selected
const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties");
const scalar Cmu = readScalar(rasModel.coeffDict().lookup("Cmu"));
const scalar Cmu25 = pow(Cmu, 0.25);
const fvPatchField<scalar>& kp =
patch().lookupPatchField<volScalarField, scalar>(kName_);
operator==(sqrt(kp)/(Cmu25*mixingLength_));
fixedValueFvPatchField<scalar>::updateCoeffs();
}
void backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField::write
(
Ostream& os
) const
{
// write with prefix for forwards compatibility
// mimic - fvPatchField<scalar>::write(os);
os.writeKeyword("type")
<< "compressible::" << type() << token::END_STATEMENT << nl;
os.writeKeyword("mixingLength")
<< mixingLength_ << token::END_STATEMENT << nl;
os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl;
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace Foam
// ************************************************************************* //

View File

@ -1,162 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2006-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::compressible::
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField
Description
Compatibility for the new namespace qualifier
Foam::compressible::turbulentMixingLengthFrequencyInletFvPatchScalarField
SourceFiles
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef compressiblebackwardsCompatibilityTurbulentMixingLengthFrequencyInlet_H
#define compressiblebackwardsCompatibilityTurbulentMixingLengthFrequencyInlet_H
#include "fixedValueFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace compressible
{
/*---------------------------------------------------------------------------*\
Class backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField
:
public fixedValueFvPatchScalarField
{
// Private data
//- Turbulent length scale
scalar mixingLength_;
//- Name of the turbulent kinetic energy field
word kName_;
public:
//- Runtime type information
TypeName("turbulentMixingLengthFrequencyInlet");
// Constructors
//- Construct from patch and internal field
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField
// onto a new patch
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField
(
const backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField
(
const backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField
(
*this
)
);
}
//- Construct as copy setting internal field reference
backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField
(
const backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new backwardsCompatibilityTurbulentMixingLengthFrequencyInletFvPatchScalarField
(
*this,
iF
)
);
}
// Member functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace compressible
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -104,7 +104,7 @@ autoCreateWallFunctionField
// rename file
Info<< " Backup original " << fieldName << " to "
<< fieldName << ".old" << endl;
mv(ioObj.objectPath(), ioObj.objectPath() + ".old");
mvBak(ioObj.objectPath(), "old");
PtrList<fvPatchField<Type> > newPatchFields(mesh.boundary().size());

View File

@ -42,6 +42,6 @@ derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFv
derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.C
backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C
LIB = $(FOAM_LIBBIN)/libincompressibleRASModels

View File

@ -104,7 +104,7 @@ autoCreateWallFunctionField
// rename file
Info<< " Backup original " << fieldName << " to "
<< fieldName << ".old" << endl;
mv(ioObj.objectPath(), ioObj.objectPath() + ".old");
mvBak(ioObj.objectPath(), "old");
PtrList<fvPatchField<Type> > newPatchFields(mesh.boundary().size());