mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
MRFZone: Added patch-based "relative" function
This commit is contained in:
@ -453,6 +453,12 @@ void Foam::MRFZone::makeRelative(FieldField<fvsPatchField, scalar>& phi) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::MRFZone::makeRelative(Field<scalar>& phi, const label patchi) const
|
||||||
|
{
|
||||||
|
makeRelativeRhoFlux(oneField(), phi, patchi);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::MRFZone::makeRelative
|
void Foam::MRFZone::makeRelative
|
||||||
(
|
(
|
||||||
const surfaceScalarField& rho,
|
const surfaceScalarField& rho,
|
||||||
|
|||||||
@ -129,6 +129,15 @@ class MRFZone
|
|||||||
FieldField<fvsPatchField, scalar>& phi
|
FieldField<fvsPatchField, scalar>& phi
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Make the given absolute mass/vol flux relative within the MRF region
|
||||||
|
template<class RhoFieldType>
|
||||||
|
void makeRelativeRhoFlux
|
||||||
|
(
|
||||||
|
const RhoFieldType& rho,
|
||||||
|
Field<scalar>& phi,
|
||||||
|
const label patchi
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Make the given relative mass/vol flux absolute within the MRF region
|
//- Make the given relative mass/vol flux absolute within the MRF region
|
||||||
template<class RhoFieldType>
|
template<class RhoFieldType>
|
||||||
void makeAbsoluteRhoFlux
|
void makeAbsoluteRhoFlux
|
||||||
@ -226,6 +235,10 @@ public:
|
|||||||
// within the MRF region
|
// within the MRF region
|
||||||
void makeRelative(FieldField<fvsPatchField, scalar>& phi) const;
|
void makeRelative(FieldField<fvsPatchField, scalar>& phi) const;
|
||||||
|
|
||||||
|
//- Make the given absolute patch flux relative
|
||||||
|
// within the MRF region
|
||||||
|
void makeRelative(Field<scalar>& phi, const label patchi) const;
|
||||||
|
|
||||||
//- Make the given absolute mass-flux relative within the MRF region
|
//- Make the given absolute mass-flux relative within the MRF region
|
||||||
void makeRelative
|
void makeRelative
|
||||||
(
|
(
|
||||||
|
|||||||
@ -247,6 +247,24 @@ Foam::MRFZoneList::relative
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::tmp<Foam::Field<Foam::scalar>>
|
||||||
|
Foam::MRFZoneList::relative
|
||||||
|
(
|
||||||
|
const tmp<Field<scalar>>& phi,
|
||||||
|
const label patchi
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
tmp<Field<scalar>> rphi(phi.ptr());
|
||||||
|
|
||||||
|
forAll(*this, i)
|
||||||
|
{
|
||||||
|
operator[](i).makeRelative(rphi(), patchi);
|
||||||
|
}
|
||||||
|
|
||||||
|
return rphi;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::MRFZoneList::makeRelative
|
void Foam::MRFZoneList::makeRelative
|
||||||
(
|
(
|
||||||
const surfaceScalarField& rho,
|
const surfaceScalarField& rho,
|
||||||
|
|||||||
@ -142,6 +142,14 @@ public:
|
|||||||
const tmp<FieldField<fvsPatchField, scalar>>& tphi
|
const tmp<FieldField<fvsPatchField, scalar>>& tphi
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Return the given absolute patch flux relative within
|
||||||
|
// the MRF region
|
||||||
|
tmp<Field<scalar>> relative
|
||||||
|
(
|
||||||
|
const tmp<Field<scalar>>& tphi,
|
||||||
|
const label patchi
|
||||||
|
) const;
|
||||||
|
|
||||||
//- Make the given absolute mass-flux relative within the MRF region
|
//- Make the given absolute mass-flux relative within the MRF region
|
||||||
void makeRelative
|
void makeRelative
|
||||||
(
|
(
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -97,6 +97,40 @@ void Foam::MRFZone::makeRelativeRhoFlux
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class RhoFieldType>
|
||||||
|
void Foam::MRFZone::makeRelativeRhoFlux
|
||||||
|
(
|
||||||
|
const RhoFieldType& rho,
|
||||||
|
Field<scalar>& phi,
|
||||||
|
const label patchi
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
const surfaceVectorField& Cf = mesh_.Cf();
|
||||||
|
const surfaceVectorField& Sf = mesh_.Sf();
|
||||||
|
|
||||||
|
const vector Omega = omega_->value(mesh_.time().timeOutputValue())*axis_;
|
||||||
|
|
||||||
|
// Included patches
|
||||||
|
forAll(includedFaces_[patchi], i)
|
||||||
|
{
|
||||||
|
label patchFacei = includedFaces_[patchi][i];
|
||||||
|
|
||||||
|
phi[patchFacei] = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Excluded patches
|
||||||
|
forAll(excludedFaces_[patchi], i)
|
||||||
|
{
|
||||||
|
label patchFacei = excludedFaces_[patchi][i];
|
||||||
|
|
||||||
|
phi[patchFacei] -=
|
||||||
|
rho[patchFacei]
|
||||||
|
* (Omega ^ (Cf.boundaryField()[patchi][patchFacei] - origin_))
|
||||||
|
& Sf.boundaryField()[patchi][patchFacei];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class RhoFieldType>
|
template<class RhoFieldType>
|
||||||
void Foam::MRFZone::makeAbsoluteRhoFlux
|
void Foam::MRFZone::makeAbsoluteRhoFlux
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user