Skip to content
Permalink
Browse files

TurbulenceModels::generalizedNewtonian: New structure to support gene…

…ralized Newtonian laminar transport

Within this structure the BirdCarreau, Casson, CrossPowerLaw, HerschelBulkley,
powerLaw and strainRateFunction strain-dependent viscosity based non-Newtonian
fluid models may be selected for incompressible or compressible flow.

In the case of compressible flow the strain-dependent viscosity functions are
applied to the temperature dependent viscosity so that if the WLF viscosity
model is chosen in conjunction with the CrossPowerLaw the effective model is
Cross-WLF which is commonly used for polymer flow.

These models are selected in the constant/turbulenceProperties file, e.g.

simulationType  laminar;

laminar
{
    laminarModel generalizedNewtonian;

    viscosityModel CrossPowerLaw;

    nuInf      10;
    m          0.4;
    n          3;
}

This new implementation is more general and flexible than the previous
incompressible only non-Newtonian viscosity models, which were selected in the
constant/transportProperties file.  This implementation is now deprecated and
will be phased-out.
  • Loading branch information...
Henry Weller
Henry Weller committed Oct 4, 2018
1 parent 7977181 commit 94d0b9ffe5ba525fb8b45b6dea1101984e4217dd
Showing with 2,208 additions and 0 deletions.
  1. +3 −0 src/TurbulenceModels/compressible/turbulentFluidThermoModels/turbulentFluidThermoModels.C
  2. +3 −0 src/TurbulenceModels/incompressible/turbulentTransportModels/turbulentTransportModels.C
  3. +9 −0 src/TurbulenceModels/turbulenceModels/Make/files
  4. +264 −0 src/TurbulenceModels/turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonian.C
  5. +172 −0 src/TurbulenceModels/turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonian.H
  6. +131 −0 ...Models/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/BirdCarreau/BirdCarreau.C
  7. +140 −0 ...Models/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/BirdCarreau/BirdCarreau.H
  8. +119 −0 ...turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/Casson/Casson.C
  9. +131 −0 ...turbulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/Casson/Casson.H
  10. +123 −0 ...ls/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/CrossPowerLaw/CrossPowerLaw.C
  11. +134 −0 ...ls/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/CrossPowerLaw/CrossPowerLaw.H
  12. +116 −0 ...aminar/generalizedNewtonian/generalizedNewtonianViscosityModels/HerschelBulkley/HerschelBulkley.C
  13. +106 −0 ...aminar/generalizedNewtonian/generalizedNewtonianViscosityModels/HerschelBulkley/HerschelBulkley.H
  14. +65 −0 ...dNewtonianViscosityModels/generalizedNewtonianViscosityModel/generalizedNewtonianViscosityModel.C
  15. +155 −0 ...dNewtonianViscosityModels/generalizedNewtonianViscosityModel/generalizedNewtonianViscosityModel.H
  16. +63 −0 ...wtonianViscosityModels/generalizedNewtonianViscosityModel/generalizedNewtonianViscosityModelNew.C
  17. +117 −0 ...ulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/powerLaw/powerLaw.C
  18. +107 −0 ...ulenceModels/laminar/generalizedNewtonian/generalizedNewtonianViscosityModels/powerLaw/powerLaw.H
  19. +134 −0 .../generalizedNewtonian/generalizedNewtonianViscosityModels/strainRateFunction/strainRateFunction.C
  20. +116 −0 .../generalizedNewtonian/generalizedNewtonianViscosityModels/strainRateFunction/strainRateFunction.H
@@ -45,6 +45,9 @@ makeBaseTurbulenceModel
#include "Stokes.H"
makeLaminarModel(Stokes);

#include "generalizedNewtonian.H"
makeLaminarModel(generalizedNewtonian);

#include "Maxwell.H"
makeLaminarModel(Maxwell);

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

#include "generalizedNewtonian.H"
makeLaminarModel(generalizedNewtonian);

#include "Maxwell.H"
makeLaminarModel(Maxwell);

@@ -63,5 +63,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
@@ -0,0 +1,264 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/

#include "generalizedNewtonian.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "fvcGrad.H"
#include "fvcDiv.H"
#include "fvmLaplacian.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{
namespace laminarModels
{

// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

template<class BasicTurbulenceModel>
generalizedNewtonian<BasicTurbulenceModel>::generalizedNewtonian
(
const alphaField& alpha,
const rhoField& rho,
const volVectorField& U,
const surfaceScalarField& alphaRhoPhi,
const surfaceScalarField& phi,
const transportModel& transport,
const word& propertiesName
)
:
linearViscousStress<laminarModel<BasicTurbulenceModel>>
(
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 BasicTurbulenceModel>
Foam::tmp<Foam::volScalarField>
generalizedNewtonian<BasicTurbulenceModel>::strainRate() const
{
return sqrt(2.0)*mag(symm(fvc::grad(this->U())));
}


// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

template<class BasicTurbulenceModel>
bool generalizedNewtonian<BasicTurbulenceModel>::read()
{
viscosityModel_->read(this->coeffDict_);

return true;
}


template<class BasicTurbulenceModel>
tmp<volScalarField>
generalizedNewtonian<BasicTurbulenceModel>::nut() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
IOobject::groupName("nut", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedScalar("nut", dimViscosity, 0.0)
)
);
}


template<class BasicTurbulenceModel>
tmp<scalarField>
generalizedNewtonian<BasicTurbulenceModel>::nut
(
const label patchi
) const
{
return tmp<scalarField>
(
new scalarField(this->mesh_.boundary()[patchi].size(), 0.0)
);
}


template<class BasicTurbulenceModel>
tmp<volScalarField>
generalizedNewtonian<BasicTurbulenceModel>::nuEff() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject::groupName("nuEff", this->alphaRhoPhi_.group()), nu_
)
);
}


template<class BasicTurbulenceModel>
tmp<scalarField>
generalizedNewtonian<BasicTurbulenceModel>::nuEff
(
const label patchi
) const
{
return nu_.boundaryField()[patchi];
}


template<class BasicTurbulenceModel>
tmp<volScalarField>
generalizedNewtonian<BasicTurbulenceModel>::k() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
IOobject::groupName("k", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedScalar("k", sqr(this->U_.dimensions()), 0.0)
)
);
}


template<class BasicTurbulenceModel>
tmp<volScalarField>
generalizedNewtonian<BasicTurbulenceModel>::epsilon() const
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
IOobject::groupName("epsilon", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedScalar
(
"epsilon", sqr(this->U_.dimensions())/dimTime, 0.0
)
)
);
}


template<class BasicTurbulenceModel>
tmp<volSymmTensorField>
generalizedNewtonian<BasicTurbulenceModel>::R() const
{
return tmp<volSymmTensorField>
(
new volSymmTensorField
(
IOobject
(
IOobject::groupName("R", this->alphaRhoPhi_.group()),
this->runTime_.timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh_,
dimensionedSymmTensor
(
"R", sqr(this->U_.dimensions()), Zero
)
)
);
}


template<class BasicTurbulenceModel>
void generalizedNewtonian<BasicTurbulenceModel>::correct()
{
nu_ = viscosityModel_->nu(this->nu(), strainRate());
laminarModel<BasicTurbulenceModel>::correct();
}


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace laminarModels
} // End namespace Foam

// ************************************************************************* //

0 comments on commit 94d0b9f

Please sign in to comment.
You can’t perform that action at this time.