mostanad |
May 13, 2020 01:56 |
Addsup in fvOptions
Hi all,
I am working with one of the solvers in OpenFOAM, which is using fvOptions and more specifically, meanVelocitySource.C. However, there are some things that are not clear to me. As you can see in the solver discretization part:
Code:
fvVectorMatrix UEqn
(
fvm::ddt(U) //fvm::ddt(voidfraction,U)
+ fvm::div(phi, U)
+ turbulence->divDevReff(U)
==
fvOptions(U)
);
In this case, the fvOptions is called on the right hand side of the equation. However, I detected that by calling in such this way, the Addsup in the meanVelocitySource.C file is called. You can see the function for this source term in the lines 190-226.
Code:
void Foam::fv::meanVelocityForce::addSup
(
fvMatrix<vector>& eqn,
const label fieldi
)
{
volVectorField::Internal Su
(
IOobject
(
name_ + fieldNames_[fieldi] + "Sup",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
mesh_,
dimensionedVector("zero", eqn.dimensions()/dimVolume, Zero)
);
scalar gradP = gradP0_ + dGradP_;
UIndirectList<vector>(Su, cells_) = flowDir_*gradP;
eqn += Su;
}
void Foam::fv::meanVelocityForce::addSup
(
const volScalarField& rho,
fvMatrix<vector>& eqn,
const label fieldi
)
{
this->addSup(eqn, fieldi);
}
So the problem is with the link between these two parts. How by calling fvOptions(U) in the momentum equation, the Addsup function is called.
Any help in this regard would be appreciated.
|