fvOptions: Add support for boundary field relative flux function

This commit is contained in:
Henry 2013-09-11 00:08:22 +01:00
parent 72e9a0bab9
commit cda1304911
9 changed files with 90 additions and 35 deletions

View File

@ -461,6 +461,28 @@ void Foam::MRFZone::makeRelative(volVectorField& U) const
}
void Foam::MRFZone::makeRelative(surfaceScalarField& phi) const
{
makeRelativeRhoFlux(geometricOneField(), phi);
}
void Foam::MRFZone::makeRelative(FieldField<fvsPatchField, scalar>& phi) const
{
makeRelativeRhoFlux(oneFieldField(), phi);
}
void Foam::MRFZone::makeRelative
(
const surfaceScalarField& rho,
surfaceScalarField& phi
) const
{
makeRelativeRhoFlux(rho, phi);
}
void Foam::MRFZone::makeAbsolute(volVectorField& U) const
{
const volVectorField& C = mesh_.C();
@ -499,28 +521,6 @@ void Foam::MRFZone::makeAbsolute(volVectorField& U) const
}
void Foam::MRFZone::makeRelative(surfaceScalarField& phi) const
{
makeRelativeRhoFlux(geometricOneField(), phi);
}
void Foam::MRFZone::makeRelative(FieldField<fvsPatchField, scalar>& phi) const
{
return makeRelativeRhoFlux(oneFieldField(), phi);
}
void Foam::MRFZone::makeRelative
(
const surfaceScalarField& rho,
surfaceScalarField& phi
) const
{
makeRelativeRhoFlux(rho, phi);
}
void Foam::MRFZone::makeAbsolute(surfaceScalarField& phi) const
{
makeAbsoluteRhoFlux(geometricOneField(), phi);

View File

@ -218,9 +218,6 @@ public:
//- Make the given absolute velocity relative within the MRF region
void makeRelative(volVectorField& U) const;
//- Make the given relative velocity absolute within the MRF region
void makeAbsolute(volVectorField& U) const;
//- Make the given absolute flux relative within the MRF region
void makeRelative(surfaceScalarField& phi) const;
@ -235,6 +232,9 @@ public:
surfaceScalarField& phi
) const;
//- Make the given relative velocity absolute within the MRF region
void makeAbsolute(volVectorField& U) const;
//- Make the given relative flux absolute within the MRF region
void makeAbsolute(surfaceScalarField& phi) const;

View File

@ -169,15 +169,6 @@ void Foam::MRFZoneList::makeRelative(volVectorField& U) const
}
void Foam::MRFZoneList::makeAbsolute(volVectorField& U) const
{
forAll(*this, i)
{
operator[](i).makeAbsolute(U);
}
}
void Foam::MRFZoneList::makeRelative(surfaceScalarField& phi) const
{
forAll(*this, i)
@ -193,7 +184,7 @@ Foam::MRFZoneList::relative
const tmp<FieldField<fvsPatchField, scalar> >& phi
) const
{
tmp<FieldField<fvsPatchField, scalar> > rphi(phi);
tmp<FieldField<fvsPatchField, scalar> > rphi(phi.ptr());
forAll(*this, i)
{
@ -217,6 +208,15 @@ void Foam::MRFZoneList::makeRelative
}
void Foam::MRFZoneList::makeAbsolute(volVectorField& U) const
{
forAll(*this, i)
{
operator[](i).makeAbsolute(U);
}
}
void Foam::MRFZoneList::makeAbsolute(surfaceScalarField& phi) const
{
forAll(*this, i)

View File

@ -27,6 +27,7 @@ License
#include "fvMesh.H"
#include "fvMatrices.H"
#include "volFields.H"
#include "fvsPatchFields.H"
#include "ListOps.H"
#include "addToRunTimeSelectionTable.H"
@ -480,6 +481,15 @@ void Foam::fv::option::makeRelative(surfaceScalarField& phi) const
}
void Foam::fv::option::makeRelative
(
FieldField<fvsPatchField, scalar>& phi
) const
{
// do nothing
}
void Foam::fv::option::makeRelative
(
const surfaceScalarField& rho,

View File

@ -427,6 +427,12 @@ public:
//- Make the given absolute flux relative
virtual void makeRelative(surfaceScalarField& phi) const;
//- Make the given absolute boundary flux relative
virtual void makeRelative
(
FieldField<fvsPatchField, scalar>& phi
) const;
//- Make the given absolute mass-flux relative
virtual void makeRelative
(

View File

@ -26,6 +26,7 @@ License
#include "fvOptionList.H"
#include "addToRunTimeSelectionTable.H"
#include "fvMesh.H"
#include "surfaceFields.H"
#include "Time.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -129,6 +130,23 @@ void Foam::fv::optionList::makeRelative
}
Foam::tmp<Foam::FieldField<Foam::fvsPatchField, Foam::scalar> >
Foam::fv::optionList::relative
(
const tmp<FieldField<fvsPatchField, scalar> >& phi
) const
{
tmp<FieldField<fvsPatchField, scalar> > rphi(phi.ptr());
forAll(*this, i)
{
operator[](i).makeRelative(rphi());
}
return rphi;
}
void Foam::fv::optionList::makeAbsolute(surfaceScalarField& phi) const
{
forAll(*this, i)

View File

@ -166,6 +166,12 @@ public:
surfaceScalarField& phi
) const;
//- Return the given absolute boundary flux relative
tmp<FieldField<fvsPatchField, scalar> > relative
(
const tmp<FieldField<fvsPatchField, scalar> >& tphi
) const;
//- Make the given relative flux absolute
void makeAbsolute(surfaceScalarField& phi) const;

View File

@ -126,6 +126,15 @@ void Foam::fv::MRFSource::makeRelative(surfaceScalarField& phi) const
}
void Foam::fv::MRFSource::makeRelative
(
FieldField<fvsPatchField, scalar>& phi
) const
{
mrfPtr_->makeRelative(phi);
}
void Foam::fv::MRFSource::makeRelative
(
const surfaceScalarField& rho,

View File

@ -140,6 +140,12 @@ public:
//- Make the given absolute flux relative
virtual void makeRelative(surfaceScalarField& phi) const;
//- Make the given absolute boundary flux relative
virtual void makeRelative
(
FieldField<fvsPatchField, scalar>& phi
) const;
//- Make the given absolute mass-flux relative
virtual void makeRelative
(