multiComponentMixture implements calculateDiffusivities(p,T)

This commit is contained in:
ignis 2016-10-10 15:09:38 +09:00
parent e4fb1fc545
commit e839dfb9cc
3 changed files with 53 additions and 2 deletions

View file

@ -63,8 +63,7 @@ protected:
PtrList<volScalarField> Y_;
//- Mixture-averaged species diffusivities
PtrList<volScalarField> D_;
mutable PtrList<volScalarField> D_;
public:

View file

@ -122,6 +122,55 @@ Foam::multiComponentMixture<ThermoType>::multiComponentMixture
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ThermoType>
void Foam::multiComponentMixture<ThermoType>::
calculateDiffusivities
(
const volScalarField &p,
const volScalarField &T
) const
{
const volScalarField& Yi = Y_[0];
const scalarField& YiCells = Yi.internalField();
forAll(YiCells, celli)
{
const ThermoType &mixture = cellMixture(celli);
mixture.calculateDiffusivities(p[celli], T[celli]);
forAll(speciesData_, i)
{
volScalarField& Di = D_[i];
scalarField& DiCells = Di.internalField();
DiCells[celli] = mixture.D(i);
}
}
forAll(Yi.boundaryField(), patchi)
{
const scalarField& Yip = Yi.boundaryField()[patchi];
const scalarField& pp = p.boundaryField()[patchi];
const scalarField& Tp = T.boundaryField()[patchi];
forAll(Yip, facei)
{
const ThermoType &mixture = patchFaceMixture(patchi, facei);
mixture.calculateDiffusivities(pp[facei], Tp[facei]);
forAll(speciesData_, i)
{
volScalarField& Di = D_[i];
scalarField& Dip = Di.boundaryField()[patchi];
Dip[facei] = mixture.D(i);
}
}
}
return;
}
template<class ThermoType>
const ThermoType& Foam::multiComponentMixture<ThermoType>::cellMixture
(

View file

@ -106,6 +106,9 @@ public:
// Member functions
//- Calculate mixture-aveaged diffusivities
virtual void calculateDiffusivities(const volScalarField& p, const volScalarField& T) const;
const ThermoType& cellMixture(const label celli) const;
const ThermoType& patchFaceMixture