CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   Problem in fvschemes divSchemes cannot use Gauss linearUpwind (https://www.cfd-online.com/Forums/openfoam-bugs/62534-problem-fvschemes-divschemes-cannot-use-gauss-linearupwind.html)

nico765 October 18, 2007 09:57

Hello, Looking at the UserG
 
Hello,

Looking at the UserGuide, it's something I should be able to do.
I want to use the linear Upwind scheme for div(phi,U).

Using simpleFoam in Openfoam 1.4.1 on linux 64bit.


div(phi,U) Gauss linear;
div(phi,U) Gauss linear corrected;
div(phi,U) Gauss QUICK;

works fine. But

div(phi,U) Gauss linearUpwind;

does not.



I get:

--> FOAM FATAL IO ERROR : Grad scheme not specified

Valid grad schemes are :

8
(
cellMDLimited
extendedLeastSquares
faceMDLimited
leastSquares
fourth
faceLimited
cellLimited
Gauss
)


file: /home/nr/OpenFOAM/nrousselon-1.4.1/run/ccm2foam4/system/fvSchemes::div(phi,U) at line 40.

From function gradScheme<type>::New(Istream& schemeData)
in file /home/nr/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/gradScheme.C at line 65.

FOAM exiting








/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.4 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

FoamFile
{
version 2.0;
format ascii;

root "";
case "";
instance "";
local "";

class dictionary;
object fvSchemes;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
default steadyState;
}

gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
grad(U) Gauss linear;
}

divSchemes
{
default none;
div(phi,U) Gauss linear corrected;
div(phi,k) Gauss upwind;
div(phi,epsilon) Gauss upwind;
div(phi,R) Gauss upwind;
div(R) Gauss linear;
div(phi,nuTilda) Gauss upwind;
div((nuEff*dev(grad(U).T()))) Gauss linear;
}

laplacianSchemes
{
default none;
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
laplacian(DREff,R) Gauss linear corrected;
laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
}

interpolationSchemes
{
default linear;
interpolate(U) linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p;
}


// ************************************************** *********************** //

henry October 18, 2007 10:13

You need to specify the grad-s
 
You need to specify the grad-scheme used by linearUpwind, e.g.

div(phi,U) Gauss linearUpwind Gauss linear;

or

div(phi,U) Gauss linearUpwind leastSquares;

or if you want to limit the gradient used by the linearUpwind scheme which is often beneficial

div(phi,U) Gauss linearUpwind cellLimited Gauss linear 1;

etc.

nico765 October 24, 2007 07:18

Thanks, just what I needed.
 
Thanks,

just what I needed.

Nicolas

sErik January 18, 2010 09:45

I have the same problem and tried to adapte it on my case with the bouyantBoussinesqSimpleFoam, but it didn't work.
This is what I get:
Quote:

...

Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
sigmaEps 1.3;
}

Calculating field beta*(g.h)


Starting time loop

Time = 5e-07



attempt to read beyond EOF

file: /home/fa1/OpenFOAM/eschirach/run/buoyantBoussinesqSimpleFoam/BMW_Zulauf_klein/system/fvSchemes::gradSchemes::default at line 25.

From function ITstream::read(token& t)
in file db/IOstreams/Tstreams/ITstream.C at line 84.

FOAM exiting
Line 25 is the one with the default gradSchemes. My fvSchemes file is:
Quote:

ddtSchemes
{
default steadyState;
}

gradSchemes
{
default Gauss linearUpwind;
}

divSchemes
{
default none;
div(phi,U) Gauss linearUpwind Gauss cellLimited linear 1;
div(phi,T) Gauss linearUpwind Gauss cellLimited linear 1;
div(phi,k) Gauss linearUpwind Gauss cellLimited linear 1;
div(phi,epsilon) Gauss linearUpwind Gauss cellLimited linear 1;
div(phi,R) Gauss linearUpwind Gauss cellLimited linear 1;
div(R) Gauss linear;
div((nuEff*dev(grad(U).T()))) Gauss linear;

}

laplacianSchemes
{
default none;
laplacian(nuEff,U) Gauss linear corrected;
laplacian((1|A(U)),p) Gauss linear corrected;
laplacian(kappaEff,T) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
laplacian(DREff,R) Gauss linear corrected;
}

interpolationSchemes
{
default linearUpwind;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p ;
}

hjasak January 19, 2010 04:11

You messed up the order: cellLimited is a modifier for a gradient scheme, so it comes first. Think about which class should contain which. :)

div(phi,U) Gauss linearUpwind cellLimited Gauss linear 1;

Enjoy,

Hrv

sErik January 22, 2010 03:26

Hi Hrvoje,

thank you. Stupid mistake. Now it's running! :-)

Regards,
Erik

idrama September 26, 2010 15:55

Hello!

I got a question. Does div(phi,U) Gauss linearUpwind fourth mean that with order fourt the velocity field is approximated?

Cheers

alberto September 27, 2010 03:07

No, it means you use a fourth-order scheme to compute the gradients, but clearly the order of the linearUpwind stays unchanged.

idrama September 27, 2010 03:31

I think I have to learn something. Could you send me a reference which contains the derivation of this kind of scheme?

jms February 21, 2011 07:21

Could you please have a look at this thread I just created?
http://www.cfd-online.com/Forums/ope...fvschemes.html
thanks!

TKE November 12, 2011 10:53

fvSchemes in OF20
 
"
div(phi,U) Gauss linearUpwind Gauss linear;

or

div(phi,U) Gauss linearUpwind leastSquares;

or if you want to limit the gradient used by the linearUpwind scheme which is often beneficial

div(phi,U) Gauss linearUpwind cellLimited Gauss linear 1;

etc.[/QUOTE]"

Does anyone know, how should the same fvSchemes be set in the 2.0 version of OpenFOAM?

makaveli_lcf November 12, 2011 15:16

Hi!

Code:

gradSchemes
{
    default        cellLimited leastSquares 1;
}

divSchemes
{
    default        none;
    div(phi,epsilon) Gauss linearUpwind grad(epsilon);  // OF20x syntax
    div(phi,k)      Gauss linearUpwind grad(k);  // OF20x syntax
    div(phi,U)      Gauss linearUpwind grad(U);  // OF20x syntax
    div((nuEff*dev(T(grad(U)))))    Gauss linear;  // OF20x syntax
}

My example which I use with pimpleFoam.

fippo_dk November 14, 2011 12:16

Could you help me with this:

Implementing: laplacian(nuEff,U) Gauss linear Gauss fourth;

gives:

[0] --> FOAM FATAL IO ERROR:
[0] Unknown discretisation scheme fourth

Valid schemes are :

3
(
corrected
limited
uncorrected
)

but it should be able to work with fourth...

Thanks

alberto November 14, 2011 12:21

Quote:

Originally Posted by fippo_dk (Post 332063)
Could you help me with this:

Implementing: laplacian(nuEff,U) Gauss linear Gauss fourth;

gives:

[0] --> FOAM FATAL IO ERROR:
[0] Unknown discretisation scheme fourth

Valid schemes are :

3
(
corrected
limited
uncorrected
)

but it should be able to work with fourth...

Thanks

The correct syntax is

Gauss <scheme> <correction option>;

so

Gauss linear corrected;

For fourth-order it is:

Gauss cubic corrected;

Best,

fippo_dk November 14, 2011 13:02

Thanks Alberto for your reply

Now it is running, so I hope my solution will improve.

Thanks

Felipe

TKE November 14, 2011 16:39

Thanks
 
Dear makaveli_lcf,

Thank you for your reply!

Regards,
TKE

fippo_dk November 14, 2011 17:00

2 Attachment(s)
Hi again Alberto

Well my simulation ran, but I guess I have not achieved what I wanted.

In the attached graph I have made the simulations from 0 to 20 degrees with a step of 2 degrees with OpenFOAM and another CFD code.

I want to use the QUICK scheme, but I am over predicting my solution with OF in comparison to the other CFD code and both over predict lift in comparison to the measurements (Abbot and Doenhoff).

I have my convection terms with QUICK and the diffusion terms with second order scheme (Gauss linear corrected).

Thus I change my diffusion terms to a fourth interpolation scheme in order to improve my solution (QUICK2), and I can see that the curve is lower, but still it can not capture the separation pretty well. In this case my diffusion terms are Gauss cubic corrected.

Do you have any suggestions for improving my results?

Regards

Felipe

ps: I was going to upload the case but due to the size, it did not let allow me to do it. But I could send you a tar file with it (2.7 MB).

makaveli_lcf November 15, 2011 09:25

Which OF version do you use?

fippo_dk November 16, 2011 01:10

I use 1.7.1

makaveli_lcf November 16, 2011 02:28

Ok, because in 20x I noticed strange behavior: viscous terms are under-estimated in my case with equal settings I was simulating in v16 and 17x. I will study it in details and also report here on forum.


All times are GMT -4. The time now is 00:34.