CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Addsup in fvOptions (https://www.cfd-online.com/Forums/openfoam-solving/226958-addsup-fvoptions.html)

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.

HPE May 13, 2020 16:22

Hi

- I would start looking at `src/finiteVolume/cfdTools/general/fvOptions`.

mostanad May 13, 2020 18:32

Quote:

Originally Posted by HPE (Post 770307)
Hi

- I would start looking at `src/finiteVolume/cfdTools/general/fvOptions`.

That's the key point. The connection should be provided by fvOptions.C. However, there is no sign of Addsup call in that file.


All times are GMT -4. The time now is 11:07.