ThermophysicalTransportModels::FickianFourier: New thermophysical transport model for laminar flow

Description
    Multi-component Fickian and Fourier based temperature gradient heat flux
    model laminar flow with optional Soret thermal diffusion of species.

    Currently the diffusion coefficients are constant but temperature and
    pressure dependency will be added.

    The heat flux source is implemented as an implicit energy correction to the
    temperature gradient based flux source.  At convergence the energy
    correction is 0.

Usage
    \verbatim
    laminar
    {
        model           FickianFourier;

        D               (1e-5 2e-5 1e-5); // [m^2/s]
        DT              (1e-5 2e-5 1e-5); // [kg/m/s] Optional
    }
    \endverbatim
This commit is contained in:
Henry Weller
2021-01-04 16:10:14 +00:00
parent a32bf164e1
commit 16e9757bf3
10 changed files with 820 additions and 293 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,6 +45,9 @@ makeLaminarThermophysicalTransportModel(Fourier);
#include "unityLewisFourier.H"
makeLaminarThermophysicalTransportModel(unityLewisFourier);
#include "FickianFourier.H"
makeLaminarThermophysicalTransportModel(FickianFourier);
// -------------------------------------------------------------------------- //
// RAS models

View File

@ -0,0 +1,391 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 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 "Fickian.H"
#include "fvcDiv.H"
#include "fvcLaplacian.H"
#include "fvcSnGrad.H"
#include "fvmSup.H"
#include "surfaceInterpolate.H"
#include "Function2Evaluate.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class BasicThermophysicalTransportModel>
Fickian<BasicThermophysicalTransportModel>::
Fickian
(
const word& type,
const momentumTransportModel& momentumTransport,
const thermoModel& thermo
)
:
BasicThermophysicalTransportModel
(
type,
momentumTransport,
thermo
),
D_(this->thermo().composition().species().size()),
DT_
(
this->coeffDict_.found("DT")
? this->thermo().composition().species().size()
: 0
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class BasicThermophysicalTransportModel>
bool
Fickian<BasicThermophysicalTransportModel>::read()
{
if
(
BasicThermophysicalTransportModel::read()
)
{
const speciesTable& species = this->thermo().composition().species();
const dictionary& Ddict = this->coeffDict_.subDict("D");
forAll(species, i)
{
D_.set(i, Function2<scalar>::New(species[i], Ddict).ptr());
}
if (this->coeffDict_.found("DT"))
{
const dictionary& DTdict = this->coeffDict_.subDict("DT");
forAll(species, i)
{
DT_.set(i, Function2<scalar>::New(species[i], DTdict).ptr());
}
}
return true;
}
else
{
return false;
}
}
template<class BasicThermophysicalTransportModel>
tmp<volScalarField>
Fickian<BasicThermophysicalTransportModel>::DEff
(
const volScalarField& Yi
) const
{
const basicSpecieMixture& composition =
this->thermo().composition();
return volScalarField::New
(
"DEff",
this->momentumTransport().rho()
*evaluate
(
D_[composition.index(Yi)],
dimViscosity,
this->thermo().p(),
this->thermo().T()
)
);
}
template<class BasicThermophysicalTransportModel>
tmp<scalarField>
Fickian<BasicThermophysicalTransportModel>::DEff
(
const volScalarField& Yi,
const label patchi
) const
{
const basicSpecieMixture& composition =
this->thermo().composition();
return
this->momentumTransport().rho().boundaryField()[patchi]
*D_[composition.index(Yi)].value
(
this->thermo().p().boundaryField()[patchi],
this->thermo().T().boundaryField()[patchi]
);
}
template<class BasicThermophysicalTransportModel>
tmp<surfaceScalarField>
Fickian<BasicThermophysicalTransportModel>::q() const
{
tmp<surfaceScalarField> tmpq
(
surfaceScalarField::New
(
IOobject::groupName
(
"q",
this->momentumTransport().alphaRhoPhi().group()
),
-fvc::interpolate(this->alpha()*this->kappaEff())
*fvc::snGrad(this->thermo().T())
)
);
const basicSpecieMixture& composition = this->thermo().composition();
const PtrList<volScalarField>& Y = composition.Y();
if (Y.size())
{
surfaceScalarField sumJ
(
surfaceScalarField::New
(
"sumJ",
Y[0].mesh(),
dimensionedScalar(dimMass/dimArea/dimTime, 0)
)
);
surfaceScalarField sumJh
(
surfaceScalarField::New
(
"sumJh",
Y[0].mesh(),
dimensionedScalar(sumJ.dimensions()*dimEnergy/dimMass, 0)
)
);
forAll(Y, i)
{
if (i != composition.defaultSpecie())
{
const volScalarField hi
(
composition.HE(i, this->thermo().p(), this->thermo().T())
);
const surfaceScalarField ji(this->j(Y[i]));
sumJ += ji;
sumJh += ji*fvc::interpolate(hi);
}
}
{
const label i = composition.defaultSpecie();
const volScalarField hi
(
composition.HE(i, this->thermo().p(), this->thermo().T())
);
sumJh -= sumJ*fvc::interpolate(hi);
}
tmpq.ref() += sumJh;
}
return tmpq;
}
template<class BasicThermophysicalTransportModel>
tmp<fvScalarMatrix>
Fickian<BasicThermophysicalTransportModel>::divq(volScalarField& he) const
{
tmp<fvScalarMatrix> tmpDivq
(
fvm::Su
(
-fvc::laplacian(this->alpha()*this->kappaEff(), this->thermo().T()),
he
)
);
const basicSpecieMixture& composition = this->thermo().composition();
const PtrList<volScalarField>& Y = composition.Y();
if (!Y.size())
{
tmpDivq.ref() -=
correction(fvm::laplacian(this->alpha()*this->alphaEff(), he));
}
else
{
tmpDivq.ref() -= fvm::laplacian(this->alpha()*this->alphaEff(), he);
volScalarField heNew
(
volScalarField::New
(
"he",
he.mesh(),
dimensionedScalar(he.dimensions(), 0)
)
);
surfaceScalarField sumJ
(
surfaceScalarField::New
(
"sumJ",
he.mesh(),
dimensionedScalar(dimMass/dimArea/dimTime, 0)
)
);
surfaceScalarField sumJh
(
surfaceScalarField::New
(
"sumJh",
he.mesh(),
dimensionedScalar(sumJ.dimensions()*he.dimensions(), 0)
)
);
forAll(Y, i)
{
if (i != composition.defaultSpecie())
{
const volScalarField hi
(
composition.HE(i, this->thermo().p(), this->thermo().T())
);
heNew += Y[i]*hi;
const surfaceScalarField ji(this->j(Y[i]));
sumJ += ji;
sumJh += ji*fvc::interpolate(hi);
}
}
{
const label i = composition.defaultSpecie();
const volScalarField hi
(
composition.HE(i, this->thermo().p(), this->thermo().T())
);
heNew += Y[i]*hi;
sumJh -= sumJ*fvc::interpolate(hi);
}
tmpDivq.ref() +=
fvc::laplacian(this->alpha()*this->alphaEff(), heNew);
tmpDivq.ref() += fvc::div(sumJh*he.mesh().magSf());
}
return tmpDivq;
}
template<class BasicThermophysicalTransportModel>
tmp<surfaceScalarField>
Fickian<BasicThermophysicalTransportModel>::j
(
const volScalarField& Yi
) const
{
if (DT_.size())
{
const basicSpecieMixture& composition = this->thermo().composition();
const volScalarField& p = this->thermo().T();
const volScalarField& T = this->thermo().T();
return
BasicThermophysicalTransportModel::j(Yi)
- fvc::interpolate
(
evaluate(DT_[composition.index(Yi)], dimDynamicViscosity, p, T)
)
*fvc::snGrad(T)/fvc::interpolate(T);
}
else
{
return BasicThermophysicalTransportModel::j(Yi);
}
}
template<class BasicThermophysicalTransportModel>
tmp<fvScalarMatrix>
Fickian<BasicThermophysicalTransportModel>::divj(volScalarField& Yi) const
{
if (DT_.size())
{
const basicSpecieMixture& composition = this->thermo().composition();
const volScalarField& p = this->thermo().T();
const volScalarField& T = this->thermo().T();
return
BasicThermophysicalTransportModel::divj(Yi)
- fvc::div
(
fvc::interpolate
(
evaluate
(
DT_[composition.index(Yi)],
dimDynamicViscosity,
p,
T
)
)
*fvc::snGrad(T)/fvc::interpolate(T)
*T.mesh().magSf()
);
}
else
{
return BasicThermophysicalTransportModel::divj(Yi);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,151 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::turbulenceThermophysicalTransportModels::Fickian
Description
Base class for multi-component Fickian based temperature gradient heat
flux models with optional Soret thermal diffusion of species.
Currently the diffusion coefficients are constant but temperature and
pressure dependency will be added.
The heat flux source is implemented as an implicit energy correction to the
temperature gradient based flux source. At convergence the energy
correction is 0.
SourceFiles
Fickian.C
\*---------------------------------------------------------------------------*/
#include "Function2.H"
#ifndef Fickian_H
#define Fickian_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class Fickian Declaration
\*---------------------------------------------------------------------------*/
template<class BasicThermophysicalTransportModel>
class Fickian
:
public BasicThermophysicalTransportModel
{
protected:
// Protected data
// Model coefficients
//- List of specie mass diffusion coefficient functions
// w.r.t the mixture [m^2/s]
PtrList<Function2<scalar>> D_;
//- List of specie Soret thermal diffusion coefficient
// functions [kg/m/s]
PtrList<Function2<scalar>> DT_;
public:
typedef typename BasicThermophysicalTransportModel::alphaField
alphaField;
typedef typename
BasicThermophysicalTransportModel::momentumTransportModel
momentumTransportModel;
typedef typename BasicThermophysicalTransportModel::thermoModel
thermoModel;
// Constructors
//- Construct from a momentum transport model and a thermo model
Fickian
(
const word& type,
const momentumTransportModel& momentumTransport,
const thermoModel& thermo
);
//- Destructor
virtual ~Fickian()
{}
// Member Functions
//- Read thermophysicalTransport dictionary
virtual bool read();
//- Effective mass diffusivity for a given specie mass-fraction [kg/m/s]
virtual tmp<volScalarField> DEff(const volScalarField& Yi) const;
//- Effective mass diffusivity for a given specie mass-fraction
// for patch [kg/m/s]
virtual tmp<scalarField> DEff
(
const volScalarField& Yi,
const label patchi
) const;
//- Return the heat flux [W/m^2]
virtual tmp<surfaceScalarField> q() const;
//- Return the source term for the energy equation
virtual tmp<fvScalarMatrix> divq(volScalarField& he) const;
//- Return the specie flux for the given specie mass-fraction [kg/m^2/s]
virtual tmp<surfaceScalarField> j(const volScalarField& Yi) const;
//- Return the source term for the given specie mass-fraction equation
virtual tmp<fvScalarMatrix> divj(volScalarField& Yi) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "Fickian.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,74 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2021 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 "FickianFourier.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarThermophysicalTransportModels
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class laminarThermophysicalTransportModel>
FickianFourier<laminarThermophysicalTransportModel>::
FickianFourier
(
const momentumTransportModel& momentumTransport,
const thermoModel& thermo
)
:
Fickian<unityLewisFourier<laminarThermophysicalTransportModel>>
(
typeName,
momentumTransport,
thermo
)
{
read();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class laminarThermophysicalTransportModel>
bool
FickianFourier<laminarThermophysicalTransportModel>::read()
{
return Fickian
<
unityLewisFourier<laminarThermophysicalTransportModel>
>::read();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace laminarThermophysicalTransportModels
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,144 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::laminarThermophysicalTransportModels::FickianFourier
Description
Multi-component Fickian and Fourier based temperature gradient heat flux
model laminar flow with optional Soret thermal diffusion of species.
Currently the diffusion coefficients are constant but temperature and
pressure dependency will be added.
The heat flux source is implemented as an implicit energy correction to the
temperature gradient based flux source. At convergence the energy
correction is 0.
Usage
\verbatim
laminar
{
model FickianFourier;
D (1e-5 2e-5 1e-5); // [m^2/s]
DT (1e-5 2e-5 1e-5); // [kg/m/s] Optional
}
\endverbatim
SourceFiles
FickianFourier.C
\*---------------------------------------------------------------------------*/
#include "Fickian.H"
#include "unityLewisFourier.H"
#ifndef FickianFourier_H
#define FickianFourier_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace laminarThermophysicalTransportModels
{
/*---------------------------------------------------------------------------*\
Class FickianFourier Declaration
\*---------------------------------------------------------------------------*/
template<class laminarThermophysicalTransportModel>
class FickianFourier
:
public Fickian
<
unityLewisFourier<laminarThermophysicalTransportModel>
>
{
protected:
// Protected data
// Model coefficients
//- Turbulent Schmidt number []
dimensionedScalar Sct_;
public:
typedef typename laminarThermophysicalTransportModel::alphaField
alphaField;
typedef typename
laminarThermophysicalTransportModel::momentumTransportModel
momentumTransportModel;
typedef typename laminarThermophysicalTransportModel::thermoModel
thermoModel;
//- Runtime type information
TypeName("FickianFourier");
// Constructors
//- Construct from a momentum transport model and a thermo model
FickianFourier
(
const momentumTransportModel& momentumTransport,
const thermoModel& thermo
);
//- Destructor
virtual ~FickianFourier()
{}
// Member Functions
//- Read thermophysicalTransport dictionary
virtual bool read();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace laminarThermophysicalTransportModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "FickianFourier.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,7 +44,7 @@ unityLewisFourier<BasicThermophysicalTransportModel>::unityLewisFourier
const thermoModel& thermo
)
:
laminarThermophysicalTransportModel<BasicThermophysicalTransportModel>
unityLewisFourier
(
typeName,
momentumTransport,
@ -53,6 +53,23 @@ unityLewisFourier<BasicThermophysicalTransportModel>::unityLewisFourier
{}
template<class BasicThermophysicalTransportModel>
unityLewisFourier<BasicThermophysicalTransportModel>::unityLewisFourier
(
const word& type,
const momentumTransportModel& momentumTransport,
const thermoModel& thermo
)
:
laminarThermophysicalTransportModel<BasicThermophysicalTransportModel>
(
type,
momentumTransport,
thermo
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class BasicThermophysicalTransportModel>
@ -120,7 +137,7 @@ tmp<fvScalarMatrix>
unityLewisFourier<BasicThermophysicalTransportModel>::
divj(volScalarField& Yi) const
{
return -fvm::laplacian(this->alpha()*this->thermo().alpha(), Yi);
return -fvm::laplacian(this->alpha()*this->DEff(Yi), Yi);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -76,13 +76,22 @@ public:
// Constructors
//- Construct from components
//- Construct from a momentum transport model and a thermo model
unityLewisFourier
(
const momentumTransportModel& momentumTransport,
const thermoModel& thermo
);
//- Construct from a type name, a momentum transport model and a thermo
// model
unityLewisFourier
(
const word& type,
const momentumTransportModel& momentumTransport,
const thermoModel& thermo
);
//- Destructor
virtual ~unityLewisFourier()

View File

@ -24,12 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "FickianEddyDiffusivity.H"
#include "fvcDiv.H"
#include "fvcLaplacian.H"
#include "fvcSnGrad.H"
#include "fvmSup.H"
#include "surfaceInterpolate.H"
#include "Function2Evaluate.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,23 +42,14 @@ FickianEddyDiffusivity
const thermoModel& thermo
)
:
unityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>
Fickian<unityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>>
(
typeName,
momentumTransport,
thermo,
false
thermo
),
Sct_("Sct", dimless, this->coeffDict_),
D_(this->thermo().composition().species().size()),
DT_
(
this->coeffDict_.found("DT")
? this->thermo().composition().species().size()
: 0
)
Sct_("Sct", dimless, this->coeffDict_)
{
read();
}
@ -78,30 +63,14 @@ FickianEddyDiffusivity<TurbulenceThermophysicalTransportModel>::read()
{
if
(
unityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>
::read()
Fickian
<
unityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>
>::read()
)
{
Sct_.read(this->coeffDict());
const speciesTable& species = this->thermo().composition().species();
const dictionary& Ddict = this->coeffDict_.subDict("D");
forAll(species, i)
{
D_.set(i, Function2<scalar>::New(species[i], Ddict).ptr());
}
if (this->coeffDict_.found("DT"))
{
const dictionary& DTdict = this->coeffDict_.subDict("DT");
forAll(species, i)
{
DT_.set(i, Function2<scalar>::New(species[i], DTdict).ptr());
}
}
return true;
}
else
@ -118,20 +87,13 @@ FickianEddyDiffusivity<TurbulenceThermophysicalTransportModel>::DEff
const volScalarField& Yi
) const
{
const basicSpecieMixture& composition =
this->thermo().composition();
return volScalarField::New
(
"DEff",
this->momentumTransport().rho()
*evaluate
(
D_[composition.index(Yi)],
dimViscosity,
this->thermo().p(),
this->thermo().T()
)
Fickian
<
unityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>
>::DEff(Yi)
+ (this->Prt_/Sct_)*this->alphat()
);
}
@ -145,227 +107,15 @@ FickianEddyDiffusivity<TurbulenceThermophysicalTransportModel>::DEff
const label patchi
) const
{
const basicSpecieMixture& composition =
this->thermo().composition();
return
this->momentumTransport().rho().boundaryField()[patchi]
*D_[composition.index(Yi)].value
(
this->thermo().p().boundaryField()[patchi],
this->thermo().T().boundaryField()[patchi]
)
Fickian
<
unityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>
>::DEff(Yi, patchi)
+ this->Prt_.value()/Sct_.value()*this->alphat(patchi);
}
template<class TurbulenceThermophysicalTransportModel>
tmp<surfaceScalarField>
FickianEddyDiffusivity<TurbulenceThermophysicalTransportModel>::j
(
const volScalarField& Yi
) const
{
if (DT_.size())
{
const basicSpecieMixture& composition = this->thermo().composition();
const volScalarField& p = this->thermo().T();
const volScalarField& T = this->thermo().T();
return
unityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>::
j(Yi)
- fvc::interpolate
(
evaluate(DT_[composition.index(Yi)], dimDynamicViscosity, p, T)
)
*fvc::snGrad(T)/fvc::interpolate(T);
}
else
{
return
unityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>::
j(Yi);
}
}
template<class TurbulenceThermophysicalTransportModel>
tmp<surfaceScalarField>
FickianEddyDiffusivity<TurbulenceThermophysicalTransportModel>::q() const
{
tmp<surfaceScalarField> tmpq
(
surfaceScalarField::New
(
IOobject::groupName
(
"q",
this->momentumTransport().alphaRhoPhi().group()
),
-fvc::interpolate(this->alpha()*this->kappaEff())
*fvc::snGrad(this->thermo().T())
)
);
const basicSpecieMixture& composition = this->thermo().composition();
const PtrList<volScalarField>& Y = composition.Y();
if (Y.size())
{
surfaceScalarField sumJ
(
surfaceScalarField::New
(
"sumJ",
Y[0].mesh(),
dimensionedScalar(dimMass/dimArea/dimTime, 0)
)
);
surfaceScalarField sumJh
(
surfaceScalarField::New
(
"sumJh",
Y[0].mesh(),
dimensionedScalar(sumJ.dimensions()*dimEnergy/dimMass, 0)
)
);
forAll(Y, i)
{
if (i != composition.defaultSpecie())
{
const volScalarField hi
(
composition.HE(i, this->thermo().p(), this->thermo().T())
);
const surfaceScalarField ji(this->j(Y[i]));
sumJ += ji;
sumJh += ji*fvc::interpolate(hi);
}
}
{
const label i = composition.defaultSpecie();
const volScalarField hi
(
composition.HE(i, this->thermo().p(), this->thermo().T())
);
sumJh -= sumJ*fvc::interpolate(hi);
}
tmpq.ref() += sumJh;
}
return tmpq;
}
template<class TurbulenceThermophysicalTransportModel>
tmp<fvScalarMatrix>
FickianEddyDiffusivity<TurbulenceThermophysicalTransportModel>::divq
(
volScalarField& he
) const
{
tmp<fvScalarMatrix> tmpDivq
(
fvm::Su
(
-fvc::laplacian(this->alpha()*this->kappaEff(), this->thermo().T()),
he
)
);
const basicSpecieMixture& composition = this->thermo().composition();
const PtrList<volScalarField>& Y = composition.Y();
if (!Y.size())
{
tmpDivq.ref() -=
correction(fvm::laplacian(this->alpha()*this->alphaEff(), he));
}
else
{
tmpDivq.ref() -= fvm::laplacian(this->alpha()*this->alphaEff(), he);
volScalarField heNew
(
volScalarField::New
(
"he",
he.mesh(),
dimensionedScalar(he.dimensions(), 0)
)
);
surfaceScalarField sumJ
(
surfaceScalarField::New
(
"sumJ",
he.mesh(),
dimensionedScalar(dimMass/dimArea/dimTime, 0)
)
);
surfaceScalarField sumJh
(
surfaceScalarField::New
(
"sumJh",
he.mesh(),
dimensionedScalar(sumJ.dimensions()*he.dimensions(), 0)
)
);
forAll(Y, i)
{
if (i != composition.defaultSpecie())
{
const volScalarField hi
(
composition.HE(i, this->thermo().p(), this->thermo().T())
);
heNew += Y[i]*hi;
const surfaceScalarField ji(this->j(Y[i]));
sumJ += ji;
sumJh += ji*fvc::interpolate(hi);
}
}
{
const label i = composition.defaultSpecie();
const volScalarField hi
(
composition.HE(i, this->thermo().p(), this->thermo().T())
);
heNew += Y[i]*hi;
sumJh -= sumJ*fvc::interpolate(hi);
}
tmpDivq.ref() +=
fvc::laplacian(this->alpha()*this->alphaEff(), heNew);
tmpDivq.ref() += fvc::div(sumJh*he.mesh().magSf());
}
return tmpDivq;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace turbulenceThermophysicalTransportModels

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -41,8 +41,10 @@ Usage
RAS
{
model FickianEddyDiffusivity;
Prt 0.85;
Sct 0.7;
D (1e-5 2e-5 1e-5); // [m^2/s]
DT (1e-5 2e-5 1e-5); // [kg/m/s] Optional
}
@ -53,8 +55,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#include "Fickian.H"
#include "unityLewisEddyDiffusivity.H"
#include "Function2.H"
#ifndef FickianEddyDiffusivity_H
#define FickianEddyDiffusivity_H
@ -73,7 +75,10 @@ namespace turbulenceThermophysicalTransportModels
template<class TurbulenceThermophysicalTransportModel>
class FickianEddyDiffusivity
:
public unityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>
public Fickian
<
unityLewisEddyDiffusivity<TurbulenceThermophysicalTransportModel>
>
{
protected:
@ -85,14 +90,6 @@ protected:
//- Turbulent Schmidt number []
dimensionedScalar Sct_;
//- List of specie mass diffusion coefficient functions
// w.r.t the mixture [m^2/s]
PtrList<Function2<scalar>> D_;
//- List of specie Soret thermal diffusion coefficient
// functions [kg/m/s]
PtrList<Function2<scalar>> DT_;
public:
@ -141,15 +138,6 @@ public:
const volScalarField& Yi,
const label patchi
) const;
//- Return the heat flux [W/m^2]
virtual tmp<surfaceScalarField> q() const;
//- Return the source term for the energy equation
virtual tmp<fvScalarMatrix> divq(volScalarField& he) const;
//- Return the specie flux for the given specie mass-fraction [kg/m^2/s]
virtual tmp<surfaceScalarField> j(const volScalarField& Yi) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -117,7 +117,7 @@ public:
const word& type,
const momentumTransportModel& momentumTransport,
const thermoModel& thermo,
const bool allowDefaultPrt
const bool allowDefaultPrt = false
);