mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
added Uabs function to SRF model
This commit is contained in:
@ -29,6 +29,7 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "SRFModel.H"
|
||||
#include "SRFVelocityFvPatchVectorField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -190,4 +191,54 @@ Foam::tmp<Foam::volVectorField> Foam::SRF::SRFModel::U() const
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::volVectorField> Foam::SRF::SRFModel::Uabs() const
|
||||
{
|
||||
const volVectorField Usrf = U();
|
||||
|
||||
tmp<volVectorField> tUabs
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"Uabs",
|
||||
mesh_.time().timeName(),
|
||||
mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
Usrf
|
||||
)
|
||||
);
|
||||
|
||||
// Add SRF contribution to internal field
|
||||
tUabs().internalField() += Urel_.internalField();
|
||||
|
||||
// Add Urel boundary contributions
|
||||
const volVectorField::GeometricBoundaryField& bvf = Urel_.boundaryField();
|
||||
|
||||
forAll(bvf, i)
|
||||
{
|
||||
if (isA<SRFVelocityFvPatchVectorField>(bvf[i]))
|
||||
{
|
||||
// Only include relative contributions from
|
||||
// SRFVelocityFvPatchVectorField's
|
||||
const SRFVelocityFvPatchVectorField& UrelPatch =
|
||||
refCast<const SRFVelocityFvPatchVectorField>(bvf[i]);
|
||||
if (UrelPatch.relative())
|
||||
{
|
||||
tUabs().boundaryField()[i] += Urel_.boundaryField()[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tUabs().boundaryField()[i] += Urel_.boundaryField()[i];
|
||||
}
|
||||
}
|
||||
|
||||
return tUabs;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -171,6 +171,9 @@ public:
|
||||
|
||||
//- Return velocity of SRF for complete mesh
|
||||
tmp<volVectorField> U() const;
|
||||
|
||||
//- Return absolute velocity for complete mesh
|
||||
tmp<volVectorField> Uabs() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -132,6 +132,15 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return const access to the relative flag
|
||||
const Switch& relative() const
|
||||
{
|
||||
return relative_;
|
||||
}
|
||||
|
||||
|
||||
// Mapping functions
|
||||
|
||||
//- Map (and resize as needed) from self given a mapping object
|
||||
|
||||
Reference in New Issue
Block a user