MRF: add operator() for consistency with fvOptions

This commit is contained in:
Henry
2014-05-08 11:45:12 +01:00
committed by Andrew Heather
parent 603b3e65b2
commit e481e1a05a
3 changed files with 56 additions and 3 deletions

View File

@ -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-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -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) 2012-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -160,6 +160,46 @@ void Foam::MRFZoneList::addCoriolis
} }
Foam::tmp<Foam::volVectorField> Foam::MRFZoneList::operator()
(
const volVectorField& U
)
{
tmp<volVectorField> tacceleration
(
new volVectorField
(
IOobject
(
"MRFZoneList:acceleration",
U.mesh().time().timeName(),
U.mesh()
),
U.mesh(),
dimensionedVector("0", U.dimensions()/dimTime, vector::zero)
)
);
volVectorField& acceleration = tacceleration();
forAll(*this, i)
{
operator[](i).addCoriolis(U, acceleration);
}
return tacceleration;
}
Foam::tmp<Foam::volVectorField> Foam::MRFZoneList::operator()
(
const volScalarField& rho,
const volVectorField& U
)
{
return rho*operator()(U);
}
void Foam::MRFZoneList::makeRelative(volVectorField& U) const void Foam::MRFZoneList::makeRelative(volVectorField& U) const
{ {
forAll(*this, i) forAll(*this, i)

View File

@ -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) 2012-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -102,6 +102,19 @@ public:
//- Add the Coriolis force contribution to the momentum equation //- Add the Coriolis force contribution to the momentum equation
void addCoriolis(const volScalarField& rho, fvVectorMatrix& UEqn) const; void addCoriolis(const volScalarField& rho, fvVectorMatrix& UEqn) const;
//- Return the frame acceleration
tmp<volVectorField> operator()
(
const volVectorField& U
);
//- Return the frame acceleration force
tmp<volVectorField> operator()
(
const volScalarField& rho,
const volVectorField& U
);
//- Make the given absolute velocity relative within the MRF region //- Make the given absolute velocity relative within the MRF region
void makeRelative(volVectorField& U) const; void makeRelative(volVectorField& U) const;