Commit 383ae13a authored by Andrew Heather's avatar Andrew Heather
Browse files

added Uabs function to SRF model

parent dd0def28
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment