CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   how to modify fvScheme to converge? (http://www.cfd-online.com/Forums/openfoam-solving/111494-how-modify-fvscheme-converge.html)

 immortality January 8, 2013 11:41

how to modify fvScheme to converge?

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; } // ************************************************************************* //```

 mturcios777 January 8, 2013 13:03

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?

 immortality January 8, 2013 13:23

 immortality January 9, 2013 05:24

is upwind more stable?how to set it to fvScheme sentences?

 Traib January 9, 2013 08:28

Hi ehsan,

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

 immortality January 9, 2013 10:48

hello dear friend Traib and thank you for your nice and complete reply.
I'm working on "Wave Rotor" simulation.imagine a tube with length of .069m and .004m in height.it is 2D a rectangle like shock tube.but the smaller sides are opening to environment so that each one gradually open from wall to that environment and then wall again and again to another environment.its an interesting simple device for increasing gas turbines efficiency.however if the errors end I can end my thesis!
when used limitedVanLeer this error showed,what may be the cause.did i use
it wrong?thank you very much dear Traib.

Create mesh for time = 0

Selecting thermodynamics package ePsiThermo<pureMixture<constTransport<specieThermo <hConstThermo<perfectGas>>>>>

--> FOAM FATAL IO ERROR:
Unknown discretisation scheme limitedVanLeer

Valid schemes are :

59
(
Gamma
GammaV
LUST
MUSCL
MUSCLV
Minmod
MinmodV
OSPRE
OSPREV
Phi
QUICK
QUICKV
SFCD
SFCDV
SuperBee
SuperBeeV
UMIST
UMISTV
biLinearFit
blended
clippedLinear
cubic
cubicUpwindFit
downwind
filteredLinear
filteredLinear2
filteredLinear2V
filteredLinear3
filteredLinear3V
fixedBlended
limitWith
limitedCubic
limitedCubicV
limitedLinear
limitedLinearV
limiterBlended
linear
linearFit
linearPureUpwindFit
linearUpwind
linearUpwindV
localBlended
localMax
localMin
midPoint
outletStabilised
pointLinear
reverseLinear
skewCorrected
upwind
vanLeer
vanLeerV
weighted
)

file: /home/thesis/Desktop/WR_1/system/fvSchemes::interpolationSchemes::interpolate(rhoU) at line 84.

From function surfaceInterpolationScheme<Type>::New(const fvMesh&, Istream&)
in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C at line 82.

FOAM exiting

 immortality January 9, 2013 10:53

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<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>> 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

 mturcios777 January 9, 2013 13:55

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

 immortality January 9, 2013 14:05

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.

 immortality January 10, 2013 23:27

any idea??!!

 mturcios777 January 11, 2013 14:56

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!

 immortality January 15, 2013 12:29

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              ; }```

 mturcios777 January 15, 2013 13:15

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.

 immortality January 15, 2013 19:16

i corrected it.sorry.

 immortality January 16, 2013 09:52

any hint or comment?please say it!

 mturcios777 January 16, 2013 14:06

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:

http://www.cfd-online.com/Forums/ope...-get-help.html

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.

 All times are GMT -4. The time now is 06:41.