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

This commit is contained in:
mattijs
2013-05-16 20:29:05 +01:00
34 changed files with 1022 additions and 184 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -142,9 +142,6 @@ public:
virtual void convertTimeBase(const Time& t); virtual void convertTimeBase(const Time& t);
public:
// Evaluation // Evaluation
//- Return value as a function of (scalar) independent variable //- Return value as a function of (scalar) independent variable
@ -172,14 +169,15 @@ public:
const scalarField& x const scalarField& x
) const; ) const;
//- Integrate between two scalars and returns a dimensioned type //- Integrate between two scalars and return a dimensioned type
virtual dimensioned<Type> dimIntegrate virtual dimensioned<Type> dimIntegrate
( (
const scalar x1, const scalar x1,
const scalar x2 const scalar x2
) const; ) const;
//- Integrate between two scalars and returns list of dimensioned type //- Integrate between two scalar fields and return a field of
// dimensioned type
virtual tmp<Field<dimensioned<Type> > > dimIntegrate virtual tmp<Field<dimensioned<Type> > > dimIntegrate
( (
const scalarField& x1, const scalarField& x1,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -56,11 +56,7 @@ bool Foam::adjustPhi
if (!isA<processorFvsPatchScalarField>(phip)) if (!isA<processorFvsPatchScalarField>(phip))
{ {
if if (Up.fixesValue() && !isA<inletOutletFvPatchVectorField>(Up))
(
Up.fixesValue()
&& !isA<inletOutletFvPatchVectorField>(Up)
)
{ {
forAll(phip, i) forAll(phip, i)
{ {
@ -113,8 +109,12 @@ bool Foam::adjustPhi
{ {
FatalErrorIn FatalErrorIn
( (
"adjustPhi(surfaceScalarField& phi, const volVectorField& U," "adjustPhi"
"const volScalarField& p" "("
"surfaceScalarField&, "
"const volVectorField&,"
"volScalarField&"
")"
) << "Continuity error cannot be removed by adjusting the" ) << "Continuity error cannot be removed by adjusting the"
" outflow.\nPlease check the velocity boundary conditions" " outflow.\nPlease check the velocity boundary conditions"
" and/or run potentialFoam to initialise the outflow." << nl " and/or run potentialFoam to initialise the outflow." << nl

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -167,7 +167,8 @@ Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection
"Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection" "Foam::ConeNozzleInjection<CloudType>::ConeNozzleInjection"
"(" "("
"const dictionary&, " "const dictionary&, "
"CloudType&" "CloudType&, "
"const word&"
")" ")"
)<< "innerNozzleDiameter >= outerNozzleDiameter" << nl )<< "innerNozzleDiameter >= outerNozzleDiameter" << nl
<< exit(FatalError); << exit(FatalError);
@ -369,6 +370,7 @@ void Foam::ConeNozzleInjection<CloudType>::setPositionAndCell
"const scalar, " "const scalar, "
"vector&, " "vector&, "
"label&, " "label&, "
"label&, "
"label&" "label&"
")" ")"
)<< "Unknown injectionMethod type" << nl )<< "Unknown injectionMethod type" << nl

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -43,6 +43,7 @@ Foam::KinematicLookupTableInjection<CloudType>::KinematicLookupTableInjection
( (
readScalar(this->coeffDict().lookup("parcelsPerSecond")) readScalar(this->coeffDict().lookup("parcelsPerSecond"))
), ),
randomise_(readBool(this->coeffDict().lookup("randomise"))),
injectors_ injectors_
( (
IOobject IOobject
@ -87,6 +88,7 @@ Foam::KinematicLookupTableInjection<CloudType>::KinematicLookupTableInjection
inputFileName_(im.inputFileName_), inputFileName_(im.inputFileName_),
duration_(im.duration_), duration_(im.duration_),
parcelsPerSecond_(im.parcelsPerSecond_), parcelsPerSecond_(im.parcelsPerSecond_),
randomise_(im.randomise_),
injectors_(im.injectors_), injectors_(im.injectors_),
injectorCells_(im.injectorCells_), injectorCells_(im.injectorCells_),
injectorTetFaces_(im.injectorTetFaces_), injectorTetFaces_(im.injectorTetFaces_),
@ -177,7 +179,16 @@ void Foam::KinematicLookupTableInjection<CloudType>::setPositionAndCell
label& tetPtI label& tetPtI
) )
{ {
label injectorI = parcelI*injectorCells_.size()/nParcels; label injectorI = 0;
if (randomise_)
{
cachedRandom& rnd = this->owner().rndGen();
injectorI = rnd.position<label>(0, injectorCells_.size() - 1);
}
else
{
injectorI = parcelI*injectorCells_.size()/nParcels;
}
position = injectors_[injectorI].x(); position = injectors_[injectorI].x();
cellOwner = injectorCells_[injectorI]; cellOwner = injectorCells_[injectorI];

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -78,6 +78,9 @@ class KinematicLookupTableInjection
//- Number of parcels per injector - common to all injection sources //- Number of parcels per injector - common to all injection sources
const scalar parcelsPerSecond_; const scalar parcelsPerSecond_;
//- Flag to indicate to randomise injection positions
bool randomise_;
//- List of injectors //- List of injectors
kinematicParcelInjectionDataIOList injectors_; kinematicParcelInjectionDataIOList injectors_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -141,7 +141,7 @@ Foam::forceSuSp Foam::LiftForce<CloudType>::calcCoupled
scalar Cl = this->Cl(p, curlUc, Re, muc); scalar Cl = this->Cl(p, curlUc, Re, muc);
value.Su() = mass/p.rho()*p.d()/2.0*p.rhoc()*Cl*((p.Uc() - p.U())^curlUc); value.Su() = mass/p.rho()*p.rhoc()*Cl*((p.Uc() - p.U())^curlUc);
return value; return value;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -42,6 +42,7 @@ Foam::ReactingLookupTableInjection<CloudType>::ReactingLookupTableInjection
( (
readScalar(this->coeffDict().lookup("parcelsPerSecond")) readScalar(this->coeffDict().lookup("parcelsPerSecond"))
), ),
randomise_(readBool(this->coeffDict().lookup("randomise"))),
injectors_ injectors_
( (
IOobject IOobject
@ -86,6 +87,7 @@ Foam::ReactingLookupTableInjection<CloudType>::ReactingLookupTableInjection
inputFileName_(im.inputFileName_), inputFileName_(im.inputFileName_),
duration_(im.duration_), duration_(im.duration_),
parcelsPerSecond_(im.parcelsPerSecond_), parcelsPerSecond_(im.parcelsPerSecond_),
randomise_(im.randomise_),
injectors_(im.injectors_), injectors_(im.injectors_),
injectorCells_(im.injectorCells_), injectorCells_(im.injectorCells_),
injectorTetFaces_(im.injectorTetFaces_), injectorTetFaces_(im.injectorTetFaces_),
@ -176,7 +178,16 @@ void Foam::ReactingLookupTableInjection<CloudType>::setPositionAndCell
label& tetPtI label& tetPtI
) )
{ {
label injectorI = parcelI*injectorCells_.size()/nParcels; label injectorI = 0;
if (randomise_)
{
cachedRandom& rnd = this->owner().rndGen();
injectorI = rnd.position<label>(0, injectorCells_.size() - 1);
}
else
{
injectorI = parcelI*injectorCells_.size()/nParcels;
}
position = injectors_[injectorI].x(); position = injectors_[injectorI].x();
cellOwner = injectorCells_[injectorI]; cellOwner = injectorCells_[injectorI];

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -81,6 +81,9 @@ class ReactingLookupTableInjection
//- Number of parcels per injector - common to all injection sources //- Number of parcels per injector - common to all injection sources
const scalar parcelsPerSecond_; const scalar parcelsPerSecond_;
//- Flag to indicate to randomise injection positions
bool randomise_;
//- List of injectors //- List of injectors
reactingParcelInjectionDataIOList injectors_; reactingParcelInjectionDataIOList injectors_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -43,6 +43,7 @@ ReactingMultiphaseLookupTableInjection
( (
readScalar(this->coeffDict().lookup("parcelsPerSecond")) readScalar(this->coeffDict().lookup("parcelsPerSecond"))
), ),
randomise_(readBool(this->coeffDict().lookup("randomise"))),
injectors_ injectors_
( (
IOobject IOobject
@ -88,6 +89,7 @@ ReactingMultiphaseLookupTableInjection
inputFileName_(im.inputFileName_), inputFileName_(im.inputFileName_),
duration_(im.duration_), duration_(im.duration_),
parcelsPerSecond_(im.parcelsPerSecond_), parcelsPerSecond_(im.parcelsPerSecond_),
randomise_(im.randomise_),
injectors_(im.injectors_), injectors_(im.injectors_),
injectorCells_(im.injectorCells_), injectorCells_(im.injectorCells_),
injectorTetFaces_(im.injectorTetFaces_), injectorTetFaces_(im.injectorTetFaces_),
@ -182,7 +184,16 @@ void Foam::ReactingMultiphaseLookupTableInjection<CloudType>::setPositionAndCell
label& tetPtI label& tetPtI
) )
{ {
label injectorI = parcelI*injectorCells_.size()/nParcels; label injectorI = 0;
if (randomise_)
{
cachedRandom& rnd = this->owner().rndGen();
injectorI = rnd.position<label>(0, injectorCells_.size() - 1);
}
else
{
injectorI = parcelI*injectorCells_.size()/nParcels;
}
position = injectors_[injectorI].x(); position = injectors_[injectorI].x();
cellOwner = injectorCells_[injectorI]; cellOwner = injectorCells_[injectorI];

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -84,6 +84,9 @@ class ReactingMultiphaseLookupTableInjection
//- Number of parcels per injector - common to all injection sources //- Number of parcels per injector - common to all injection sources
const scalar parcelsPerSecond_; const scalar parcelsPerSecond_;
//- Flag to indicate to randomise injection positions
bool randomise_;
//- List of injectors //- List of injectors
reactingMultiphaseParcelInjectionDataIOList injectors_; reactingMultiphaseParcelInjectionDataIOList injectors_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -43,6 +43,7 @@ Foam::ThermoLookupTableInjection<CloudType>::ThermoLookupTableInjection
( (
readScalar(this->coeffDict().lookup("parcelsPerSecond")) readScalar(this->coeffDict().lookup("parcelsPerSecond"))
), ),
randomise_(readBool(this->coeffDict().lookup("randomise"))),
injectors_ injectors_
( (
IOobject IOobject
@ -87,6 +88,7 @@ Foam::ThermoLookupTableInjection<CloudType>::ThermoLookupTableInjection
inputFileName_(im.inputFileName_), inputFileName_(im.inputFileName_),
duration_(im.duration_), duration_(im.duration_),
parcelsPerSecond_(im.parcelsPerSecond_), parcelsPerSecond_(im.parcelsPerSecond_),
randomise_(im.randomise_),
injectors_(im.injectors_), injectors_(im.injectors_),
injectorCells_(im.injectorCells_), injectorCells_(im.injectorCells_),
injectorTetFaces_(im.injectorTetFaces_), injectorTetFaces_(im.injectorTetFaces_),
@ -177,7 +179,16 @@ void Foam::ThermoLookupTableInjection<CloudType>::setPositionAndCell
label& tetPtI label& tetPtI
) )
{ {
label injectorI = parcelI*injectorCells_.size()/nParcels; label injectorI = 0;
if (randomise_)
{
cachedRandom& rnd = this->owner().rndGen();
injectorI = rnd.position<label>(0, injectorCells_.size() - 1);
}
else
{
injectorI = parcelI*injectorCells_.size()/nParcels;
}
position = injectors_[injectorI].x(); position = injectors_[injectorI].x();
cellOwner = injectorCells_[injectorI]; cellOwner = injectorCells_[injectorI];

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -80,6 +80,9 @@ class ThermoLookupTableInjection
//- Number of parcels per injector - common to all injection sources //- Number of parcels per injector - common to all injection sources
const scalar parcelsPerSecond_; const scalar parcelsPerSecond_;
//- Flag to indicate to randomise injection positions
bool randomise_;
//- List of injectors //- List of injectors
kinematicParcelInjectionDataIOList injectors_; kinematicParcelInjectionDataIOList injectors_;

View File

@ -311,6 +311,7 @@ Foam::fieldAverage::fieldAverage
prevTimeIndex_(-1), prevTimeIndex_(-1),
resetOnRestart_(false), resetOnRestart_(false),
resetOnOutput_(false), resetOnOutput_(false),
initialised_(false),
faItems_(), faItems_(),
meanScalarFields_(), meanScalarFields_(),
meanVectorFields_(), meanVectorFields_(),
@ -361,11 +362,7 @@ void Foam::fieldAverage::read(const dictionary& dict)
dict.readIfPresent("resetOnOutput", resetOnOutput_); dict.readIfPresent("resetOnOutput", resetOnOutput_);
dict.lookup("fields") >> faItems_; dict.lookup("fields") >> faItems_;
initialize();
readAveragingProperties(); readAveragingProperties();
// ensure first averaging works unconditionally
prevTimeIndex_ = -1;
} }
} }
@ -374,6 +371,16 @@ void Foam::fieldAverage::execute()
{ {
if (active_) if (active_)
{ {
if (!initialised_)
{
initialize();
// ensure first averaging works unconditionally
prevTimeIndex_ = -1;
initialised_ = true;
}
calcAverages(); calcAverages();
} }
} }

View File

@ -171,6 +171,9 @@ protected:
//- Reset the averaging process on output flag //- Reset the averaging process on output flag
Switch resetOnOutput_; Switch resetOnOutput_;
//- Initialised flag
bool initialised_;
//- List of field average items, describing what averages to be //- List of field average items, describing what averages to be
// calculated and output // calculated and output
List<fieldAverageItem> faItems_; List<fieldAverageItem> faItems_;

View File

@ -28,16 +28,12 @@ License
#include "dictionary.H" #include "dictionary.H"
#include "Time.H" #include "Time.H"
#include "wordReList.H" #include "wordReList.H"
#include "fvcGrad.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
#include "incompressible/RAS/RASModel/RASModel.H"
#include "incompressible/LES/LESModel/LESModel.H"
#include "fluidThermo.H"
#include "compressible/RAS/RASModel/RASModel.H"
#include "compressible/LES/LESModel/LESModel.H"
#include "porosityModel.H" #include "porosityModel.H"
#include "fluidThermo.H"
#include "incompressible/turbulenceModel/turbulenceModel.H"
#include "compressible/turbulenceModel/turbulenceModel.H"
#include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -70,38 +66,27 @@ void Foam::forces::writeFileHeader(const label i)
Foam::tmp<Foam::volSymmTensorField> Foam::forces::devRhoReff() const Foam::tmp<Foam::volSymmTensorField> Foam::forces::devRhoReff() const
{ {
if (obr_.foundObject<compressible::RASModel>("RASProperties")) typedef compressible::turbulenceModel cmpTurbModel;
{ typedef incompressible::turbulenceModel icoTurbModel;
const compressible::RASModel& ras
= obr_.lookupObject<compressible::RASModel>("RASProperties");
return ras.devRhoReff(); if (obr_.foundObject<cmpTurbModel>(cmpTurbModel::typeName))
}
else if (obr_.foundObject<incompressible::RASModel>("RASProperties"))
{ {
const incompressible::RASModel& ras const cmpTurbModel& turb =
= obr_.lookupObject<incompressible::RASModel>("RASProperties"); obr_.lookupObject<cmpTurbModel>(cmpTurbModel::typeName);
return rho()*ras.devReff(); return turb.devRhoReff();
} }
else if (obr_.foundObject<compressible::LESModel>("LESProperties")) else if (obr_.foundObject<icoTurbModel>(icoTurbModel::typeName))
{ {
const compressible::LESModel& les = const incompressible::turbulenceModel& turb =
obr_.lookupObject<compressible::LESModel>("LESProperties"); obr_.lookupObject<icoTurbModel>(icoTurbModel::typeName);
return les.devRhoReff(); return rho()*turb.devReff();
} }
else if (obr_.foundObject<incompressible::LESModel>("LESProperties")) else if (obr_.foundObject<fluidThermo>(fluidThermo::typeName))
{
const incompressible::LESModel& les
= obr_.lookupObject<incompressible::LESModel>("LESProperties");
return rho()*les.devReff();
}
else if (obr_.foundObject<fluidThermo>("thermophysicalProperties"))
{ {
const fluidThermo& thermo = const fluidThermo& thermo =
obr_.lookupObject<fluidThermo>("thermophysicalProperties"); obr_.lookupObject<fluidThermo>(fluidThermo::typeName);
const volVectorField& U = obr_.lookupObject<volVectorField>(UName_); const volVectorField& U = obr_.lookupObject<volVectorField>(UName_);

View File

@ -70,7 +70,7 @@ Foam::dimensionedScalar Foam::pressureTools::rhoScale
} }
else else
{ {
return dimensionedScalar("rhoRef", dimDensity, rhoRef_); return dimensionedScalar("rhoRef", dimDensity, rhoInf_);
} }
} }
@ -100,7 +100,7 @@ Foam::tmp<Foam::volScalarField> Foam::pressureTools::rho
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
p.mesh(), p.mesh(),
dimensionedScalar("zero", dimDensity, rhoRef_) dimensionedScalar("zero", dimDensity, rhoInf_)
) )
); );
} }
@ -193,7 +193,6 @@ Foam::pressureTools::pressureTools
pName_("p"), pName_("p"),
UName_("U"), UName_("U"),
rhoName_("rho"), rhoName_("rho"),
rhoRef_(1.0),
calcTotal_(false), calcTotal_(false),
pRef_(0.0), pRef_(0.0),
calcCoeff_(false), calcCoeff_(false),
@ -242,7 +241,7 @@ void Foam::pressureTools::read(const dictionary& dict)
if (p.dimensions() != dimPressure) if (p.dimensions() != dimPressure)
{ {
dict.lookup("rhoRef") >> rhoRef_; dict.lookup("rhoRef") >> rhoInf_;
} }
dict.lookup("calcTotal") >> calcTotal_; dict.lookup("calcTotal") >> calcTotal_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -92,7 +92,6 @@ Description
\table \table
Property | Description | Required | Default value Property | Description | Required | Default value
type | type name: pressureTools| yes | type | type name: pressureTools| yes |
rhoRef | Reference density for incompressible cases | no | 1
calcTotal | Calculate total coefficient | yes | calcTotal | Calculate total coefficient | yes |
pRef | Reference pressure for total pressure | no | 0.0 pRef | Reference pressure for total pressure | no | 0.0
calcCoeff | Calculate pressure coefficient | yes | calcCoeff | Calculate pressure coefficient | yes |
@ -150,9 +149,6 @@ class pressureTools
//- Name of density field, default is "rho" //- Name of density field, default is "rho"
word rhoName_; word rhoName_;
//- Reference density employed for incompressible cases
scalar rhoRef_;
// Total pressure calculation // Total pressure calculation

View File

@ -24,6 +24,10 @@ $(KINEMATICMODELS)/injectionModel/drippingInjection/drippingInjection.C
$(KINEMATICMODELS)/injectionModel/removeInjection/removeInjection.C $(KINEMATICMODELS)/injectionModel/removeInjection/removeInjection.C
$(KINEMATICMODELS)/injectionModel/curvatureSeparation/curvatureSeparation.C $(KINEMATICMODELS)/injectionModel/curvatureSeparation/curvatureSeparation.C
$(KINEMATICMODELS)/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModel.C
$(KINEMATICMODELS)/filmTurbulenceModel/filmTurbulenceModel/filmTurbulenceModelNew.C
$(KINEMATICMODELS)/filmTurbulenceModel/laminar/laminar.C
THERMOMODELS=submodels/thermo THERMOMODELS=submodels/thermo
$(THERMOMODELS)/phaseChangeModel/phaseChangeModel/phaseChangeModel.C $(THERMOMODELS)/phaseChangeModel/phaseChangeModel/phaseChangeModel.C
$(THERMOMODELS)/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C $(THERMOMODELS)/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C

View File

@ -163,7 +163,7 @@ tmp<volScalarField> kinematicSingleLayer::pu()
( (
IOobject IOobject
( (
"pu", typeName + ":pu",
time_.timeName(), time_.timeName(),
regionMesh(), regionMesh(),
IOobject::NO_READ, IOobject::NO_READ,
@ -185,7 +185,7 @@ tmp<volScalarField> kinematicSingleLayer::pp()
( (
IOobject IOobject
( (
"pp", typeName + ":pp",
time_.timeName(), time_.timeName(),
regionMesh(), regionMesh(),
IOobject::NO_READ, IOobject::NO_READ,
@ -216,6 +216,8 @@ void kinematicSingleLayer::updateSubmodels()
// Update source fields // Update source fields
const dimensionedScalar deltaT = time().deltaT(); const dimensionedScalar deltaT = time().deltaT();
rhoSp_ += cloudMassTrans_/magSf()/deltaT; rhoSp_ += cloudMassTrans_/magSf()/deltaT;
turbulence_->correct();
} }
@ -282,9 +284,7 @@ void kinematicSingleLayer::updateSurfaceVelocities()
Uw_ -= nHat()*(Uw_ & nHat()); Uw_ -= nHat()*(Uw_ & nHat());
Uw_.correctBoundaryConditions(); Uw_.correctBoundaryConditions();
// apply quadratic profile to surface velocity (scale by sqrt(2)) Us_ = turbulence_->Us();
Us_ = 1.414*U_;
Us_.correctBoundaryConditions();
} }
@ -309,6 +309,7 @@ tmp<Foam::fvVectorMatrix> kinematicSingleLayer::solveMomentum
// - fvm::SuSp(rhoSp_, U_) // - fvm::SuSp(rhoSp_, U_)
- rhoSp_*U_ - rhoSp_*U_
+ forces_.correct(U_) + forces_.correct(U_)
+ turbulence_->Su(U_)
); );
fvVectorMatrix& UEqn = tUEqn(); fvVectorMatrix& UEqn = tUEqn();
@ -779,6 +780,8 @@ kinematicSingleLayer::kinematicSingleLayer
injection_(*this, coeffs_), injection_(*this, coeffs_),
turbulence_(filmTurbulenceModel::New(*this, coeffs_)),
forces_(*this, coeffs_), forces_(*this, coeffs_),
addedMassTotal_(0.0) addedMassTotal_(0.0)
@ -1020,7 +1023,7 @@ tmp<volScalarField> kinematicSingleLayer::primaryMassTrans() const
( (
IOobject IOobject
( (
"kinematicSingleLayer::primaryMassTrans", typeName + ":primaryMassTrans",
time().timeName(), time().timeName(),
primaryMesh(), primaryMesh(),
IOobject::NO_READ, IOobject::NO_READ,
@ -1075,7 +1078,7 @@ tmp<DimensionedField<scalar, volMesh> > kinematicSingleLayer::Srho() const
( (
IOobject IOobject
( (
"kinematicSingleLayer::Srho", typeName + ":Srho",
time().timeName(), time().timeName(),
primaryMesh(), primaryMesh(),
IOobject::NO_READ, IOobject::NO_READ,
@ -1100,7 +1103,7 @@ tmp<DimensionedField<scalar, volMesh> > kinematicSingleLayer::Srho
( (
IOobject IOobject
( (
"kinematicSingleLayer::Srho(" + Foam::name(i) + ")", typeName + ":Srho(" + Foam::name(i) + ")",
time().timeName(), time().timeName(),
primaryMesh(), primaryMesh(),
IOobject::NO_READ, IOobject::NO_READ,
@ -1122,7 +1125,7 @@ tmp<DimensionedField<scalar, volMesh> > kinematicSingleLayer::Sh() const
( (
IOobject IOobject
( (
"kinematicSingleLayer::Sh", typeName + ":Sh",
time().timeName(), time().timeName(),
primaryMesh(), primaryMesh(),
IOobject::NO_READ, IOobject::NO_READ,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -43,6 +43,7 @@ SourceFiles
#include "injectionModelList.H" #include "injectionModelList.H"
#include "forceList.H" #include "forceList.H"
#include "filmTurbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -197,6 +198,9 @@ protected:
//- Cloud injection //- Cloud injection
injectionModelList injection_; injectionModelList injection_;
//- Turbulence model
autoPtr<filmTurbulenceModel> turbulence_;
//- List of film forces //- List of film forces
forceList forces_; forceList forces_;
@ -444,6 +448,9 @@ public:
//- Injection //- Injection
inline injectionModelList& injection(); inline injectionModelList& injection();
//- Turbulence
inline const filmTurbulenceModel& turbulence() const;
// Helper functions // Helper functions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -169,6 +169,12 @@ inline injectionModelList& kinematicSingleLayer::injection()
} }
inline const filmTurbulenceModel& kinematicSingleLayer::turbulence() const
{
return turbulence_();
}
inline tmp<volScalarField> kinematicSingleLayer::mass() const inline tmp<volScalarField> kinematicSingleLayer::mass() const
{ {
return rho_*delta_*magSf(); return rho_*delta_*magSf();

View File

@ -0,0 +1,73 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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 "filmTurbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace regionModels
{
namespace surfaceFilmModels
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(filmTurbulenceModel, 0);
defineRunTimeSelectionTable(filmTurbulenceModel, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
filmTurbulenceModel::filmTurbulenceModel(const surfaceFilmModel& owner)
:
subModelBase(owner)
{}
filmTurbulenceModel::filmTurbulenceModel
(
const word& type,
const surfaceFilmModel& owner,
const dictionary& dict
)
:
subModelBase(type, owner, dict)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
filmTurbulenceModel::~filmTurbulenceModel()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace regionModels
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,148 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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::regionModels::surfaceFilmModels::filmTurbulenceModel
Description
Base class for film turbulence models
SourceFiles
filmTurbulenceModel.C
filmTurbulenceModelNew.C
\*---------------------------------------------------------------------------*/
#ifndef filmTurbulenceModel_H
#define filmTurbulenceModel_H
#include "subModelBase.H"
#include "runTimeSelectionTables.H"
#include "fvMatricesFwd.H"
#include "volFieldsFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace regionModels
{
namespace surfaceFilmModels
{
/*---------------------------------------------------------------------------*\
Class filmTurbulenceModel Declaration
\*---------------------------------------------------------------------------*/
class filmTurbulenceModel
:
public subModelBase
{
private:
// Private Member Functions
//- Disallow default bitwise copy construct
filmTurbulenceModel(const filmTurbulenceModel&);
//- Disallow default bitwise assignment
void operator=(const filmTurbulenceModel&);
public:
//- Runtime type information
TypeName("filmTurbulenceModel");
// Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
filmTurbulenceModel,
dictionary,
(
const surfaceFilmModel& owner,
const dictionary& dict
),
(owner, dict)
);
// Constructors
//- Construct null
filmTurbulenceModel(const surfaceFilmModel& owner);
//- Construct from type name, dictionary and surface film model
filmTurbulenceModel
(
const word& type,
const surfaceFilmModel& owner,
const dictionary& dict
);
// Selectors
//- Return a reference to the selected injection model
static autoPtr<filmTurbulenceModel> New
(
const surfaceFilmModel& owner,
const dictionary& dict
);
//- Destructor
virtual ~filmTurbulenceModel();
// Member Functions
// Evolution
//- Return the film surface velocity
virtual tmp<volVectorField> Us() const = 0;
//- Return the film turbulence viscosity
virtual tmp<volScalarField> mut() const = 0;
//- Correct/update the model
virtual void correct() = 0;
//- Return the source for the film momentum equation
virtual tmp<fvVectorMatrix> Su(volVectorField& U) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace regionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,77 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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 "filmTurbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace regionModels
{
namespace surfaceFilmModels
{
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
autoPtr<filmTurbulenceModel> filmTurbulenceModel::New
(
const surfaceFilmModel& model,
const dictionary& dict
)
{
const word modelType(dict.lookup("turbulence"));
Info<< " " << modelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(modelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"filmTurbulenceModel::New"
"("
"const surfaceFilmModel&, "
"const dictionary&"
")"
) << "Unknown filmTurbulenceModel type " << modelType
<< nl << nl << "Valid filmTurbulenceModel types are:" << nl
<< dictionaryConstructorTablePtr_->toc()
<< exit(FatalError);
}
return autoPtr<filmTurbulenceModel>(cstrIter()(model, dict));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace regionModels
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,160 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 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 "laminar.H"
#include "addToRunTimeSelectionTable.H"
#include "fvMesh.H"
#include "fvMatrices.H"
#include "Time.H"
#include "volFields.H"
#include "fvmSup.H"
#include "kinematicSingleLayer.H"
#include "zeroGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace regionModels
{
namespace surfaceFilmModels
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(laminar, 0);
addToRunTimeSelectionTable(filmTurbulenceModel, laminar, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
laminar::laminar
(
const surfaceFilmModel& owner,
const dictionary& dict
)
:
filmTurbulenceModel(type(), owner, dict),
Cf_(readScalar(coeffs_.lookup("Cf")))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
laminar::~laminar()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
tmp<volVectorField> laminar::Us() const
{
tmp<volVectorField> tUs
(
new volVectorField
(
IOobject
(
typeName + ".Us",
owner_.regionMesh().time().timeName(),
owner_.regionMesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
owner_.regionMesh(),
dimensionedVector("zero", dimVelocity, vector::zero),
zeroGradientFvPatchVectorField::typeName
)
);
// apply quadratic profile
tUs() = Foam::sqrt(2.0)*owner_.U();
tUs().correctBoundaryConditions();
return tUs;
}
tmp<volScalarField> laminar::mut() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
typeName + ".mut",
owner_.regionMesh().time().timeName(),
owner_.regionMesh(),
IOobject::NO_READ,
IOobject::NO_WRITE
),
owner_.regionMesh(),
dimensionedScalar("zero", dimMass/dimLength/dimTime, 0.0)
)
);
}
void laminar::correct()
{
// do nothing
}
tmp<fvVectorMatrix> laminar::Su(volVectorField& U) const
{
// local reference to film model
const kinematicSingleLayer& film =
static_cast<const kinematicSingleLayer&>(owner_);
// local references to film fields
const volScalarField& mu = film.mu();
const volVectorField& Uw = film.Uw();
const volVectorField& Us = film.Us();
const volScalarField& delta = film.delta();
const volVectorField& Up = film.UPrimary();
const volScalarField& rhop = film.rhoPrimary();
// employ simple coeff-based model
volScalarField Cs("Cs", Cf_*rhop*mag(Up - Us));
dimensionedScalar d0("SMALL", delta.dimensions(), SMALL);
volScalarField Cw("Cw", mu/(0.3333*(delta + d0)));
Cw.min(5000.0);
return
(
- fvm::Sp(Cs, U) + Cs*Us // surface contribution
- fvm::Sp(Cw, U) + Cw*Uw // wall contribution
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace regionModels
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,118 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 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::regionModels::surfaceFilmModels::laminar
Description
Film laminar turbulence model.
SourceFiles
laminar.C
\*---------------------------------------------------------------------------*/
#ifndef laminar_H
#define laminar_H
#include "filmTurbulenceModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace regionModels
{
namespace surfaceFilmModels
{
/*---------------------------------------------------------------------------*\
Class laminar Declaration
\*---------------------------------------------------------------------------*/
class laminar
:
public filmTurbulenceModel
{
private:
// Private Data
//- Surface roughness coefficient
scalar Cf_;
// Private member functions
//- Disallow default bitwise copy construct
laminar(const laminar&);
//- Disallow default bitwise assignment
void operator=(const laminar&);
public:
//- Runtime type information
TypeName("laminar");
// Constructors
//- Construct from surface film model
laminar(const surfaceFilmModel& owner, const dictionary& dict);
//- Destructor
virtual ~laminar();
// Member Functions
// Evolution
//- Return the film surface velocity
virtual tmp<volVectorField> Us() const;
//- Return the film turbulence viscosity
virtual tmp<volScalarField> mut() const;
//- Correct/update the model
virtual void correct();
//- Return the source for the film momentum equation
virtual tmp<fvVectorMatrix> Su(volVectorField& U) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceFilmModels
} // End namespace regionModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -63,12 +63,22 @@ tmp<volScalarField> SpalartAllmaras::fv1() const
tmp<volScalarField> SpalartAllmaras::fv2() const tmp<volScalarField> SpalartAllmaras::fv2() const
{ {
if (ashfordCorrection_)
{
return 1.0/pow3(scalar(1) + rho()*nuTilda_/(mu()*Cv2_)); return 1.0/pow3(scalar(1) + rho()*nuTilda_/(mu()*Cv2_));
}
else
{
const volScalarField chi("chi", rho()*nuTilda_/mu());
return 1.0 - chi/(1.0 + chi*fv1());
}
} }
tmp<volScalarField> SpalartAllmaras::fv3() const tmp<volScalarField> SpalartAllmaras::fv3() const
{ {
if (ashfordCorrection_)
{
volScalarField chi(rho()*nuTilda_/mu()); volScalarField chi(rho()*nuTilda_/mu());
volScalarField chiByCv2((1/Cv2_)*chi); volScalarField chiByCv2((1/Cv2_)*chi);
@ -77,6 +87,27 @@ tmp<volScalarField> SpalartAllmaras::fv3() const
*(1/Cv2_) *(1/Cv2_)
*(3*(scalar(1) + chiByCv2) + sqr(chiByCv2)) *(3*(scalar(1) + chiByCv2) + sqr(chiByCv2))
/pow3(scalar(1) + chiByCv2); /pow3(scalar(1) + chiByCv2);
}
else
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"fv3",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("fv3", dimless, 1),
zeroGradientFvPatchScalarField::typeName
)
);
}
} }
@ -222,6 +253,8 @@ SpalartAllmaras::SpalartAllmaras
) )
), ),
ashfordCorrection_(coeffDict_.lookupOrDefault("ashfordCorrection", true)),
nuTilda_ nuTilda_
( (
IOobject IOobject
@ -265,6 +298,11 @@ SpalartAllmaras::SpalartAllmaras
updateSubGridScaleFields(); updateSubGridScaleFields();
printCoeffs(); printCoeffs();
if (ashfordCorrection_)
{
Info<< " Employing Ashford correction" << endl;
}
} }
@ -344,16 +382,19 @@ bool SpalartAllmaras::read()
{ {
sigmaNut_.readIfPresent(coeffDict()); sigmaNut_.readIfPresent(coeffDict());
Prt_.readIfPresent(coeffDict()); Prt_.readIfPresent(coeffDict());
Cb1_.readIfPresent(coeffDict()); Cb1_.readIfPresent(coeffDict());
Cb2_.readIfPresent(coeffDict()); Cb2_.readIfPresent(coeffDict());
Cw1_ = Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_;
Cw2_.readIfPresent(coeffDict());
Cw3_.readIfPresent(coeffDict());
Cv1_.readIfPresent(coeffDict()); Cv1_.readIfPresent(coeffDict());
Cv2_.readIfPresent(coeffDict()); Cv2_.readIfPresent(coeffDict());
CDES_.readIfPresent(coeffDict()); CDES_.readIfPresent(coeffDict());
ck_.readIfPresent(coeffDict()); ck_.readIfPresent(coeffDict());
kappa_.readIfPresent(*this); kappa_.readIfPresent(*this);
Cw1_ = Cb1_/sqr(kappa_) + (1.0 + Cb2_)/sigmaNut_;
Cw2_.readIfPresent(coeffDict());
Cw3_.readIfPresent(coeffDict());
ashfordCorrection_.readIfPresent("ashfordCorrection", coeffDict());
return true; return true;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,6 +30,15 @@ Group
Description Description
SpalartAllmaras for compressible flows SpalartAllmaras for compressible flows
Extended according to
\verbatim
"An Unstructured Grid Generation and Adaptive Solution Technique
for High Reynolds Number Compressible Flows"
G.A. Ashford,
Ph.D. thesis, University of Michigan, 1996.
\endverbatim
by using the optional flag \c ashfordCorrection
SourceFiles SourceFiles
SpalartAllmaras.C SpalartAllmaras.C
@ -77,6 +86,10 @@ class SpalartAllmaras
dimensionedScalar Cw3_; dimensionedScalar Cw3_;
//- Optional flag to activate the Ashford correction
Switch ashfordCorrection_;
// Fields // Fields
volScalarField nuTilda_; volScalarField nuTilda_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -63,7 +63,14 @@ tmp<volScalarField> SpalartAllmaras::fv2
const volScalarField& fv1 const volScalarField& fv1
) const ) const
{ {
if (ashfordCorrection_)
{
return 1.0/pow3(scalar(1) + chi/Cv2_); return 1.0/pow3(scalar(1) + chi/Cv2_);
}
else
{
return 1.0 - chi/(1.0 + chi*fv1);
}
} }
@ -73,6 +80,8 @@ tmp<volScalarField> SpalartAllmaras::fv3
const volScalarField& fv1 const volScalarField& fv1
) const ) const
{ {
if (ashfordCorrection_)
{
const volScalarField chiByCv2((1/Cv2_)*chi); const volScalarField chiByCv2((1/Cv2_)*chi);
return return
@ -80,6 +89,27 @@ tmp<volScalarField> SpalartAllmaras::fv3
*(1/Cv2_) *(1/Cv2_)
*(3*(scalar(1) + chiByCv2) + sqr(chiByCv2)) *(3*(scalar(1) + chiByCv2) + sqr(chiByCv2))
/pow3(scalar(1) + chiByCv2); /pow3(scalar(1) + chiByCv2);
}
else
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"fv3",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("fv3", dimless, 1),
zeroGradientFvPatchScalarField::typeName
)
);
}
} }
@ -252,6 +282,11 @@ SpalartAllmaras::SpalartAllmaras
alphat_.correctBoundaryConditions(); alphat_.correctBoundaryConditions();
printCoeffs(); printCoeffs();
if (ashfordCorrection_)
{
Info<< " Employing Ashford correction" << endl;
}
} }
@ -372,6 +407,8 @@ bool SpalartAllmaras::read()
Cv1_.readIfPresent(coeffDict()); Cv1_.readIfPresent(coeffDict());
Cv2_.readIfPresent(coeffDict()); Cv2_.readIfPresent(coeffDict());
ashfordCorrection_.readIfPresent("ashfordCorrection", coeffDict());
return true; return true;
} }
else else

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -37,14 +37,16 @@ Description
P.R. Spalart, P.R. Spalart,
S.R. Allmaras, S.R. Allmaras,
La Recherche Aerospatiale, No. 1, 1994, pp. 5-21. La Recherche Aerospatiale, No. 1, 1994, pp. 5-21.
\endverbatim
Extended according to: Extended according to:
\verbatim
"An Unstructured Grid Generation and Adaptive Solution Technique "An Unstructured Grid Generation and Adaptive Solution Technique
for High Reynolds Number Compressible Flows" for High Reynolds Number Compressible Flows"
G.A. Ashford, G.A. Ashford,
Ph.D. thesis, University of Michigan, 1996. Ph.D. thesis, University of Michigan, 1996.
\endverbatim \endverbatim
by using the optional flag \c ashfordCorrection
The default model coefficients correspond to the following: The default model coefficients correspond to the following:
\verbatim \verbatim
@ -110,6 +112,10 @@ protected:
dimensionedScalar Cv2_; dimensionedScalar Cv2_;
//- Optional flag to activate the Ashford correction
Switch ashfordCorrection_;
// Fields // Fields
volScalarField nuTilda_; volScalarField nuTilda_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -60,12 +60,22 @@ tmp<volScalarField> SpalartAllmaras::fv1() const
tmp<volScalarField> SpalartAllmaras::fv2() const tmp<volScalarField> SpalartAllmaras::fv2() const
{ {
if (ashfordCorrection_)
{
return 1/pow3(scalar(1) + nuTilda_/(Cv2_*nu())); return 1/pow3(scalar(1) + nuTilda_/(Cv2_*nu()));
}
else
{
const volScalarField chi("chi", nuTilda_/nu());
return 1.0 - chi/(1.0 + chi*fv1());
}
} }
tmp<volScalarField> SpalartAllmaras::fv3() const tmp<volScalarField> SpalartAllmaras::fv3() const
{ {
if (ashfordCorrection_)
{
const volScalarField chi("chi", nuTilda_/nu()); const volScalarField chi("chi", nuTilda_/nu());
const volScalarField chiByCv2(chi/Cv2_); const volScalarField chiByCv2(chi/Cv2_);
@ -74,6 +84,27 @@ tmp<volScalarField> SpalartAllmaras::fv3() const
*(1/Cv2_) *(1/Cv2_)
*(3*(scalar(1) + chiByCv2) + sqr(chiByCv2)) *(3*(scalar(1) + chiByCv2) + sqr(chiByCv2))
/pow3(scalar(1) + chiByCv2); /pow3(scalar(1) + chiByCv2);
}
else
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"fv3",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("fv3", dimless, 1),
zeroGradientFvPatchScalarField::typeName
)
);
}
} }
@ -246,6 +277,8 @@ SpalartAllmaras::SpalartAllmaras
) )
), ),
ashfordCorrection_(coeffDict_.lookupOrDefault("ashfordCorrection", true)),
y_(mesh_), y_(mesh_),
nuTilda_ nuTilda_
@ -275,6 +308,11 @@ SpalartAllmaras::SpalartAllmaras
) )
{ {
updateSubGridScaleFields(); updateSubGridScaleFields();
if (ashfordCorrection_)
{
Info<< " Employing Ashford correction" << endl;
}
} }
@ -376,6 +414,7 @@ bool SpalartAllmaras::read()
{ {
sigmaNut_.readIfPresent(coeffDict()); sigmaNut_.readIfPresent(coeffDict());
kappa_.readIfPresent(*this); kappa_.readIfPresent(*this);
Cb1_.readIfPresent(coeffDict()); Cb1_.readIfPresent(coeffDict());
Cb2_.readIfPresent(coeffDict()); Cb2_.readIfPresent(coeffDict());
Cv1_.readIfPresent(coeffDict()); Cv1_.readIfPresent(coeffDict());
@ -386,6 +425,8 @@ bool SpalartAllmaras::read()
Cw2_.readIfPresent(coeffDict()); Cw2_.readIfPresent(coeffDict());
Cw3_.readIfPresent(coeffDict()); Cw3_.readIfPresent(coeffDict());
ashfordCorrection_.readIfPresent("ashfordCorrection", coeffDict());
return true; return true;
} }
else else

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -30,6 +30,15 @@ Group
Description Description
SpalartAllmaras DES (SA + LES) turbulence model for incompressible flows SpalartAllmaras DES (SA + LES) turbulence model for incompressible flows
Extended according to
\verbatim
"An Unstructured Grid Generation and Adaptive Solution Technique
for High Reynolds Number Compressible Flows"
G.A. Ashford,
Ph.D. thesis, University of Michigan, 1996.
\endverbatim
by using the optional flag \c ashfordCorrection
SourceFiles SourceFiles
SpalartAllmaras.C SpalartAllmaras.C
@ -90,6 +99,10 @@ protected:
dimensionedScalar Cw3_; dimensionedScalar Cw3_;
//- Optional flag to activate the Ashford correction
Switch ashfordCorrection_;
// Fields // Fields
wallDist y_; wallDist y_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -61,7 +61,14 @@ tmp<volScalarField> SpalartAllmaras::fv2
const volScalarField& fv1 const volScalarField& fv1
) const ) const
{ {
if (ashfordCorrection_)
{
return 1.0/pow3(scalar(1) + chi/Cv2_); return 1.0/pow3(scalar(1) + chi/Cv2_);
}
else
{
return 1.0 - chi/(1.0 + chi*fv1);
}
} }
@ -71,6 +78,8 @@ tmp<volScalarField> SpalartAllmaras::fv3
const volScalarField& fv1 const volScalarField& fv1
) const ) const
{ {
if (ashfordCorrection_)
{
const volScalarField chiByCv2((1/Cv2_)*chi); const volScalarField chiByCv2((1/Cv2_)*chi);
return return
@ -78,6 +87,27 @@ tmp<volScalarField> SpalartAllmaras::fv3
*(1/Cv2_) *(1/Cv2_)
*(3*(scalar(1) + chiByCv2) + sqr(chiByCv2)) *(3*(scalar(1) + chiByCv2) + sqr(chiByCv2))
/pow3(scalar(1) + chiByCv2); /pow3(scalar(1) + chiByCv2);
}
else
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
"fv3",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedScalar("fv3", dimless, 1),
zeroGradientFvPatchScalarField::typeName
)
);
}
} }
@ -195,6 +225,8 @@ SpalartAllmaras::SpalartAllmaras
) )
), ),
ashfordCorrection_(coeffDict_.lookupOrDefault("ashfordCorrection", true)),
nuTilda_ nuTilda_
( (
IOobject IOobject
@ -224,6 +256,11 @@ SpalartAllmaras::SpalartAllmaras
d_(mesh_) d_(mesh_)
{ {
printCoeffs(); printCoeffs();
if (ashfordCorrection_)
{
Info<< " Employing Ashford correction" << endl;
}
} }
@ -368,6 +405,8 @@ bool SpalartAllmaras::read()
Cv1_.readIfPresent(coeffDict()); Cv1_.readIfPresent(coeffDict());
Cv2_.readIfPresent(coeffDict()); Cv2_.readIfPresent(coeffDict());
ashfordCorrection_.readIfPresent("ashfordCorrection", coeffDict());
return true; return true;
} }
else else

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -37,14 +37,16 @@ Description
P.R. Spalart, P.R. Spalart,
S.R. Allmaras, S.R. Allmaras,
La Recherche Aerospatiale, No. 1, 1994, pp. 5-21. La Recherche Aerospatiale, No. 1, 1994, pp. 5-21.
\endverbatim
Extended according to: Extended according to
\verbatim
"An Unstructured Grid Generation and Adaptive Solution Technique "An Unstructured Grid Generation and Adaptive Solution Technique
for High Reynolds Number Compressible Flows" for High Reynolds Number Compressible Flows"
G.A. Ashford, G.A. Ashford,
Ph.D. thesis, University of Michigan, 1996. Ph.D. thesis, University of Michigan, 1996.
\endverbatim \endverbatim
using the optional flag \c ashfordCorrection
The default model coefficients correspond to the following: The default model coefficients correspond to the following:
\verbatim \verbatim
@ -108,6 +110,10 @@ protected:
dimensionedScalar Cv2_; dimensionedScalar Cv2_;
//- Optional flag to activate the Ashford correction
Switch ashfordCorrection_;
// Fields // Fields
volScalarField nuTilda_; volScalarField nuTilda_;