# how to modify fvScheme to converge?

 Register Blogs Members List Search Today's Posts Mark Forums Read

 January 8, 2013, 11:41 how to modify fvScheme to converge? #1 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,186 Rep Power: 16 hi if i want to obtain more stability for not to diverge what modifications is better to perform on fvSchemes and what schemes is better to change? my fvscheme is such: Code: ```fluxScheme Kurganov; ddtSchemes { default none; ddt(rho) Euler; ddt(rhoU) Euler; ddt(rhoE) Euler; ddt(rho,U) Euler; ddt(rho,e) Euler; ddt(rho,omega) Euler; ddt(rho,k) Euler; } gradSchemes { default none; grad(U) Gauss linear; grad(rho) Gauss linear; grad(rhoU) Gauss linear; grad((1|psi)) Gauss linear; grad(e) Gauss linear; grad(sqrt(((Cp|Cv)*(1|psi)))) Gauss linear; grad(c) Gauss linear;// grad(c) Gauss linear; grad(T) Gauss linear; grad(omega) Gauss linear; grad(k) Gauss linear; } divSchemes { default none; div(tauMC) Gauss linear; div(phi) Gauss linear; div(phi,omega) Gauss linear; div(phi,k) Gauss linear; div(phiEp) Gauss linaer;//div(phiEp) Gauss linaer; div(phiUp) Gauss linear;//div(phiUp) Gauss linear; div(sigmaDotU) Gauss linear;//div(sigmaDotU) Gauss linear; } laplacianSchemes { default none; laplacian(muEff,U) Gauss linear corrected; laplacian(alphaEff,e) Gauss linear corrected; laplacian(alpha,e) Gauss linear corrected; laplacian(k,T) Gauss linear corrected; laplacian(DepsilonEff,omega) Gauss linear corrected; laplacian(DkEff,k) Gauss linear corrected; laplacian(DomegaEff,omega) Gauss linear corrected; } interpolationSchemes { default none; reconstruct(rho) vanLeer; reconstruct(U) vanLeerV; reconstruct(T) vanLeer; interpolate(rho) linear; interpolate(U) linear; interpolate(T) linear;//interpolate(T) linear; interpolate(e) linear;//interpolate(e) linear; interpolate(c) linear;//interpolate(c) linear; interpolate(rhoU) linear; interpolate(rPsi) linear;//interpolate(rPsi) linear; interpolate(muEff) linear; interpolate(tauMC) linear; } snGradSchemes { default none; snGrad(U) corrected; } // ************************************************************************* //```

 January 8, 2013, 13:03 #2 Senior Member     Marco A. Turcios Join Date: Mar 2009 Location: Vancouver, BC, Canada Posts: 725 Rep Power: 18 It really depends on your solver, case, mesh and accuracy needs. In other words its unique to your case. What type of simulation are you running?

 January 8, 2013, 13:23 #3 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,186 Rep Power: 16 thanks.unsteady compressible one.

 January 9, 2013, 05:24 #4 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,186 Rep Power: 16 is upwind more stable?how to set it to fvScheme sentences?

 January 9, 2013, 08:28 #5 New Member   Traib Join Date: Sep 2012 Posts: 27 Rep Power: 4 Hi ehsan, How is your work going? Like Marco said, it depends largely on your particular problem. For compressible cases, linear interpolation schemes are not always applicable, while upwind schemes are generally good choices. For better convergence for scalars, you can use TVD schemes with a coefficient e.g. limitedLinear 1.0, limitedVanLeer 1.0, etc. Also, use relaxationFactors in fvSolution dictionary to control the values' changes. That's the basic, but of course mostly depends on any particular case. Sometimes you need to make sure the courant number is not too low, and of course not too high. You can try schemes other than linear interpolation schemes in divergence schemes [especially those with flux 'phi'] as well as for interpolation schemes and see how it works. Regards, Traib kiddmax, immortality and wenxu like this.

 January 9, 2013, 10:53 #7 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,186 Rep Power: 16 when I changed to limitedLinear 1.0 and limitedLinearV 1.0 an error again appeared. Code: ```fluxScheme Kurganov; ddtSchemes { default none; ddt(rho) Euler; ddt(rhoU) Euler; ddt(rhoE) Euler; ddt(rho,U) Euler; ddt(rho,e) Euler; ddt(rho,omega) Euler; ddt(rho,k) Euler; } gradSchemes { default none; grad(U) Gauss upwind; grad(rho) Gauss upwind; grad(rhoU) Gauss upwind; grad((1|psi)) Gauss upwind; grad(e) Gauss Gauss upwind; grad(sqrt(((Cp|Cv)*(1|psi)))) Gauss upwind; // grad(c) Gauss upwind; grad(T) Gauss upwind; grad(omega) Gauss upwind; grad(k) Gauss upwind; } divSchemes { default none; div(tauMC) Gauss upwind; div(phi) Gauss upwind; div(phi,omega) Gauss upwind; div(phi,k) Gauss upwind; //div(phiEp) Gauss upwind; //div(phiUp) Gauss upwind; //div(sigmaDotU) Gauss upwind; } laplacianSchemes { default none; laplacian(muEff,U) Gauss upwind; laplacian(alphaEff,e) Gauss upwind; laplacian(alpha,e) Gauss upwind; laplacian(k,T) Gauss upwind; laplacian(DepsilonEff,omega) Gauss upwind; laplacian(DkEff,k) Gauss upwind; laplacian(DomegaEff,omega) Gauss upwind; } interpolationSchemes { default none; reconstruct(rho) limitedLinear 1.0; reconstruct(U) limitedLinearV 1.0; reconstruct(T) limitedLinear 1.0; interpolate(rho) limitedLinear 1.0; interpolate(U) limitedLinearV 1.0; interpolate(T) limitedLinear 1.0; //interpolate(e) limitedLinear 1.0; //interpolate(c) limitedLinear 1.0; interpolate(rhoU) limitedLinear 1.0; //interpolate(rPsi) limitedLinear 1.0; interpolate(muEff) limitedLinear 1.0; interpolate(tauMC) limitedLinear 1.0; } snGradSchemes { default none; snGrad(U) corrected; }``` the error: Code: ```Selecting thermodynamics package ePsiThermo>>>> Reading field U --> FOAM FATAL IO ERROR: wrong token type - expected word, found on line 83 the doubleScalar 1 file: /home/thesis/Desktop/WR_1/system/fvSchemes::interpolationSchemes::interpolate(rhoU) at line 83. From function operator>>(Istream&, word&) in file primitives/strings/word/wordIO.C at line 74. FOAM exiting``` Thank you very much

 January 9, 2013, 13:55 #8 Senior Member     Marco A. Turcios Join Date: Mar 2009 Location: Vancouver, BC, Canada Posts: 725 Rep Power: 18 Ehsan, these errors occur either because OpenFOAM does not recognize the scheme you have selected and is offering alternatives. Trying to select randomly from previous ones won't be of much use, so it is best to be systematic. It seems you are quite new to CFD in general and OpenFOAM in particular, which is fine. That just means you have to work a little harder to understand the underlying theory. CFD Online has a list of good resources, including online courses in CFD http://www.cfd-online.com/Links/educ...#onlinecourses Traib and cts like this.

 January 9, 2013, 14:05 #9 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,186 Rep Power: 16 thanks dear Marco.what are you meaning?! I just changed second order terms into first order upwind.please say more speciefic what terms are incorrect or could be better to change?change to what?I want more stability. thank you very much taking your time.

 January 10, 2013, 23:27 #10 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,186 Rep Power: 16 any idea??!!

 January 11, 2013, 14:56 #11 Senior Member     Marco A. Turcios Join Date: Mar 2009 Location: Vancouver, BC, Canada Posts: 725 Rep Power: 18 Unfortunately I can't advise you further as tuning your fvSchemes would require me to see your results over several runs, which I don't have time for and would be difficult through the forum. This is one of those areas where research and experience come into play. You'll have to do some reading; start here: http://en.wikipedia.org/wiki/Numeric...tial_equations Good luck!

 January 15, 2013, 12:29 #12 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,186 Rep Power: 16 my fvScheme is as below.please anyone say to me what schemes is better to change (to upwind for example) for more stability.may case is unstedy and compressible and the solver is rhoPimpleFoam.its a tube with varying with time side boundary conditions. thank you. Code: ```FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ddtSchemes { default Euler; } gradSchemes { default Gauss linear; grad(p) Gauss linear; } divSchemes { default none; div(phi,U) Gauss limitedLinearV 1; div(phid,p) Gauss limitedLinear 1; div(phi,K) Gauss linear; div(phi,h) Gauss limitedLinear 1; div(phi,k) Gauss limitedLinear 1; div(phi,epsilon) Gauss limitedLinear 1; div(phi,R) Gauss limitedLinear 1; div(phi,omega) Gauss limitedLinear 1; div((rho*R)) Gauss linear; div(R) Gauss linear; div(U) Gauss linear; div((muEff*dev2(T(grad(U))))) Gauss linear; div(tauMC) Gauss linear; } laplacianSchemes { default none; laplacian(muEff,U) Gauss linear corrected; laplacian(mut,U) Gauss linear corrected; laplacian(DkEff,k) Gauss linear corrected; laplacian(DepsilonEff,epsilon) Gauss linear corrected; laplacian(DREff,R) Gauss linear corrected; laplacian(DomegaEff,omega) Gauss linear corrected; laplacian((rho*(1|A(U))),p) Gauss linear corrected; laplacian(alphaEff,h) Gauss linear corrected; laplacian(k,T) Gauss linear corrected; laplacian(alpha,e) Gauss linear corrected; laplacian(alphaEff,e) Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } fluxRequired { default no; p ; }``` Last edited by immortality; January 15, 2013 at 13:30.

 January 15, 2013, 13:15 #13 Senior Member     Marco A. Turcios Join Date: Mar 2009 Location: Vancouver, BC, Canada Posts: 725 Rep Power: 18 Ehsan, your CODE tags are not working properly. To see how they are supposed to work, select a portion of the post you want to enclose in code, then select the formatting button with a # symbol. The tooltip that should come up is "Wrap [CODE] tags around selected text". Right now it is not appearing properly.

 January 15, 2013, 19:16 #14 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,186 Rep Power: 16 i corrected it.sorry.

 January 16, 2013, 09:52 #15 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,186 Rep Power: 16 any hint or comment?please say it!

 January 16, 2013, 14:06 #16 Senior Member     Marco A. Turcios Join Date: Mar 2009 Location: Vancouver, BC, Canada Posts: 725 Rep Power: 18 Ehsan, asking for replies does not mean you will receive them sooner. There are rules of etiquiette that should be followed. I know you are in a difficult situation, but by following good practice the chances of getting a good answer are greatly enhanced: How to give enough info to get help If you look into what the schemes available are (check the user guide section 4.4), you will be able to make better decisions about the type of schemes you should be choosing. However, you should make sure that it isn't your boundary conditions or initial conditions that are causing problems. It is very dependant on your case setup, mesh, and the physics you are simulating. If you treat CFD like a black box, you will spend a lot of time frustrated at what seem like random errors and difficulties. Learn the underlying framework and things will make more sense. Metti and wenxu like this.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Ganesh FLUENT 13 January 22, 2014 05:11 matteoL OpenFOAM Running, Solving & CFD 2 July 27, 2011 18:31 SSL FLUENT 2 January 26, 2008 12:55 MANOJ KUMAR FLUENT 5 September 22, 2005 04:16 Jen FLUENT 4 July 20, 2005 16:52

All times are GMT -4. The time now is 05:23.