ENH: adding generalizedNewtonian to laminar turbulence model

The generalizedNewtonian viscocity models were ported from
the org version and added to the laminar turbulence framework.

This allows use in compressible and incompressible solvers
through the turbulence dictionary under the laminar sub-dictionary.

The thermal laminar viscosity is taken from the thermo for solvers
that use thermo library or from the transportProperties dictionary
for incompressible solvers.

At the moment the option to include viscocity models through the
transportDict is still available.

The icoTabulated equation of state was ported from the org version.

STYLE: use 'model' instead of 'laminarModel' in tutorials
This commit is contained in:
sergio
2020-07-27 12:38:26 -07:00
committed by Andrew Heather
parent a89ecdeee0
commit c3c4f30a55
60 changed files with 3835 additions and 59 deletions

View File

@ -57,6 +57,9 @@ makeBaseTurbulenceModel
#include "Stokes.H"
makeLaminarModel(Stokes);
#include "generalizedNewtonian.H"
makeLaminarModel(generalizedNewtonian);
#include "Maxwell.H"
makeLaminarModel(Maxwell);

View File

@ -55,6 +55,9 @@ makeBaseTurbulenceModel
#include "Stokes.H"
makeLaminarModel(Stokes);
#include "generalizedNewtonian.H"
makeLaminarModel(generalizedNewtonian);
#include "Maxwell.H"
makeLaminarModel(Maxwell);

View File

@ -62,5 +62,14 @@ RASBCs = RAS/derivedFvPatchFields
$(RASBCs)/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
$(RASBCs)/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
generalizedNewtonianViscosityModels = laminar/generalizedNewtonian/generalizedNewtonianViscosityModels
$(generalizedNewtonianViscosityModels)/generalizedNewtonianViscosityModel/generalizedNewtonianViscosityModel.C
$(generalizedNewtonianViscosityModels)/generalizedNewtonianViscosityModel/generalizedNewtonianViscosityModelNew.C
$(generalizedNewtonianViscosityModels)/CrossPowerLaw/CrossPowerLaw.C
$(generalizedNewtonianViscosityModels)/BirdCarreau/BirdCarreau.C
$(generalizedNewtonianViscosityModels)/Casson/Casson.C
$(generalizedNewtonianViscosityModels)/HerschelBulkley/HerschelBulkley.C
$(generalizedNewtonianViscosityModels)/powerLaw/powerLaw.C
$(generalizedNewtonianViscosityModels)/strainRateFunction/strainRateFunction.C
LIB = $(FOAM_LIBBIN)/libturbulenceModels

View File

@ -0,0 +1,212 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 "generalizedNewtonian.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "fvcGrad.H"
#include "fvcDiv.H"
#include "fvmLaplacian.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarModels
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasicMomentumTransportModel>
generalizedNewtonian<BasicMomentumTransportModel>::generalizedNewtonian
(
const alphaField& alpha,
const rhoField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const transportModel& transport,
const word& propertiesName
)
:
linearViscousStress<laminarModel<BasicMomentumTransportModel>>
(
typeName,
alpha,
rho,
U,
alphaRhoPhi,
phi,
transport,
propertiesName
),
viscosityModel_
(
generalizedNewtonianViscosityModel::New
(
this->coeffDict_
)
),
nu_
(
IOobject
(
IOobject::groupName("generalizedNewtonian:nu", alphaRhoPhi.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
viscosityModel_->nu(this->nu(), strainRate())
)
{}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class BasicMomentumTransportModel>
Foam::tmp<Foam::volScalarField>
generalizedNewtonian<BasicMomentumTransportModel>::strainRate() const
{
return sqrt(scalar{2})*mag(symm(fvc::grad(this->U())));
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class BasicMomentumTransportModel>
bool generalizedNewtonian<BasicMomentumTransportModel>::read()
{
viscosityModel_->read(this->coeffDict_);
return true;
}
template<class BasicMomentumTransportModel>
tmp<volScalarField>
generalizedNewtonian<BasicMomentumTransportModel>::nut() const
{
return volScalarField::New
(
IOobject::groupName("nut", this->alphaRhoPhi_.group()),
this->mesh_,
dimensionedScalar(dimViscosity, Zero)
);
}
template<class BasicMomentumTransportModel>
tmp<scalarField>
generalizedNewtonian<BasicMomentumTransportModel>::nut
(
const label patchi
) const
{
return tmp<scalarField>::New(this->mesh_.boundary()[patchi].size(), Zero);
}
template<class BasicMomentumTransportModel>
tmp<volScalarField>
generalizedNewtonian<BasicMomentumTransportModel>::nuEff() const
{
return volScalarField::New
(
IOobject::groupName("nuEff", this->alphaRhoPhi_.group()),
nu_
);
}
template<class BasicMomentumTransportModel>
tmp<scalarField>
generalizedNewtonian<BasicMomentumTransportModel>::nuEff
(
const label patchi
) const
{
return nu_.boundaryField()[patchi];
}
template<class BasicMomentumTransportModel>
tmp<volScalarField>
generalizedNewtonian<BasicMomentumTransportModel>::k() const
{
return volScalarField::New
(
IOobject::groupName("k", this->alphaRhoPhi_.group()),
this->mesh_,
dimensionedScalar(sqr(this->U_.dimensions()), Zero)
);
}
template<class BasicMomentumTransportModel>
tmp<volScalarField>
generalizedNewtonian<BasicMomentumTransportModel>::epsilon() const
{
return volScalarField::New
(
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
this->mesh_,
dimensionedScalar(sqr(this->U_.dimensions())/dimTime, Zero)
);
}
template<class BasicMomentumTransportModel>
tmp<volSymmTensorField>
generalizedNewtonian<BasicMomentumTransportModel>::R() const
{
return volSymmTensorField::New
(
IOobject::groupName("R", this->alphaRhoPhi_.group()),
this->mesh_,
dimensionedSymmTensor(sqr(this->U_.dimensions()), Zero)
);
}
template<class BasicMomentumTransportModel>
void generalizedNewtonian<BasicMomentumTransportModel>::correct()
{
nu_ = viscosityModel_->nu(this->nu(), strainRate());
laminarModel<BasicMomentumTransportModel>::correct();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace laminarModels
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,167 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
-------------------------------------------------------------------------------
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::laminarModels::generalizedNewtonian
Description
Turbulence model for shear-dependent Non-Newtonian flow.
SourceFiles
generalizedNewtonian.C
\*---------------------------------------------------------------------------*/
#ifndef generalizedNewtonian_H
#define generalizedNewtonian_H
#include "laminarModel.H"
#include "linearViscousStress.H"
#include "generalizedNewtonianViscosityModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarModels
{
/*---------------------------------------------------------------------------*\
Class generalizedNewtonian Declaration
\*---------------------------------------------------------------------------*/
template<class BasicMomentumTransportModel>
class generalizedNewtonian
:
public linearViscousStress<laminarModel<BasicMomentumTransportModel>>
{
protected:
// Protected Data
//- Run-time selectable non-Newtonian viscosity model
autoPtr<generalizedNewtonianViscosityModel> viscosityModel_;
//- The non-Newtonian viscosity field
volScalarField nu_;
// Protected Member Functions
virtual tmp<volScalarField> strainRate() const;
public:
typedef typename BasicMomentumTransportModel::alphaField alphaField;
typedef typename BasicMomentumTransportModel::rhoField rhoField;
typedef typename BasicMomentumTransportModel::transportModel transportModel;
//- Runtime type information
TypeName("generalizedNewtonian");
// Constructors
//- Construct from components
generalizedNewtonian
(
const alphaField& alpha,
const rhoField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const transportModel& transport,
const word& propertiesName
);
// Selectors
//- Return a reference to the selected turbulence model
static autoPtr<generalizedNewtonian> New
(
const alphaField& alpha,
const rhoField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const transportModel& transport,
const word& propertiesName
);
//- Destructor
virtual ~generalizedNewtonian() = default;
// Member Functions
//- Read turbulence (momentumTransport) dictionary
virtual bool read();
//- Return the turbulence viscosity,
virtual tmp<volScalarField> nut() const;
//- Return the turbulence viscosity on patch
virtual tmp<scalarField> nut(const label patchi) const;
//- Return the effective viscosity
virtual tmp<volScalarField> nuEff() const;
//- Return the effective viscosity on patch
virtual tmp<scalarField> nuEff(const label patchi) const;
//- Return the turbulence kinetic energy
virtual tmp<volScalarField> k() const;
//- Return the turbulence kinetic energy dissipation rate,
virtual tmp<volScalarField> epsilon() const;
//- Return the Reynolds stress tensor
virtual tmp<volSymmTensorField> R() const;
//- Correct the generalizedNewtonian viscosity
virtual void correct();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace laminarModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "generalizedNewtonian.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,135 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
Copyright (C) 2017 OpenCFD Ltd
-------------------------------------------------------------------------------
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 "BirdCarreau.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarModels
{
namespace generalizedNewtonianViscosityModels
{
defineTypeNameAndDebug(BirdCarreau, 0);
addToRunTimeSelectionTable
(
generalizedNewtonianViscosityModel,
BirdCarreau,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::laminarModels::generalizedNewtonianViscosityModels::BirdCarreau::
BirdCarreau
(
const dictionary& viscosityProperties
)
:
generalizedNewtonianViscosityModel(viscosityProperties),
BirdCarreauCoeffs_
(
viscosityProperties.optionalSubDict(typeName + "Coeffs")
),
nuInf_("nuInf", dimViscosity, BirdCarreauCoeffs_),
k_("k", dimTime, BirdCarreauCoeffs_),
n_("n", dimless, BirdCarreauCoeffs_),
a_
(
BirdCarreauCoeffs_.getOrDefault
(
"a",
dimensionedScalar("a", dimless, 2)
)
)
{
read(viscosityProperties);
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::laminarModels::generalizedNewtonianViscosityModels::BirdCarreau::
read
(
const dictionary& viscosityProperties
)
{
generalizedNewtonianViscosityModel::read(viscosityProperties);
BirdCarreauCoeffs_ =
viscosityProperties.optionalSubDict(typeName + "Coeffs");
BirdCarreauCoeffs_.readEntry("nuInf", nuInf_);
BirdCarreauCoeffs_.readEntry("k", k_);
BirdCarreauCoeffs_.readEntry("n", n_);
a_ = BirdCarreauCoeffs_.getOrDefault
(
"a",
dimensionedScalar("a", dimless, 2)
);
return true;
}
Foam::tmp<Foam::volScalarField>
Foam::laminarModels::generalizedNewtonianViscosityModels::BirdCarreau::
nu
(
const volScalarField& nu0,
const volScalarField& strainRate
) const
{
return
(
nuInf_
+ (nu0 - nuInf_)
* pow
(
scalar(1)
+ pow
(
k_*strainRate,
a_
),
(n_ - scalar(1))/a_
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,121 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
-------------------------------------------------------------------------------
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::laminarModels::generalizedNewtonianViscosityModels::BirdCarreau
Description
An incompressible Bird-Carreau non-Newtonian viscosity model.
The Bird-Carreau-Yasuda form is also supported if the optional "a"
coefficient is specified. "a" defaults to 2 for the Bird-Carreau model.
Example specification for a polymer:
\verbatim
viscosityModel BirdCarreau;
nuInf 0;
n 0.5;
\endverbatim
SourceFiles
BirdCarreau.C
\*---------------------------------------------------------------------------*/
#ifndef BirdCarreau_H
#define BirdCarreau_H
#include "generalizedNewtonianViscosityModel.H"
#include "dimensionedScalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarModels
{
namespace generalizedNewtonianViscosityModels
{
/*---------------------------------------------------------------------------*\
Class BirdCarreau Declaration
\*---------------------------------------------------------------------------*/
class BirdCarreau
:
public generalizedNewtonianViscosityModel
{
// Private Data
dictionary BirdCarreauCoeffs_;
dimensionedScalar nuInf_;
dimensionedScalar k_;
dimensionedScalar n_;
dimensionedScalar a_;
public:
//- Runtime type information
TypeName("BirdCarreau");
// Constructors
//- Construct from dictionary (components)
explicit BirdCarreau(const dictionary& viscosityProperties);
//- Destructor
virtual ~BirdCarreau() = default;
// Member Functions
//- Read transportProperties dictionary
virtual bool read(const dictionary& viscosityProperties);
//- Return the laminar viscosity
virtual tmp<volScalarField> nu
(
const volScalarField& nu0,
const volScalarField& strainRate
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace generalizedNewtonianViscosityModels
} // End namespace laminarModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,122 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd
-------------------------------------------------------------------------------
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 "Casson.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarModels
{
namespace generalizedNewtonianViscosityModels
{
defineTypeNameAndDebug(Casson, 0);
addToRunTimeSelectionTable
(
generalizedNewtonianViscosityModel,
Casson,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::laminarModels::generalizedNewtonianViscosityModels::Casson::Casson
(
const dictionary& viscosityProperties
)
:
generalizedNewtonianViscosityModel(viscosityProperties),
m_("m", dimViscosity, viscosityProperties),
tau0_("tau0", dimViscosity/dimTime, viscosityProperties),
nuMin_("nuMin", dimViscosity, viscosityProperties),
nuMax_("nuMax", dimViscosity, viscosityProperties)
{
read(viscosityProperties);
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::laminarModels::generalizedNewtonianViscosityModels::Casson::read
(
const dictionary& viscosityProperties
)
{
generalizedNewtonianViscosityModel::read(viscosityProperties);
const dictionary& coeffs =
viscosityProperties.optionalSubDict(typeName + "Coeffs");
coeffs.readEntry("m", m_);
coeffs.readEntry("tau0", tau0_);
coeffs.readEntry("nuMin_", nuMin_);
coeffs.readEntry("nuMax_", nuMax_);
return true;
}
Foam::tmp<Foam::volScalarField>
Foam::laminarModels::generalizedNewtonianViscosityModels::Casson::
nu
(
const volScalarField& nu0,
const volScalarField& strainRate
) const
{
return max
(
nuMin_,
min
(
nuMax_,
sqr
(
sqrt
(
tau0_
/max
(
strainRate,
dimensionedScalar("SMALL", dimless/dimTime, VSMALL)
)
) + sqrt(m_)
)
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,132 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
-------------------------------------------------------------------------------
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::laminarModels::generalizedNewtonianViscosityModels::Casson
Description
Casson generalized Newtonian viscosity model
References:
\verbatim
Casson, N. (1959).
Rheology of disperse systems.
In Proceedings of a Conference Organized by the
British Society of Rheology.
Pergamon Press, New York.
Fournier, R. L. (2011).
Basic transport phenomena in biomedical engineering.
CRC Press.
\endverbatim
Example specification for blood:
\verbatim
viscosityModel Casson;
m 3.934986e-6;
tau0 2.9032e-6;
nuMax 13.3333e-6;
nuMin 3.9047e-6;
\endverbatim
SourceFiles
Casson.C
\*---------------------------------------------------------------------------*/
#ifndef Casson_H
#define Casson_H
#include "generalizedNewtonianViscosityModel.H"
#include "dimensionedScalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarModels
{
namespace generalizedNewtonianViscosityModels
{
/*---------------------------------------------------------------------------*\
Class Casson Declaration
\*---------------------------------------------------------------------------*/
class Casson
:
public generalizedNewtonianViscosityModel
{
// Private Data
dimensionedScalar m_;
dimensionedScalar tau0_;
dimensionedScalar nuMin_;
dimensionedScalar nuMax_;
public:
//- Runtime type information
TypeName("Casson");
// Constructors
//- Construct from dictionary (components)
explicit Casson(const dictionary& viscosityProperties);
//- Destructor
virtual ~Casson() = default;
// Member Functions
//- Read transportProperties dictionary
virtual bool read(const dictionary& viscosityProperties);
//- Return the laminar viscosity
virtual tmp<volScalarField> nu
(
const volScalarField& nu0,
const volScalarField& strainRate
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace generalizedNewtonianViscosityModels
} // End namespace laminarModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,124 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 "CrossPowerLaw.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarModels
{
namespace generalizedNewtonianViscosityModels
{
defineTypeNameAndDebug(CrossPowerLaw, 0);
addToRunTimeSelectionTable
(
generalizedNewtonianViscosityModel,
CrossPowerLaw,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::laminarModels::generalizedNewtonianViscosityModels::CrossPowerLaw::
CrossPowerLaw
(
const dictionary& viscosityProperties
)
:
generalizedNewtonianViscosityModel(viscosityProperties),
CrossPowerLawCoeffs_
(
viscosityProperties.optionalSubDict(typeName + "Coeffs")
),
nuInf_("nuInf", dimViscosity, CrossPowerLawCoeffs_),
m_("m", dimTime, CrossPowerLawCoeffs_),
n_("n", dimless, CrossPowerLawCoeffs_),
tauStar_("tauStar", dimViscosity/dimTime, CrossPowerLawCoeffs_)
{
read(viscosityProperties);
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::laminarModels::generalizedNewtonianViscosityModels::CrossPowerLaw::
read
(
const dictionary& viscosityProperties
)
{
generalizedNewtonianViscosityModel::read(viscosityProperties);
CrossPowerLawCoeffs_ =
viscosityProperties.optionalSubDict(typeName + "Coeffs");
CrossPowerLawCoeffs_.readEntry("nuInf", nuInf_);
CrossPowerLawCoeffs_.readEntry("m", m_);
CrossPowerLawCoeffs_.readEntry("n", n_);
return true;
}
Foam::tmp<Foam::volScalarField>
Foam::laminarModels::generalizedNewtonianViscosityModels::CrossPowerLaw::
nu
(
const volScalarField& nu0,
const volScalarField& strainRate
) const
{
return
(
nuInf_
+ (nu0 - nuInf_)
/
(
scalar(1)
+ pow
(
(tauStar_.value() > 0)
? nu0*strainRate/tauStar_
: m_*strainRate,
n_
)
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,138 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd
-------------------------------------------------------------------------------
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::laminarModels::generalizedNewtonianViscosityModels::CrossPowerLaw
Description
Cross-Power law generalized Newtonian viscosity model
The strain rate coefficient can be specified either as the constant \c m or
the critical stress level at the transition to shear thinning \c
tauStar if \c tauStar is provided:
Kinematic viscosity [m^2/s]
\f[
\nu = \nu_\infty + \frac{(\nu_0 - \nu_\infty)}{1 + (m\gamma)^n}
\f]
or
\f[
\nu = \nu_\infty
+ \frac{(\nu_0 - \nu_\infty)}
{1 + \left(\frac{\nu_0\gamma}{\tau^*}\right)^n}
\f]
Example specification:
\verbatim
viscosityModel CrossPowerLaw;
nuInf 10;
m 0.4;
n 3;
\endverbatim
SourceFiles
CrossPowerLaw.C
\*---------------------------------------------------------------------------*/
#ifndef CrossPowerLaw_H
#define CrossPowerLaw_H
#include "generalizedNewtonianViscosityModel.H"
#include "dimensionedScalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarModels
{
namespace generalizedNewtonianViscosityModels
{
/*---------------------------------------------------------------------------*\
Class CrossPowerLaw Declaration
\*---------------------------------------------------------------------------*/
class CrossPowerLaw
:
public generalizedNewtonianViscosityModel
{
// Private Data
dictionary CrossPowerLawCoeffs_;
dimensionedScalar nuInf_;
dimensionedScalar m_;
dimensionedScalar n_;
dimensionedScalar tauStar_;
public:
//- Runtime type information
TypeName("CrossPowerLaw");
// Constructors
//- Construct from dictionary (components)
explicit CrossPowerLaw(const dictionary& viscosityProperties);
//- Destructor
virtual ~CrossPowerLaw() = default;
// Member Functions
//- Read transportProperties dictionary
virtual bool read(const dictionary& viscosityProperties);
//- Return the laminar viscosity
virtual tmp<volScalarField> nu
(
const volScalarField& nu0,
const volScalarField& strainRate
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace generalizedNewtonianViscosityModels
} // End namespace laminarModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,123 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 "HerschelBulkley.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarModels
{
namespace generalizedNewtonianViscosityModels
{
defineTypeNameAndDebug(HerschelBulkley, 0);
addToRunTimeSelectionTable
(
generalizedNewtonianViscosityModel,
HerschelBulkley,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::laminarModels::generalizedNewtonianViscosityModels::HerschelBulkley::
HerschelBulkley
(
const dictionary& viscosityProperties
)
:
generalizedNewtonianViscosityModel(viscosityProperties),
HerschelBulkleyCoeffs_
(
viscosityProperties.optionalSubDict(typeName + "Coeffs")
),
k_("k", dimViscosity, HerschelBulkleyCoeffs_),
n_("n", dimless, HerschelBulkleyCoeffs_),
tau0_("tau0", dimViscosity/dimTime, HerschelBulkleyCoeffs_)
{
read(viscosityProperties);
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::laminarModels::generalizedNewtonianViscosityModels::
HerschelBulkley::read
(
const dictionary& viscosityProperties
)
{
generalizedNewtonianViscosityModel::read(viscosityProperties);
HerschelBulkleyCoeffs_ =
viscosityProperties.optionalSubDict(typeName + "Coeffs");
HerschelBulkleyCoeffs_.readEntry("k", k_);
HerschelBulkleyCoeffs_.readEntry("n", n_);
HerschelBulkleyCoeffs_.readEntry("tau0", tau0_);
return true;
}
Foam::tmp<Foam::volScalarField>
Foam::laminarModels::generalizedNewtonianViscosityModels::HerschelBulkley::
nu
(
const volScalarField& nu0,
const volScalarField& strainRate
) const
{
const dimensionedScalar tone("tone", dimTime, 1);
const dimensionedScalar rtone("rtone", dimless/dimTime, 1);
return
(
min
(
nu0,
(tau0_ + k_*rtone*pow(tone*strainRate, n_))
/max
(
strainRate,
dimensionedScalar("SMALL", dimless/dimTime, VSMALL)
)
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,110 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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::laminarModels::generalizedNewtonianViscosityModels::HerschelBulkley
Description
Herschel-Bulkley generalized Newtonian viscosity model
SourceFiles
HerschelBulkley.C
\*---------------------------------------------------------------------------*/
#ifndef HerschelBulkley_H
#define HerschelBulkley_H
#include "generalizedNewtonianViscosityModel.H"
#include "dimensionedScalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarModels
{
namespace generalizedNewtonianViscosityModels
{
/*---------------------------------------------------------------------------*\
Class HerschelBulkley Declaration
\*---------------------------------------------------------------------------*/
class HerschelBulkley
:
public generalizedNewtonianViscosityModel
{
// Private Data
dictionary HerschelBulkleyCoeffs_;
dimensionedScalar k_;
dimensionedScalar n_;
dimensionedScalar tau0_;
public:
//- Runtime type information
TypeName("HerschelBulkley");
// Constructors
//- Construct from dictionary (components)
explicit HerschelBulkley(const dictionary& viscosityProperties);
//- Destructor
virtual ~HerschelBulkley() = default;
// Member Functions
//- Read transportProperties dictionary
virtual bool read(const dictionary& viscosityProperties);
//- Return the laminar viscosity
virtual tmp<volScalarField> nu
(
const volScalarField& nu0,
const volScalarField& strainRate
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace generalizedNewtonianViscosityModels
} // End namespace laminarModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,67 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
-------------------------------------------------------------------------------
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 "generalizedNewtonianViscosityModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarModels
{
defineTypeNameAndDebug(generalizedNewtonianViscosityModel, 0);
defineRunTimeSelectionTable(generalizedNewtonianViscosityModel, dictionary);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::laminarModels::generalizedNewtonianViscosityModel::
generalizedNewtonianViscosityModel
(
const dictionary& viscosityProperties
)
:
viscosityProperties_(viscosityProperties)
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::laminarModels::generalizedNewtonianViscosityModel::read
(
const dictionary& viscosityProperties
)
{
viscosityProperties_ = viscosityProperties;
return true;
}
// ************************************************************************* //

View File

@ -0,0 +1,156 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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/>.
Namespace
Foam::laminarModels::generalizedNewtonianViscosityModels
Description
A namespace for various generalized Newtonian viscosity model
implementations.
Class
Foam::laminarModels::generalizedNewtonianViscosityModel
Description
An abstract base class for generalized Newtonian viscosity models.
SourceFiles
generalizedNewtonianViscosityModel.C
generalizedNewtonianViscosityModelNew.C
\*---------------------------------------------------------------------------*/
#ifndef generalizedNewtonianViscosityModel_H
#define generalizedNewtonianViscosityModel_H
#include "dictionary.H"
#include "volFieldsFwd.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarModels
{
/*---------------------------------------------------------------------------*\
Class generalizedNewtonianViscosityModel Declaration
\*---------------------------------------------------------------------------*/
class generalizedNewtonianViscosityModel
{
protected:
// Protected Data
dictionary viscosityProperties_;
public:
//- Runtime type information
TypeName("generalizedNewtonianViscosityModel");
// Declare run-time constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
generalizedNewtonianViscosityModel,
dictionary,
(
const dictionary& viscosityProperties
),
(viscosityProperties)
);
// Generated Methods
//- No copy construct
generalizedNewtonianViscosityModel
(
const generalizedNewtonianViscosityModel&
) = delete;
//- No copy assignment
void operator=(const generalizedNewtonianViscosityModel&) = delete;
// Selectors
//- Select a viscosity model
static autoPtr<generalizedNewtonianViscosityModel> New
(
const dictionary& dict
);
// Constructors
//- Construct from dictionary (components)
explicit generalizedNewtonianViscosityModel
(
const dictionary& viscosityProperties
);
//- Destructor
virtual ~generalizedNewtonianViscosityModel() = default;
// Member Functions
//- Return the phase transport properties dictionary
const dictionary& viscosityProperties() const
{
return viscosityProperties_;
}
//- Return the laminar viscosity
virtual tmp<volScalarField> nu
(
const volScalarField& nu0,
const volScalarField& strainRate
) const = 0;
//- Read transportProperties dictionary
virtual bool read(const dictionary& viscosityProperties) = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace laminarModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 "generalizedNewtonianViscosityModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::laminarModels::generalizedNewtonianViscosityModel>
Foam::laminarModels::generalizedNewtonianViscosityModel::New
(
const dictionary& dict
)
{
const word modelType(dict.get<word>("viscosityModel"));
Info<< "Selecting generalized Newtonian model " << modelType << endl;
auto cstrIter = dictionaryConstructorTablePtr_->find(modelType);
if (!cstrIter.found())
{
FatalIOErrorInLookup
(
dict,
"generalizedNewtonianViscosityModel",
modelType,
*dictionaryConstructorTablePtr_
) << exit(FatalIOError);
}
return autoPtr<generalizedNewtonianViscosityModel>(cstrIter()(dict));
}
// ************************************************************************* //

View File

@ -0,0 +1,120 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 "powerLaw.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarModels
{
namespace generalizedNewtonianViscosityModels
{
defineTypeNameAndDebug(powerLaw, 0);
addToRunTimeSelectionTable
(
generalizedNewtonianViscosityModel,
powerLaw,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::laminarModels::generalizedNewtonianViscosityModels::powerLaw::powerLaw
(
const dictionary& viscosityProperties
)
:
generalizedNewtonianViscosityModel(viscosityProperties),
powerLawCoeffs_(viscosityProperties.optionalSubDict(typeName + "Coeffs")),
k_("k", dimViscosity, powerLawCoeffs_),
n_("n", dimless, powerLawCoeffs_),
nuMin_("nuMin", dimViscosity, powerLawCoeffs_),
nuMax_("nuMax", dimViscosity, powerLawCoeffs_)
{
read(viscosityProperties);
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::laminarModels::generalizedNewtonianViscosityModels::powerLaw::read
(
const dictionary& viscosityProperties
)
{
generalizedNewtonianViscosityModel::read(viscosityProperties);
powerLawCoeffs_ = viscosityProperties.optionalSubDict(typeName + "Coeffs");
powerLawCoeffs_.readEntry("k", k_);
powerLawCoeffs_.readEntry("n", n_);
powerLawCoeffs_.readEntry("nuMin", nuMin_);
powerLawCoeffs_.readEntry("nuMax", nuMax_);
return true;
}
Foam::tmp<Foam::volScalarField>
Foam::laminarModels::generalizedNewtonianViscosityModels::powerLaw::
nu
(
const volScalarField& nu0,
const volScalarField& strainRate
) const
{
return max
(
nuMin_,
min
(
nuMax_,
k_*pow
(
max
(
dimensionedScalar("one", dimTime, 1)*strainRate,
dimensionedScalar("small", dimless, SMALL)
),
n_.value() - scalar(1)
)
)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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::laminarModels::generalizedNewtonianViscosityModels::powerLaw
Description
Standard power-law generalized Newtonian viscosity model
SourceFiles
powerLaw.C
\*---------------------------------------------------------------------------*/
#ifndef powerLaw_H
#define powerLaw_H
#include "generalizedNewtonianViscosityModel.H"
#include "dimensionedScalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarModels
{
namespace generalizedNewtonianViscosityModels
{
/*---------------------------------------------------------------------------*\
Class powerLaw Declaration
\*---------------------------------------------------------------------------*/
class powerLaw
:
public generalizedNewtonianViscosityModel
{
// Private Data
dictionary powerLawCoeffs_;
dimensionedScalar k_;
dimensionedScalar n_;
dimensionedScalar nuMin_;
dimensionedScalar nuMax_;
public:
//- Runtime type information
TypeName("powerLaw");
// Constructors
//- Construct from components
explicit powerLaw(const dictionary& viscosityProperties);
//- Destructor
virtual ~powerLaw() = default;
// Member Functions
//- Read transportProperties dictionary
virtual bool read(const dictionary& viscosityProperties);
//- Return the laminar viscosity
virtual tmp<volScalarField> nu
(
const volScalarField& nu0,
const volScalarField& strainRate
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace generalizedNewtonianViscosityModels
} // End namespace laminarModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,128 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 "strainRateFunction.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarModels
{
namespace generalizedNewtonianViscosityModels
{
defineTypeNameAndDebug(strainRateFunction, 0);
addToRunTimeSelectionTable
(
generalizedNewtonianViscosityModel,
strainRateFunction,
dictionary
);
}
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::laminarModels::generalizedNewtonianViscosityModels::strainRateFunction::
strainRateFunction
(
const dictionary& viscosityProperties
)
:
generalizedNewtonianViscosityModel(viscosityProperties),
strainRateFunctionCoeffs_
(
viscosityProperties.optionalSubDict(typeName + "Coeffs")
),
strainRateFunction_
(
Function1<scalar>::New("function", strainRateFunctionCoeffs_)
)
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::laminarModels::generalizedNewtonianViscosityModels::
strainRateFunction::read
(
const dictionary& viscosityProperties
)
{
generalizedNewtonianViscosityModel::read(viscosityProperties);
strainRateFunctionCoeffs_ =
viscosityProperties.optionalSubDict(typeName + "Coeffs");
strainRateFunction_.reset();
strainRateFunction_ = Function1<scalar>::New
(
"function",
strainRateFunctionCoeffs_
);
return true;
}
Foam::tmp<Foam::volScalarField>
Foam::laminarModels::generalizedNewtonianViscosityModels::strainRateFunction::
nu
(
const volScalarField& nu0,
const volScalarField& strainRate
) const
{
auto tnu =
volScalarField::New
(
IOobject::groupName(type() + ":nu", nu0.group()),
nu0.mesh(),
dimensionedScalar(dimViscosity, Zero)
);
tnu.ref().primitiveFieldRef() = strainRateFunction_->value(strainRate);
volScalarField::Boundary& nuBf = tnu.ref().boundaryFieldRef();
const volScalarField::Boundary& sigmaBf = strainRate.boundaryField();
forAll(nuBf, patchi)
{
nuBf[patchi] = strainRateFunction_->value(sigmaBf[patchi]);
}
return tnu;
}
// ************************************************************************* //

View File

@ -0,0 +1,121 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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::laminarModels::generalizedNewtonianViscosityModels::strainRateFunction
Description
Run-time selected strain-rate function generalized Newtonian viscosity model
Example linear function of strain-rate:
\verbatim
generalizedNewtonianModel strainRateFunction;
function polynomial ((0 0.1) (1 1.3));
\endverbatim
See also
Foam::generalizedNewtonianViscosityModel
Foam::Function1
SourceFiles
strainRateFunction.C
\*---------------------------------------------------------------------------*/
#ifndef strainRateFunction_H
#define strainRateFunction_H
#include "generalizedNewtonianViscosityModel.H"
#include "Function1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarModels
{
namespace generalizedNewtonianViscosityModels
{
/*---------------------------------------------------------------------------*\
Class strainRateFunction Declaration
\*---------------------------------------------------------------------------*/
class strainRateFunction
:
public generalizedNewtonianViscosityModel
{
// Private Data
//- Coefficients dictionary
dictionary strainRateFunctionCoeffs_;
//- Strain-rate function
autoPtr<Function1<scalar>> strainRateFunction_;
public:
//- Runtime type information
TypeName("strainRateFunction");
// Constructors
//- Construct from dictionary (components)
explicit strainRateFunction(const dictionary& viscosityProperties);
//- Destructor
virtual ~strainRateFunction() = default;
// Member Functions
//- Read transportProperties dictionary
virtual bool read(const dictionary& viscosityProperties);
//- Return the laminar viscosity
virtual tmp<volScalarField> nu
(
const volScalarField& nu0,
const volScalarField& strainRate
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace generalizedNewtonianViscosityModels
} // End namespace laminarModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -37,6 +38,7 @@ License
#include "perfectFluid.H"
#include "PengRobinsonGas.H"
#include "adiabaticPerfectFluid.H"
#include "icoTabulated.H"
#include "hConstThermo.H"
#include "eConstThermo.H"
@ -61,7 +63,7 @@ License
namespace Foam
{
/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
/* * * * * * * * * * * * * * * Private Static Data * * * * * * * * * * * * * */
makeThermos
(
@ -135,6 +137,18 @@ makeThermos
specie
);
makeThermos
(
rhoThermo,
heRhoThermo,
pureMixture,
constTransport,
sensibleEnthalpy,
hConstThermo,
icoTabulated,
specie
);
makeThermos
(
rhoThermo,
@ -195,6 +209,18 @@ makeThermos
specie
);
makeThermos
(
rhoThermo,
heRhoThermo,
pureMixture,
sutherlandTransport,
sensibleEnthalpy,
hConstThermo,
icoTabulated,
specie
);
makeThermos
(
rhoThermo,
@ -207,6 +233,18 @@ makeThermos
specie
);
makeThermos
(
rhoThermo,
heRhoThermo,
pureMixture,
sutherlandTransport,
sensibleEnthalpy,
janafThermo,
icoTabulated,
specie
);
makeThermos
(
rhoThermo,
@ -267,6 +305,18 @@ makeThermos
specie
);
makeThermos
(
rhoThermo,
heRhoThermo,
pureMixture,
polynomialTransport,
sensibleEnthalpy,
hPolynomialThermo,
icoTabulated,
specie
);
makeThermos
(
rhoThermo,
@ -293,6 +343,18 @@ makeThermos
specie
);
makeThermos
(
rhoThermo,
heRhoThermo,
pureMixture,
constTransport,
sensibleInternalEnergy,
hConstThermo,
icoTabulated,
specie
);
makeThermos
(
rhoThermo,
@ -305,6 +367,18 @@ makeThermos
specie
);
makeThermos
(
rhoThermo,
heRhoThermo,
pureMixture,
sutherlandTransport,
sensibleInternalEnergy,
hConstThermo,
icoTabulated,
specie
);
makeThermos
(
rhoThermo,
@ -317,6 +391,18 @@ makeThermos
specie
);
makeThermos
(
rhoThermo,
heRhoThermo,
pureMixture,
sutherlandTransport,
sensibleInternalEnergy,
janafThermo,
icoTabulated,
specie
);
makeThermos
(
rhoThermo,
@ -427,6 +513,18 @@ makeThermos
specie
);
makeThermos
(
rhoThermo,
heRhoThermo,
pureMixture,
polynomialTransport,
sensibleInternalEnergy,
hPolynomialThermo,
icoTabulated,
specie
);
makeThermos
(
rhoThermo,

View File

@ -28,12 +28,6 @@ License
#include "absorptionCoeffs.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * //
Foam::radiation::absorptionCoeffs::~absorptionCoeffs()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::radiation::absorptionCoeffs::checkT(const scalar T) const

View File

@ -66,14 +66,8 @@ private:
// Private data
// Temperature limits of applicability for functions
scalar Tcommon_;
scalar Tlow_;
scalar Thigh_;
// Temperature limits of applicability of functions
scalar Tlow_, Thigh_, Tcommon_;
// Polynomial using inverse temperatures
bool invTemp_;
@ -92,13 +86,12 @@ public:
// Constructors
// Null constructor
absorptionCoeffs()
{}
//- Default construct
absorptionCoeffs() = default;
//- Destructor
~absorptionCoeffs();
~absorptionCoeffs() = default;
// Member functions

View File

@ -27,39 +27,39 @@ License
inline bool Foam::radiation::absorptionCoeffs::invTemp() const
{
return invTemp_;
return invTemp_;
}
inline Foam::scalar Foam::radiation::absorptionCoeffs::Tcommon() const
{
return Tcommon_;
return Tcommon_;
}
inline Foam::scalar Foam::radiation::absorptionCoeffs::Tlow() const
{
return Tlow_;
return Tlow_;
}
inline Foam::scalar Foam::radiation::absorptionCoeffs::Thigh() const
{
return Thigh_;
return Thigh_;
}
inline const Foam::radiation::absorptionCoeffs::coeffArray&
Foam::radiation::absorptionCoeffs::highACoeffs() const
{
return highACoeffs_;
return highACoeffs_;
}
inline const Foam::radiation::absorptionCoeffs::coeffArray&
Foam::radiation::absorptionCoeffs::lowACoeffs() const
{
return lowACoeffs_;
return lowACoeffs_;
}

View File

@ -0,0 +1,66 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 "icoTabulated.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Specie>
Foam::icoTabulated<Specie>::icoTabulated(const dictionary& dict)
:
Specie(dict),
rho_("rho", dict.subDict("equationOfState"))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Specie>
void Foam::icoTabulated<Specie>::write(Ostream& os) const
{
Specie::write(os);
// Entries in dictionary format
os.beginBlock("equationOfState");
os.writeEntry("rho", rho_);
os.endBlock();
}
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
template<class Specie>
Foam::Ostream& Foam::operator<<(Ostream& os, const icoTabulated<Specie>& ip)
{
ip.write(os);
return os;
}
// ************************************************************************* //

View File

@ -0,0 +1,197 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenFOAM Foundation
-------------------------------------------------------------------------------
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::icoTabulated
Description
Incompressible of equation of state using non-uniform tabulated
density vs temperature.
Usage
\table
Property | Description
rho | Density vs temperature table
\endtable
Example of the specification of the equation of state:
\verbatim
equationOfState
{
rho
(
(200 1010)
(350 1000)
(400 980)
);
}
\endverbatim
SourceFiles
icoTabulatedI.H
icoTabulated.C
See also
Foam::thermophysicalFunctions::nonUniformTable
\*---------------------------------------------------------------------------*/
#ifndef icoTabulated_H
#define icoTabulated_H
#include "nonUniformTableThermophysicalFunction.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward Declarations
template<class Specie> class icoTabulated;
template<class Specie>
Ostream& operator<<(Ostream& os, const icoTabulated<Specie>&);
/*---------------------------------------------------------------------------*\
Class icoTabulated Declaration
\*---------------------------------------------------------------------------*/
template<class Specie>
class icoTabulated
:
public Specie
{
// Private Data
//- Density table [kg/m^3]
nonUniformTable rho_;
public:
// Constructors
//- Construct from components
inline icoTabulated
(
const Specie& sp,
const nonUniformTable& rho
);
//- Construct from dictionary
explicit icoTabulated(const dictionary& dict);
//- Construct as named copy
inline icoTabulated(const word& name, const icoTabulated&);
//- Construct and return a clone
inline autoPtr<icoTabulated> clone() const;
//- Selector from dictionary
inline static autoPtr<icoTabulated> New(const dictionary& dict);
// Member Functions
//- The instantiated type name
static word typeName()
{
return "icoTabulated<" + word(Specie::typeName_()) + '>';
}
// Fundamental Properties
//- Is the equation of state is incompressible i.e. rho != f(p)
static const bool incompressible = true;
//- Is the equation of state is isochoric i.e. rho = const
static const bool isochoric = false;
//- Return density [kg/m^3]
inline scalar rho(scalar p, scalar T) const;
//- Return enthalpy contribution [J/kg]
inline scalar H(const scalar p, const scalar T) const;
//- Return Cp contribution [J/(kg K]
inline scalar Cp(scalar p, scalar T) const;
//- Return internal energy contribution [J/kg]
inline scalar E(const scalar p, const scalar T) const;
//- Return Cv contribution [J/(kg K]
inline scalar Cv(scalar p, scalar T) const;
//- Return entropy contribution to the integral of Cp/T [J/kg/K]
inline scalar S(const scalar p, const scalar T) const;
//- Return compressibility [s^2/m^2]
inline scalar psi(scalar p, scalar T) const;
//- Return compression factor []
inline scalar Z(scalar p, scalar T) const;
//- Return (Cp - Cv) [J/(kg K]
inline scalar CpMCv(scalar p, scalar T) const;
// IO
//- Write to Ostream
void write(Ostream& os) const;
// Ostream Operator
friend Ostream& operator<< <Specie>
(
Ostream&,
const icoTabulated&
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "icoTabulatedI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "icoTabulated.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,176 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 "icoTabulated.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Specie>
inline Foam::icoTabulated<Specie>::icoTabulated
(
const Specie& sp,
const nonUniformTable& rho
)
:
Specie(sp),
rho_(rho)
{}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Specie>
inline Foam::icoTabulated<Specie>::icoTabulated
(
const word& name,
const icoTabulated<Specie>& ip
)
:
Specie(name, ip),
rho_(ip.rho_)
{}
template<class Specie>
inline Foam::autoPtr<Foam::icoTabulated<Specie>>
Foam::icoTabulated<Specie>::clone() const
{
return autoPtr<icoTabulated<Specie>>::New(*this);
}
template<class Specie>
inline Foam::autoPtr<Foam::icoTabulated<Specie>>
Foam::icoTabulated<Specie>::New(const dictionary& dict)
{
return autoPtr<icoTabulated<Specie>>::New(dict);
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::rho
(
scalar p,
scalar T
) const
{
return rho_.f(p, T);
}
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::H
(
scalar p,
scalar T
) const
{
return p/this->rho(p, T);
}
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::Cp
(
scalar p,
scalar T
) const
{
return 0;
}
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::E
(
scalar p,
scalar T
) const
{
return 0;
}
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::Cv
(
scalar p,
scalar T
) const
{
return 0;
}
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::S
(
scalar p,
scalar T
) const
{
return 0;
}
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::psi
(
scalar p,
scalar T
) const
{
return 0;
}
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::Z
(
scalar p,
scalar T
) const
{
return 0;
}
template<class Specie>
inline Foam::scalar Foam::icoTabulated<Specie>::CpMCv
(
scalar p,
scalar T
) const
{
return 0;
}
// ************************************************************************* //

View File

@ -138,7 +138,7 @@ public:
return "eConst<" + EquationOfState::typeName() + '>';
}
//- Limit the temperature to be in the range Tlow_ to Thigh_
//- Limit temperature to be within the range
inline scalar limit(const scalar T) const;

View File

@ -140,7 +140,7 @@ public:
return "eRefConst<" + EquationOfState::typeName() + '>';
}
//- Limit the temperature to be in the range Tlow_ to Thigh_
//- Limit temperature to be within the range
inline scalar limit(const scalar T) const;

View File

@ -131,7 +131,7 @@ public:
return "hConst<" + EquationOfState::typeName() + '>';
}
//- Limit the temperature to be in the range Tlow_ to Thigh_
//- Limit temperature to be within the range
inline scalar limit(const scalar T) const;

View File

@ -191,7 +191,7 @@ public:
return "hPolynomial<" + EquationOfState::typeName() + '>';
}
//- Limit the temperature to be in the range Tlow_ to Thigh_
//- Limit temperature to be within the range
inline scalar limit(const scalar) const;

View File

@ -152,7 +152,7 @@ public:
return "hPower<" + EquationOfState::typeName() + '>';
}
//- Limit the temperature to be in the range Tlow_ to Thigh_
//- Limit temperature to be within the range
inline scalar limit(const scalar T) const;

View File

@ -89,7 +89,7 @@ class hRefConstThermo
:
public EquationOfState
{
// Private data
// Private Data
scalar Cp_;
scalar Hf_;
@ -135,7 +135,7 @@ public:
return "hRefConst<" + EquationOfState::typeName() + '>';
}
//- Limit the temperature to be in the range Tlow_ to Thigh_
//- Limit temperature to be within the range
inline scalar limit(const scalar T) const;

View File

@ -50,7 +50,7 @@ SourceFiles
namespace Foam
{
// Forward declaration of friend functions and operators
// Forward Declarations
template<class EquationOfState> class janafThermo;
@ -92,18 +92,17 @@ class janafThermo
:
public EquationOfState
{
public:
// Public data
// Public Data
static const int nCoeffs_ = 7;
static constexpr int nCoeffs_ = 7;
typedef FixedList<scalar, nCoeffs_> coeffArray;
private:
// Private data
// Private Data
// Temperature limits of applicability of functions
scalar Tlow_, Thigh_, Tcommon_;

View File

@ -14,6 +14,8 @@ $(NSRDSfunctions)/NSRDSfunc14/NSRDSfunc14.C
APIfunctions = thermophysicalFunctions/APIfunctions
$(APIfunctions)/APIdiffCoefFunc/APIdiffCoefFunc.C
thermophysicalFunctions/nonUniformTable/nonUniformTableThermophysicalFunction.C
thermophysicalProperties/thermophysicalProperties.C

View File

@ -198,7 +198,7 @@ public:
//- Solubility parameter [(J/m^3)^(1/2)]
inline scalar delta() const;
//- Limit the temperature to be in the range Tlow_ to Thigh_
//- Limit temperature to be within the range
inline scalar limit(const scalar T) const;

View File

@ -0,0 +1,159 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 "nonUniformTableThermophysicalFunction.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(nonUniformTable, 0);
addToRunTimeSelectionTable
(
thermophysicalFunction,
nonUniformTable,
dictionary
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::nonUniformTable::nonUniformTable
(
const word& name,
const dictionary& dict
)
:
name_(name),
values_(),
Trange_(),
deltaT_(GREAT),
jumpTable_()
{
dict.readEntry(name_, values_);
if (values_.size() < 2)
{
FatalIOErrorInFunction(dict)
<< "Table" << nl
<< " " << name_ << nl
<< " has fewer than 2 entries." << nl
<< exit(FatalIOError);
}
Trange_.min() = values_.first().first();
Trange_.max() = values_.last().first();
for (label i = 1; i < values_.size(); ++i)
{
#ifdef FULLDEBUG
// Check list is monotonically increasing...
if (values_[i].first() <= values_[i-1].first())
{
FatalErrorInFunction
<< "Table" << nl
<< " " << name_ << nl
<< " out-of-order value: " << values_[i].first()
<< " at index " << i << nl
<< exit(FatalError);
}
#endif
deltaT_ = min(deltaT_, values_[i].first() - values_[i-1].first());
}
deltaT_ *= 0.9;
jumpTable_.resize(Trange_.mag()/deltaT_ + 1);
label i = 0;
forAll(jumpTable_, j)
{
const scalar T = Trange_.min() + j*deltaT_;
if (T > values_[i+1].first())
{
++i;
}
jumpTable_[j] = i;
}
}
Foam::nonUniformTable::nonUniformTable
(
const dictionary& dict
)
:
nonUniformTable("values", dict)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::nonUniformTable::f
(
scalar p,
scalar T
) const
{
const label i = index(p, T);
const scalar Ti = values_[i].first();
const scalar lambda = (T - Ti)/(values_[i + 1].first() - Ti);
return
values_[i].second()
+ lambda*(values_[i + 1].second() - values_[i].second());
}
Foam::scalar Foam::nonUniformTable::dfdT
(
scalar p,
scalar T
) const
{
const label i = index(p, T);
return
(values_[i + 1].second() - values_[i].second())
/(values_[i + 1].first() - values_[i].first());
}
void Foam::nonUniformTable::writeData(Ostream& os) const
{
os.writeEntry("values", values_);
}
// ************************************************************************* //

View File

@ -0,0 +1,153 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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::thermophysicalFunctions::nonUniformTable
Description
Non-uniform tabulated property function that linearly interpolates between
the values.
To speed-up the search of the non-uniform table a uniform jump-table is
created on construction which is used for fast indirect addressing into
the table.
Usage
\nonUniformTable
Property | Description
values | List of (temperature property) value pairs
\endnonUniformTable
Example for the density of water between 280 and 350K
\verbatim
rho
{
type nonUniformTable;
values
(
(280 999.87)
(300 995.1)
(350 973.7)
);
}
\endverbatim
\*---------------------------------------------------------------------------*/
#ifndef nonUniformTableThermophysicalFunction_H
#define nonUniformTableThermophysicalFunction_H
#include "thermophysicalFunction.H"
#include "MinMax.H"
#include "Tuple2.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class nonUniformTable Declaration
\*---------------------------------------------------------------------------*/
class nonUniformTable
:
public thermophysicalFunction
{
// Private Data
//- Name of dictionary from which this function is instantiated
word name_;
//- Table values
List<Tuple2<scalar, scalar>> values_;
//- Lowest/highest temperature in the table
MinMax<scalar> Trange_;
//- Temperature increment, based on Trange_ and values_.size()
scalar deltaT_;
//- Lookup indices into values_ table based on deltaT_
List<label> jumpTable_;
protected:
//- Return the lower index of the interval in the table
//- corresponding to the given temperature.
// Checks the temperature range
inline label index(scalar p, scalar T) const;
public:
//- Runtime type information
TypeName("nonUniformTable");
// Constructors
//- Construct from entry name and dictionary
nonUniformTable(const word& name, const dictionary& dict);
//- Construct from dictionary, using "values" for the lookup
explicit nonUniformTable(const dictionary& dict);
// Member Functions
//- Return the non-uniform table of values
const List<Tuple2<scalar, scalar>>& values() const
{
return values_;
}
//- Evaluate the function and return the result
scalar f(scalar p, scalar T) const;
//- Evaluate the derivative of the function and return the result
scalar dfdT(scalar p, scalar T) const;
//- Write the function coefficients
void writeData(Ostream& os) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "nonUniformTableThermophysicalFunctionI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,61 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
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 "nonUniformTableThermophysicalFunction.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline Foam::label Foam::nonUniformTable::index
(
scalar p,
scalar T
) const
{
if (T < Trange_.min() || T > Trange_.max())
{
FatalErrorInFunction
<< "Temperature " << T << " out of range " << Trange_ << nl
<< " for nonUniformTable " << name_
<< exit(FatalError);
}
const scalar nd = (T - Trange_.min())/deltaT_;
const label j = nd;
label i = jumpTable_[j];
if (i < values_.size() - 1 && T > values_[i + 1].first())
{
++i;
}
return i;
}
// ************************************************************************* //

View File

@ -117,7 +117,7 @@ public:
//- Molecular weight [kg/kmol]
inline scalar W() const;
//- Limit the temperature to be in the range Tlow_ to Thigh_
//- Limit temperature to be within the range
inline scalar limit(const scalar T) const;

View File

@ -100,7 +100,7 @@ public:
//- Molecular weight [kg/kmol]
inline scalar W() const;
//- Limit the temperature to be in the range Tlow_ to Thigh_
//- Limit temperature to be within the range
inline scalar limit(const scalar T) const;

View File

@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
inlet
{
type fixedValue;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue $internalField;
}
"(?i).*walls"
{
type fixedValue;
value uniform 350;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inlet
{
type flowRateInletVelocity;
massFlowRate constant 5;
rhoInlet 1000; // Guess for rho
}
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
"(?i).*walls"
{
type noSlip;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,45 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
"(?i).*walls"
{
type compressible::alphatWallFunction;
Prt 0.85;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 200;
boundaryField
{
inlet
{
type turbulentMixingLengthDissipationRateInlet;
mixingLength 0.005;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
"(?i).*walls"
{
type epsilonWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,46 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 1;
boundaryField
{
inlet
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.05;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
"(?i).*walls"
{
type kqRWallFunction;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
"(?i).*walls"
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,41 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 1e5;
boundaryField
{
inlet
{
type zeroGradient;
}
outlet
{
type fixedValue;
value $internalField;
}
"(?i).*walls"
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,31 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type heRhoThermo;
mixture pureMixture;
properties liquid;
energy sensibleInternalEnergy;
}
mixture
{
H2O;
}
// ************************************************************************* //

View File

@ -0,0 +1,32 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType laminar;
laminar
{
model generalizedNewtonian;
viscosityModel powerLaw;
nuMin 1e-03;
nuMax 1;
k 0.02;
n 0.4;
}
// ************************************************************************* //

View File

@ -0,0 +1,17 @@
// OpenFOAM dictionary -*- C++ -*-
abort
{
type abort;
libs (utilityFunctionObjects);
file "<case>/ABORT"; // Instead of default name
// action writeNow; // If we want to see immediate results
// Or use default (nextWrite) and force with
// "action=writeNow" in the trigger file
}
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
scale 0.001;
zmin -25;
zmax 25;
vertices
(
// front-plane:
// inlet region
( -50 25 $zmax) // pt 0
( 0 25 $zmax) // pt 1
( -50 75 $zmax) // pt 2
( 0 75 $zmax) // pt 3
// outlet region
( -500 -75 $zmax) // pt 4
( 0 -75 $zmax) // pt 5
( -500 -25 $zmax) // pt 6
( 0 -25 $zmax) // pt 7
// bend mid-points
( 25 0 $zmax) // pt 8
( 75 0 $zmax) // pt 9
// back-plane:
// inlet region
( -50 25 $zmin) // pt 0 + 10
( 0 25 $zmin) // pt 1 + 10
( -50 75 $zmin) // pt 2 + 10
( 0 75 $zmin) // pt 3 + 10
// outlet region
( -500 -75 $zmin) // pt 4 + 10
( 0 -75 $zmin) // pt 5 + 10
( -500 -25 $zmin) // pt 7 + 10
( 0 -25 $zmin) // pt 8 + 10
// bend mid-points
( 25 0 $zmin) // pt 8 + 10
( 75 0 $zmin) // pt 9 + 10
);
blocks
(
hex (0 1 11 10 2 3 13 12) inlet ( 20 20 20) simpleGrading (1 1 1)
hex (4 5 15 14 6 7 17 16) outlet (200 20 20) simpleGrading (1 1 1)
hex (1 8 18 11 3 9 19 13) bend1 ( 30 20 20) simpleGrading (1 1 1)
hex (5 9 19 15 7 8 18 17) bend2 ( 30 20 20) simpleGrading (1 1 1)
);
edges
(
// block 2
arc 1 8 origin (0 0 $zmax)
arc 3 9 origin (0 0 $zmax)
arc 11 18 origin (0 0 $zmin)
arc 13 19 origin (0 0 $zmin)
// block 3
arc 7 8 origin (0 0 $zmax)
arc 5 9 origin (0 0 $zmax)
arc 17 18 origin (0 0 $zmin)
arc 15 19 origin (0 0 $zmin)
);
boundary
(
inlet
{
type patch;
faces
(
(0 2 12 10)
);
}
outlet
{
type patch;
faces
(
(4 6 16 14)
);
}
);
mergePatchPairs
(
);
// The defaultFaces == outside "walls"
defaultPatch
{
name walls;
type wall;
}
// ************************************************************************* //

View File

@ -0,0 +1,55 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application rhoSimpleFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 500;
deltaT 1;
writeControl timeStep;
writeInterval 100;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
graphFormat raw;
runTimeModifiable true;
functions
{
#include "abort"
}
// ************************************************************************* //

View File

@ -0,0 +1,31 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 8;
method hierarchical;
simpleCoeffs
{
n (8 1 1);
}
hierarchicalCoeffs
{
n (4 2 1);
}
// ************************************************************************* //

View File

@ -0,0 +1,59 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
limited cellLimited Gauss linear 1;
}
divSchemes
{
default none;
div(phi,U) bounded Gauss linearUpwind limited;
div(phi,e) bounded Gauss linearUpwind limited;
div(phi,epsilon) bounded Gauss linearUpwind limited;
div(phi,k) bounded Gauss linearUpwind limited;
div(phi,Ekp) bounded Gauss linearUpwind limited;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
// ************************************************************************* //

View File

@ -0,0 +1,71 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
p
{
solver GAMG;
smoother GaussSeidel;
tolerance 1e-7;
relTol 0.1;
}
"(U|e|k|epsilon)"
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-7;
relTol 0.1;
}
}
SIMPLE
{
nNonOrthogonalCorrectors 0;
pMinFactor 0.1;
pMaxFactor 1.5;
transonic no;
consistent no;
residualControl
{
p 1e-4;
U 1e-4;
"(k|omega|epsilon|e|h)" 1e-3;
}
}
relaxationFactors
{
fields
{
p 0.3;
}
equations
{
U 0.7;
e 0.7;
k 0.7;
epsilon 0.7;
}
}
// ************************************************************************* //

View File

@ -18,15 +18,11 @@ simulationType laminar;
laminar
{
laminarModel Maxwell;
model Maxwell;
printCoeffs on;
MaxwellCoeffs
{
nuM 0.002;
lambda 0.03;
}
printCoeffs on;
nuM 0.002;
lambda 0.03;
}
// ************************************************************************* //

View File

@ -18,15 +18,14 @@ simulationType laminar;
laminar
{
laminarModel LAMINAR_MODEL;
model LAMINAR_MODEL;
printCoeffs on;
MaxwellCoeffs
{
nuM 1;
lambda 5;
nuM 1;
lambda 5;
}
printCoeffs on;
}
// ************************************************************************* //

View File

@ -19,10 +19,10 @@ simulationType laminar;
laminar
{
laminarModel Maxwell;
model Maxwell;
nuM 0.01476;
lambda 0.018225;
nuM 0.01476;
lambda 0.018225;
}

View File

@ -19,10 +19,10 @@ simulationType laminar;
laminar
{
laminarModel Maxwell;
model Maxwell;
nuM 0.01476;
lambda 0.018225;
nuM 0.01476;
lambda 0.018225;
}