CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Momentum predictor UEqn.H (https://www.cfd-online.com/Forums/openfoam-programming-development/232192-momentum-predictor-ueqn-h.html)

nikhil108 December 3, 2020 12:44

Momentum predictor UEqn.H
 
Hallo Foamers,

I have a small doudt. In UEqn.H, in solvers where momentum predictor setting exists in pimple loop. If momentum predictor is set to no then the Right-hand side of the momentum equation is not solved (skipped because of if loop). But, I dont understand, in any case, we need to solve whole momentum equation to get U right? . Why we skip gravity and dp term ? what does this mean :confused:
Code:

    tmp<fvVectorMatrix> tUEqn
    (
        fvm::ddt(rho, U) + fvm::div(phi, U)
      + MRF.DDt(rho, U)
      + turbulence->divDevTau(U)
      ==
        fvOptions(rho, U)
    );
    fvVectorMatrix& UEqn = tUEqn.ref();
 
    UEqn.relax();
 
    fvOptions.constrain(UEqn);
 
// In here

    if (pimple.momentumPredictor())
    {
        solve
        (
            UEqn
          ==
            fvc::reconstruct
            (
                (
                  - ghf*fvc::snGrad(rho)
                  - fvc::snGrad(p_rgh)
                )*mesh.magSf()
            )
        );
 
        fvOptions.correct(U);
        K = 0.5*magSqr(U);
    }


Cyp December 4, 2020 02:50

Dear Nikhil,



When you turn off momentumPrediction, you do no solve the momentum equation.



If you look at the predictor-corrector solution algorithms used in CFD (PISO, SIMPLE, PIMPLE...), basically you do the following sequence:


- Discretize the momentum equation and form a matrix for U (optionnaly inverse this matrix to have a first guess of U)

- Form a matrix for p. This matrix depends on the coefficients of the matrix for U. Inverse the matrix for p.

- Correct the value of U point-wised based on the updated pressure field.
- Iterate until you converge.
- March in time



So, when you turn off momentumPrediction, you do update the coefficients in the matrix for U, but you do not inverse this matrix.


Cheers,
Cyprien

nikhil108 December 4, 2020 07:41

Hallo Cyprien,

Thanks for the explanation. Yah! now it's crystal clear.

cheers,
nick.


All times are GMT -4. The time now is 15:00.