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

This commit is contained in:
mattijs
2009-07-09 13:05:06 +01:00
133 changed files with 1737 additions and 706 deletions

View File

@ -449,7 +449,11 @@ meshTools = meshes/meshTools
$(meshTools)/matchPoints.C
$(meshTools)/mergePoints.C
fields/UniformDimensionedFields/uniformDimensionedFields.C
fields/cloud/cloud.C
Fields = fields/Fields
$(Fields)/labelField/labelField.C
$(Fields)/scalarField/scalarField.C
$(Fields)/sphericalTensorField/sphericalTensorField.C
@ -458,8 +462,6 @@ $(Fields)/symmTensorField/symmTensorField.C
$(Fields)/tensorField/tensorField.C
$(Fields)/complexFields/complexFields.C
fields/cloud/cloud.C
$(Fields)/labelField/labelIOField.C
$(Fields)/scalarField/scalarIOField.C
$(Fields)/vectorField/vectorIOField.C

View File

@ -0,0 +1,112 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "UniformDimensionedField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::UniformDimensionedField<Type>::UniformDimensionedField
(
const IOobject& io,
const dimensioned<Type>& dt
)
:
regIOobject(io),
dimensioned<Type>(dt)
{}
template<class Type>
Foam::UniformDimensionedField<Type>::UniformDimensionedField
(
const UniformDimensionedField<Type>& rdt
)
:
regIOobject(rdt),
dimensioned<Type>(rdt)
{}
template<class Type>
Foam::UniformDimensionedField<Type>::UniformDimensionedField
(
const IOobject& io
)
:
regIOobject(io),
dimensioned<Type>(regIOobject::name(), dimless, pTraits<Type>::zero)
{
dictionary dict(readStream(typeName));
this->dimensions().reset(dict.lookup("dimensions"));
this->value() = dict.lookup("value");
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::UniformDimensionedField<Type>::~UniformDimensionedField()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
bool Foam::UniformDimensionedField<Type>::writeData(Ostream& os) const
{
os.writeKeyword("dimensions") << this->dimensions() << token::END_STATEMENT
<< nl;
os.writeKeyword("value") << this->value() << token::END_STATEMENT
<< nl << nl;
return (os.good());
}
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
template<class Type>
void Foam::UniformDimensionedField<Type>::operator=
(
const UniformDimensionedField<Type>& rhs
)
{
dimensioned<Type>::operator=(rhs);
}
template<class Type>
void Foam::UniformDimensionedField<Type>::operator=
(
const dimensioned<Type>& rhs
)
{
dimensioned<Type>::operator=(rhs);
}
// ************************************************************************* //

View File

@ -0,0 +1,118 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::UniformDimensionedField
Description
Dimensioned<Type> registered with the database as a registered IOobject
which has the functionality of a uniform field and allows values from the
top-level code to be passed to boundary conditions etc.
SourceFiles
UniformDimensionedField.C
\*---------------------------------------------------------------------------*/
#ifndef UniformDimensionedField_H
#define UniformDimensionedField_H
#include "regIOobject.H"
#include "dimensionedType.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class UniformDimensionedField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class UniformDimensionedField
:
public regIOobject,
public dimensioned<Type>
{
public:
//- Runtime type information
TypeName("UniformDimensionedField");
// Constructors
//- Construct null
UniformDimensionedField();
//- Construct from components
UniformDimensionedField(const IOobject&, const dimensioned<Type>&);
//- Construct as copy
UniformDimensionedField(const UniformDimensionedField<Type>&);
//- Construct from Istream
UniformDimensionedField(const IOobject&);
//- Destructor
virtual ~UniformDimensionedField();
// Member Functions
//- Name function provided to resolve the ambiguity between the
// name functions in regIOobject and dimensioned<Type>
virtual const word& name() const
{
return dimensioned<Type>::name();
}
bool writeData(Ostream&) const;
// Member Operators
void operator=(const UniformDimensionedField<Type>&);
void operator=(const dimensioned<Type>&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "UniformDimensionedField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,46 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "uniformDimensionedFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTemplateTypeNameAndDebug(uniformDimensionedScalarField, 0);
defineTemplateTypeNameAndDebug(uniformDimensionedVectorField, 0);
defineTemplateTypeNameAndDebug(uniformDimensionedSphericalTensorField, 0);
defineTemplateTypeNameAndDebug(uniformDimensionedSymmTensorField, 0);
defineTemplateTypeNameAndDebug(uniformDimensionedTensorField, 0);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
InClass
Foam::UniformDimensionedField
Description
SourceFiles
uniformDimensionedFields.C
\*---------------------------------------------------------------------------*/
#ifndef UniformDimensionedFields_H
#define UniformDimensionedFields_H
#include "UniformDimensionedField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
typedef UniformDimensionedField<scalar> uniformDimensionedScalarField;
typedef UniformDimensionedField<vector> uniformDimensionedVectorField;
typedef UniformDimensionedField<sphericalTensor> uniformDimensionedSphericalTensorField;
typedef UniformDimensionedField<symmTensor> uniformDimensionedSymmTensorField;
typedef UniformDimensionedField<tensor> uniformDimensionedTensorField;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -9,6 +9,7 @@
#include "fvMatrices.H"
#include "fvm.H"
#include "linear.H"
#include "uniformDimensionedFields.H"
#include "calculatedFvPatchFields.H"
#include "fixedValueFvPatchFields.H"
#include "adjustPhi.H"

View File

@ -1,15 +0,0 @@
Info << "\nReading environmentalProperties" << endl;
IOdictionary environmentalProperties
(
IOobject
(
"environmentalProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
dimensionedVector g(environmentalProperties.lookup("g"));

View File

@ -0,0 +1,12 @@
Info << "\nReading g" << endl;
uniformDimensionedVectorField g
(
IOobject
(
"g",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);

View File

@ -28,6 +28,7 @@ License
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "uniformDimensionedFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -110,10 +111,8 @@ void buoyantPressureFvPatchScalarField::updateCoeffs()
return;
}
const dictionary& environmentalProperties
= db().lookupObject<IOdictionary>("environmentalProperties");
dimensionedVector g(environmentalProperties.lookup("g"));
const uniformDimensionedVectorField& g =
db().lookupObject<uniformDimensionedVectorField>("g");
const fvPatchField<scalar>& rho =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);

View File

@ -29,7 +29,7 @@ License
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "uniformDimensionedFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -126,10 +126,8 @@ void Foam::uniformDensityHydrostaticPressureFvPatchScalarField::updateCoeffs()
return;
}
const dictionary& environmentalProperties
= db().lookupObject<IOdictionary>("environmentalProperties");
dimensionedVector g(environmentalProperties.lookup("g"));
const uniformDimensionedVectorField& g =
db().lookupObject<uniformDimensionedVectorField>("g");
operator==
(

View File

@ -59,7 +59,7 @@ Foam::spray::spray
const basicMultiComponentMixture& composition,
const PtrList<gasThermoPhysics>& gasProperties,
const dictionary&,
const dictionary& environmentalProperties
const dimensionedVector& g
)
:
Cloud<parcel>(U.mesh(), false), // suppress className checking on positions
@ -181,7 +181,7 @@ Foam::spray::spray
),
subCycles_(readLabel(sprayProperties_.lookup("subCycles"))),
g_(dimensionedVector(environmentalProperties.lookup("g")).value()),
g_(g.value()),
gasProperties_(gasProperties),
composition_(composition),
@ -266,7 +266,7 @@ Foam::spray::spray
"const volScalarField& T, const combustionMixture& composition,"
"const PtrList<gasThermoPhsyics>& gaseousFuelProperties, "
"const dictionary& thermophysicalProperties, "
"const dictionary& environmentalProperties)"
"const dimensionedScalar& g)"
) << "spray::(...) only one wedgePolyPatch found. "
"Please check you BC-setup."
<< abort(FatalError);

View File

@ -122,7 +122,7 @@ class spray
//- Acceleration due to gravity
vector g_;
const vector& g_;
// Composition properties
@ -195,7 +195,7 @@ public:
const basicMultiComponentMixture& composition,
const PtrList<gasThermoPhysics>& gasProperties,
const dictionary& thermophysicalProperties,
const dictionary& environmentalProperties
const dimensionedVector& g
);

View File

@ -246,11 +246,9 @@ Foam::scalar Foam::ODEChemistryModel<CompType, ThermoType>::omega
{
pr *= pow(cr, exp - 1.0);
}
}
return pf*cf - pr*cr;
}
@ -468,10 +466,27 @@ Foam::ODEChemistryModel<CompType, ThermoType>::tc() const
this->thermo().rho()
);
label nCells = rho.size();
label nReaction = reactions_.size();
tmp<volScalarField> tsource
(
new volScalarField
(
IOobject
(
"tc",
this->time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
this->mesh(),
dimensionedScalar("zero", dimTime, SMALL),
zeroGradientFvPatchScalarField::typeName
)
);
scalarField t(nCells, SMALL);
scalarField& t = tsource();
label nReaction = reactions_.size();
if (this->chemistry_)
{
@ -509,25 +524,7 @@ Foam::ODEChemistryModel<CompType, ThermoType>::tc() const
}
}
tmp<volScalarField> tsource
(
new volScalarField
(
IOobject
(
"tc",
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
this->mesh_,
dimensionedScalar("zero", dimTime, 0.0),
zeroGradientFvPatchScalarField::typeName
)
);
tsource().internalField() = t;
tsource().correctBoundaryConditions();
return tsource;
@ -682,7 +679,7 @@ Foam::scalar Foam::ODEChemistryModel<CompType, ThermoType>::solve
forAll(rho, celli)
{
for (label i=0; i<nSpecie(); i++)
for (label i=0; i<nSpecie_; i++)
{
RR_[i][celli] = 0.0;
}

View File

@ -26,7 +26,7 @@ Class
Foam::rhoChemistryModel
Description
Chemistry model for compressibility-based thermodynamics
Chemistry model for density-based thermodynamics
SourceFiles
rhoChemistryModelI.H

View File

@ -29,6 +29,7 @@ License
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "uniformDimensionedFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -140,10 +141,8 @@ void Foam::alphaFixedPressureFvPatchScalarField::updateCoeffs()
return;
}
const dictionary& environmentalProperties
= db().lookupObject<IOdictionary>("environmentalProperties");
dimensionedVector g(environmentalProperties.lookup("g"));
const uniformDimensionedVectorField& g =
db().lookupObject<uniformDimensionedVectorField>("g");
const fvPatchField<scalar>& rho =
patch().lookupPatchField<volScalarField, scalar>("rho");

View File

@ -37,6 +37,8 @@ derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFv
derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
backwardsCompatibilityWallFunctions/backwardsCompatibilityWallFunctions.C
backwardsCompatibility/wallFunctions/backwardsCompatibilityWallFunctions.C
backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthDissipationRateInlet.C
backwardsCompatibility/derivedFvPatchFields/backwardsCompatibilityTurbulentMixingLengthFrequencyInlet.C
LIB = $(FOAM_LIBBIN)/libcompressibleRASModels

View File

@ -0,0 +1,156 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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

@ -0,0 +1,158 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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

@ -0,0 +1,163 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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

@ -0,0 +1,162 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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

@ -48,7 +48,7 @@ turbulentHeatFluxTemperatureFvPatchScalarField
:
fixedGradientFvPatchScalarField(p, iF),
q_(p.size(), 0.0),
rhoName_("undefinedRho")
rhoName_("rho")
{}
@ -77,7 +77,7 @@ turbulentHeatFluxTemperatureFvPatchScalarField
:
fixedGradientFvPatchScalarField(p, iF),
q_("q", dict, p.size()),
rhoName_(dict.lookup("rho"))
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
{
fvPatchField<scalar>::operator=(patchInternalField());
gradient() = 0.0;

View File

@ -33,7 +33,7 @@ Description
@verbatim
inlet
{
type turbulentMixingLengthDissipationRateInlet;
type compressible::turbulentMixingLengthDissipationRateInlet;
mixingLength 0.005; // 5 mm
value uniform 200; // placeholder
}

View File

@ -49,7 +49,7 @@ turbulentMixingLengthFrequencyInletFvPatchScalarField
:
fixedValueFvPatchField<scalar>(p, iF),
mixingLength_(0.0),
kName_("undefined-k")
kName_("k")
{}
turbulentMixingLengthFrequencyInletFvPatchScalarField::

View File

@ -32,7 +32,7 @@ Description
@verbatim
inlet
{
type turbulentMixingLengthFrequencyInlet;
type compressible::turbulentMixingLengthFrequencyInlet;
mixingLength 0.005; // 5 mm
k k; // turbulent k field
value uniform 5; // initial value