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/)
-   -   explicit calculations in OpenFOAM (https://www.cfd-online.com/Forums/openfoam-programming-development/129930-explicit-calculations-openfoam.html)

ooo February 16, 2014 12:24

explicit calculations in OpenFOAM
 
1 Attachment(s)
I'm going to implement the following equation ( from a runge kutta step) in OpenFOAM.
I'm not using the time descritizations of OpenFOAM, therefore i have problem to solve this, Im not sure whether this would be the correct form of implementation or not.
U* and laplacian(U*) in the LHS are unknown, and all of the terms in RHS are known.

solve(fvc::laplacian(nu,Unew) - Unew/(alpha*runTime.deltaTValue()) = (-1./alpha)*(U/runTime.deltaTValue() + f) + fvc::laplacian(nu,UOld))

Does this equation solves Unew same as the equation attached?
I would appreciate any suggestion.

ooo February 20, 2014 12:24

I would like to simplify my question and would appreciate any idea:
How to solve this equation where U* is unknown and U is a known volVectorField :
Laplacian(nu,U*) + U* = Laplacian(nu,U)

I get many errors regarding the solve function if i write like this :

solve (fvc::laplacian(nu,Unew) + Unew == fvc::laplacian(nu,U) )

ChrisA February 20, 2014 18:57

I'm only marginal in my understanding of how the differential stuff sets up in OF so someone can feel free to correct me... but I believe by using fvc on all the terms you're not giving solve anything to solve for? As far as I know fvc simply returns a value. Presumably Unew is also initialized as a value therefore all you have on either side of your equation is value == value, which obviously isn't going to solve. I'm thinking if you were to use fvm on the Unew laplacian and somehow include your 2nd term, Unew, into the equation as an implicit term... then solve, you'd probably be successful. There should be a way to put Unew in there I'm just not sure what as I've never had the need to look it up.

ooo February 22, 2014 07:04

Quote:

Originally Posted by ChrisA (Post 475948)
I'm only marginal in my understanding of how the differential stuff sets up in OF so someone can feel free to correct me... but I believe by using fvc on all the terms you're not giving solve anything to solve for? As far as I know fvc simply returns a value. Presumably Unew is also initialized as a value therefore all you have on either side of your equation is value == value, which obviously isn't going to solve. I'm thinking if you were to use fvm on the Unew laplacian and somehow include your 2nd term, Unew, into the equation as an implicit term... then solve, you'd probably be successful. There should be a way to put Unew in there I'm just not sure what as I've never had the need to look it up.

Thank you very much for your response.
I would appreciate also if you tell me your idea about this, using fvm::Sp(1,Unew) for including Unew in LHS...

solve (fvm::laplacian(nu,Unew) + fvm::Sp(1,Unew) == fvc::laplacian(nu,U) )


All times are GMT -4. The time now is 02:56.