CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   SpalartAllmaras question (https://www.cfd-online.com/Forums/openfoam-solving/57784-spalartallmaras-question.html)

pbo May 10, 2008 09:08

or maybe... Did you copy yo
 
or maybe...

Did you copy your p, U, and phi files from a simpleFoam (incompressible) case?
In which case your phi and pressure fields won't have the correct dimensions (they are divided by rho in the incompressible solvers).
Try and copy those files from the rhoTurbFoam tutorial.

dabon May 12, 2008 11:44

Hi Niels and Patrick! Thank y
 
Hi Niels and Patrick!
Thank you for the quick answer.
So far I've tried the simplest way so, as Patrick suggested, I used an initial condition derived from rhoTurbFoam and the solver seems to work indeed (at least it runs).
I didn't modify the solver, I hope it wasn't necessary.
Again, thanks a lot

Daniele

podallaire October 3, 2008 13:08

Good afternoon, I'm using t
 
Good afternoon,

I'm using the Spalart-Allmaras model with simpleFoam and I need to clarify one thing regarding the inlet BC. I'm using the "standard" approximation ( (3/2)^0.5 U Iturb len ) for inlet/freestream and I want to be sure that I'm not confused netween nut and nuTilda :

For inlet :

- nuTilda = (3/2)^0.5 U Iturb len
- nut = nuTilda / 5

Can somebody confirm that this is correct and not other way around (nut= (3/2)^0.5 U Iturb len and nuTilda = nut / 5) ?

Best regards,

PO

pbo October 3, 2008 16:14

Hi PO, nuTilda is simply a
 
Hi PO,

nuTilda is simply a 'scaled' nut, so that it is a linear function of the distance from the wall in the fully resolved inner layer (including the viscous sub-layer). Away from the wall, nuTilda matches therefore nut.
For a freestream BC in external aerodynamics, I would then specify the same values for nut and nuTilda.
As far as I am concerned, I specify 1 <= nut/nu <=10 at the freestream boundary for a fully turbulent external flow (e.g., nut = nuTilda = 5 nu).

Cheers,

Patrick

podallaire October 3, 2008 16:33

Thanks for the clarification P
 
Thanks for the clarification Patrick, for some reason I was confused with nut and nu.

Have a good week-end

PO

naveen January 2, 2009 03:04

HI EVERYONE MY SELF NAVEE
 
HI EVERYONE


MY SELF NAVEEN
i am new to openfoam cfd software i am not able to solve the naca0012 airfoil case in openfoam ..can u please help me regarding this and if u r having any tutorial based on openfoam please send me...

antonio_ing January 2, 2009 07:36

Hi Naveen this is just the
 
Hi Naveen

this is just the system directory where i have setted the properties of my solver in a very conservative way.

--------------------------------------------------
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.5 |
| \ / A nd | Web: http://www.OpenFOAM.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application simpleFoam;

startFrom startTime;

startTime 4000;

stopAt endTime;

endTime 8000;

deltaT 1;

writeControl timeStep;

writeInterval 100;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression uncompressed;

timeFormat general;

timePrecision 6;

graphFormat raw;

runTimeModifiable yes;

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

----------------------------------------------

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.5 |
| \ / A nd | Web: http://www.OpenFOAM.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
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 upwind;
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 limited 0.7;
laplacian(nu,U) Gauss linear limited 0.7;
laplacian((1|A(U)),p) Gauss linear limited 1;
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;
}

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

-----------------------------------------------

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.5 |
| \ / A nd | Web: http://www.OpenFOAM.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
p PCG
{
preconditioner DIC;
tolerance 1e-08;
relTol 0;
};

U PBiCG
{
preconditioner DILU;
tolerance 1e-08;
relTol 0;
};
k PBiCG
{
preconditioner DILU;
tolerance 1e-08;
relTol 0.1;
};
epsilon PBiCG
{
preconditioner DILU;
tolerance 1e-08;
relTol 0.1;
};
R PBiCG
{
preconditioner DILU;
tolerance 1e-08;
relTol 0.1;
};
nuTilda PBiCG
{
preconditioner DILU;
tolerance 1e-08;
relTol 0.1;
};
}
/*
k BICCG 1e-06 0;
epsilon BICCG 1e-06 0;
R BICCG 1e-06 0;
nuTilda BICCG 1e-06 0;
*/
SIMPLE
{
nNonOrthogonalCorrectors 2;
}


PISO
{
nCorrectors 1;
nNonOrthogonalCorrectors 1;
/* pRefCell 0;
pRefValue 0;*/
}

relaxationFactors
{
p 0.3;
U 0.7;
k 0.5;
epsilon 0.5;
/* R 0.7;*/
nuTilda 0.7;
}

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

actually the spalart-allmaras model uses two different files, nut and nuTilda. To have a very low freestream turbulence i have setted nut=1e-12 and nuTilda=0.077e-5.

The BC of nut and nuTilda are zero gradient everywhere but the inlet (where you put your freestream value)

I hope this will help

lakeat January 3, 2009 08:28

Hello Hi Hello Hi! Happy ne
 
Hello Hi Hello Hi!

Happy new year!

A question concerning DES.

Quote:

There I set free-stream nuTilda to 0.5*nu. I've now done the same with OF and all appears well.
May I know how to set Initial nuTilda? Why do you choose 0.5*nu?
And what about nut?

Another question, has DDES been implemented? Thanks


Daniel

antonio_ing January 4, 2009 07:26

if you look at the Spalart-All
 
if you look at the Spalart-Allmaras model you will see directly the definition of nut and nuTilda. If you want a very low freestream turbulence you can derive the simple relation

nuTilda=nu*4.349*(nut/nu)^0.25

where nu is you kinematic viscosity and the ratio nut/nuTilda is the ratio between the turbulent viscosity and the real viscosity

lakeat January 10, 2009 10:23

wow, sorry for that. Daniel
 
wow, sorry for that. Daniel

braennstroem January 12, 2009 00:44

Hi Daniel, is there a chanc
 
Hi Daniel,

is there a chance to put the model to the wiki page:
http://openfoamwiki.net/index.php/Sig_Turbulence_/_Collection_of_additional_turb ulence_models

Would be a nice start :-)
Fabian

lakeat January 12, 2009 02:56

Actually, I did nothing but co
 
Actually, I did nothing but copy SpalartAllmaras to SpalartAllmaras2, and defined a function fd(), and redifine the dTilda_ as Spalart said, Please pardon me for I really feel ashamed to put a crude code like that to the wiki.

Could anybody give me some hints on the error I met? Then the SpalartAllmaras2 will looks more stylishly. If not, the alternative for me now is to simplly copy SpalartAllmaras to SpalartAllmaras2 and do just as what I have mentioned above.

Using this SpalartAllmaras2, I calculate a flat plat with at high incidence, Re is 20000, the following are my findings:

1. I got better results using pure 2D-RANS, Spalart-Allmaras than the original reference paper. See the grid I used,
http://www.cfd-online.com/OpenFOAM_D...es/1/10602.jpg

2. I tried to mapFields to 3D-DES case, using oodles, and it took a long time to get a good Cd and Cl number, I think the 3D flow field is already set-up. So then I continue to calculate it in both methods, namely DES and DDES, and began to use fieldAverage utility. The simulation is still going now, and they are so far so good.

3. See the picture below, This is why I think a max(deltaX, deltaY, deltaZ), should be written besides cubicRootVol for the following two reasons:

a) the bad nuSgs field as the places where mesh are refined (using cubicRootVol).
b) At least some DES test cases will use Z direction mesh lenth as a simple control of "RANS region".
http://www.cfd-online.com/OpenFOAM_D...es/1/10603.jpg
http://www.cfd-online.com/OpenFOAM_D...es/1/10600.jpg
http://www.cfd-online.com/OpenFOAM_D...es/1/10604.jpg
http://www.cfd-online.com/OpenFOAM_D...es/1/10601.jpg


Any ideas?

Daniel

philippebv January 23, 2009 13:33

Daniel, It's very interesti
 
Daniel,

It's very interesting that you share your DDES implementation. I'm working on that too and I encountered some problems. Even if the modification to the Spalart-Allmaras DES model looks quite minor, it is a significant change to use the solution (mag(gradU)) in the definition of dTilda. I would be interested to see your whole spalartAllmaras2.c file because I can't compile the formulation you posted before. Maybe I missed something obvious.

How exactly did you manage to run your DDES case while you have an error message?

boger February 6, 2009 08:30

Going back to nut and nuTilda
 
Going back to nut and nuTilda for a moment... It's not clear to me why both quantities should be specified in the 0/ directory. For Spalart-Allmaras, nuTilda is the unknown variable, and nut is derived from nuTilda, right? Why are both specified as if they are independent at the boundaries?

Thanks,
David

antonio_ing February 6, 2009 09:56

Actually they give different i
 
Actually they give different informations. They are related but not the same. nut is the effective turbulent viscodity while nuTilda is the solved variable that is proportional to nut with a coefficient fv1 that is variable, depending on the strength of the turbulence compared with viscous effects (csi). You can see this directly in this site where you can see some details of the model

http://www.cfd-online.com/Wiki/Spalart-Allmaras_model

philippebv February 6, 2009 11:51

Good morning, Still, nut=nu
 
Good morning,

Still, nut=nuTilda*fv1 and fv1 is a function of nuTilda only (with nu and Cv1 being constants), so I agree with David that is seems redundant to specify both quantities at the boundaries, isn't?

Philippe

pbo February 6, 2009 13:23

I guess you specify them both
 
I guess you specify them both to have a "universal" hook-up of the turbulence models. nut is needed first because momentum equations are solved first, then turbulence quantity/ies is/are solved for after the pressure equation: if it's the SA model, you solve for nuTilda which allows you to update the nut field. You need to store both fields, nut will be needed for the next momentum predictor and nuTilda will be needed to initialize the next iterative solution of nuTilda. If you build a solver relying exclusively on the SA model, you could get away by storing only one field. However OpenFOAM standard solvers assume various turbulent models can be hooked up. The nut and nuTilda files are here for the sake of generality of the solver.

boger February 6, 2009 14:31

Thanks guys. I think what I'm
 
Thanks guys. I think what I'm hearing (here and off-line) is that it's a "simple matter of programming," as Patrick is pointing out. As to Patrick's point, I'd argue that a better "universal" way would be to never specify nut but instead to always and only specify the solution variables (k and epsilon or k and omega or nuTilda, etc.). The solvers would then need to calculate nut first from these specifications to provide for the momentum predictor.

I guess I'll need to dig into the code to see whether there's a compelling reason to do it this way. It was just bugging me to "specify" boundary conditions on a derived quantity like this.

lakeat March 12, 2009 21:54

Hi, Philippe! Morning! I di
 
Hi, Philippe! Morning!

I did not get converged with my flat plate case.
It's annoying to specify the B.C., Could you share how you set the B.C.?

I think I have finished my channelOodles with DES and DDES, and they looks fine and interpretable, so I will stop here and move to next case and IDDES (seems not very complicated).

mehulkumar March 13, 2009 05:15

Hi..friends, I am testing tur
 
Hi..friends,
I am testing turbulent subsonic(0.3Ma) viscous compressible(air) flow over an airfoil naca0012 with grid type o-topology.I am using SpalartAllmaras model for modeling turbulence.
I am confuse about the declaration of BC values for 0/nuTilda and 0/mut as well as BCtype at airfoil for the same.

Thanks for suggestion!!


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