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/)
-   -   Adding an implicit gradient term (https://www.cfd-online.com/Forums/openfoam-programming-development/243768-adding-implicit-gradient-term.html)

openfoam_aero July 5, 2022 08:19

Adding an implicit gradient term
 
2 Attachment(s)
Dear FOAMers,

I have a question regarding the implicit gradient.

Here is my system of equations that I wish to solve
Attachment 90588

I have the solve for u^dagger and the quantity \Tilde{u} is known.

I am doing this using a modified SIMPLE algorithm (by playing around with the simpleFoam solver).

Here is the code that I have implemented

Code:

fvVectorMatrix UEqn
        (
                //Laplacian term 4th term from left on the L.H.S of the equation 1
                - (fvm::laplacian(nu,UDagger))
               
                //1st term from left on the L.H.S. of the equation 1
                - fvm::div(phi, UDagger) + fvm::SuSp(fvc::div(phi), UDagger)
               
                //2nd term from left on the L.H.S of the equation 1
                + (UDagger & T(fvc::grad(U1))) 
       
        );

My question is, is the term
Attachment 90589

to be treated implicitly or explicitly? If it has to be treated implicity, how do I make a conversion just the way I did for the second term in fvVectorMatrix?

Santiago July 5, 2022 10:37

Quote:

Originally Posted by openfoam_aero (Post 831020)
My question is, is the term
Attachment 90589

to be treated implicitly or explicitly?

You can write that term as div(U*U), then you dont have to deal with "implicit gradients" which, BTW, produce matrices that cannot be inverted.

openfoam_aero July 5, 2022 10:42

Quote:

Originally Posted by Santiago (Post 831027)
You can write that term as div(U*U), then you dont have to deal with "implicit gradients" which, BTW, produce matrices that cannot be inverted.

Thank you very much for your suggestion Satiago.

But please help me understand this a little better. The term is u.grad(udagger)^T

How is this converted into div(U*U)? I would have to use fvm::div(flux, unknown) in that case but I am not sure if that is equivalent to the term u.grad(udagger)^T
What do you think?


All times are GMT -4. The time now is 22:52.