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/)
-   -   How to use both 1st and 2nd order schemes for the div(phi,U) term? (https://www.cfd-online.com/Forums/openfoam-programming-development/175295-how-use-both-1st-2nd-order-schemes-div-phi-u-term.html)

ripperjack July 27, 2016 10:21

How to use both 1st and 2nd order schemes for the div(phi,U) term?
 
Hi guys,

I would like to calculate the div(phi,U) term using both 1st order scheme (i.e., Gauss upwind) and 2nd order scheme (i.e., Gauss linear) in my simulation. I know that I can define separate fields such as phi_2nd and U_2nd, and phi_1st and U_1st, and then I can set the numerical schemes for these fields separately. But if I do it this way, the memory usage will be doubled. Is there a convenient way I can do it without defining new fields? Thank you guys in advance!

Best regards,
Jack

ripperjack July 27, 2016 16:30

Quote:

Originally Posted by ripperjack (Post 611618)
Hi guys,

I would like to calculate the div(phi,U) term using both 1st order scheme (i.e., Gauss upwind) and 2nd order scheme (i.e., Gauss linear) in my simulation. I know that I can define separate fields such as phi_2nd and U_2nd, and phi_1st and U_1st, and then I can set the numerical schemes for these fields separately. But if I do it this way, the memory usage will be doubled. Is there a convenient way I can do it without defining new fields? Thank you guys in advance!

Best regards,
Jack

Hi guys,

I am very close to getting this fixed. I can read and modify the fvScheme IOdictionary at run time. However, even I change the divscheme of div(phi,U) from Gauss linear to Gauss upwind, the results do not change... I think I need to call a function to let fvc::div know that I want to use the updated div scheme. Any ideas? Thanks!

Regards,
Jack


All times are GMT -4. The time now is 12:40.