Hi Foamers,
I have question
Hi Foamers,
I have question about running rasInterFoam with the SA model. If I set up the files using FoamX or by copying the damBreak tutorial, I get an error stating that the file "nut" is missing from the 0 directory --> FOAM FATAL IO ERROR : cannot open file file: /scratch/egp11/SPNACA2/0/nut at line 0. If I copy 0/nuTilda to 0/nut, rasInterFoam runs, but the eddy viscosity remains zero, e.g., BICCG: Solving for nuTilda, Initial residual = 0, Final residual = 0, No Iterations 0 bounding nuTilda, min: 0 max: 0 average: 0 So what am I missing? I've searched the documentation and the discussion site and was unable to find an answer. I'd appreciate any advice, Eric Paterson |
No one has run the SA model?
No one has run the SA model? I figured that I was doing something dumb, and that an answer would be easy.
Help me out, I'm still struggling through Barton and Nackman, and Karniadakis and Kirby (books on C++ for scientific and engineering computing) and am not yet able to understand all the details of how OF works, but am trying to learn by doing. Eric |
I don't know if this is an exe
I don't know if this is an exercise in self-flagelation or you're just trying to be talkative, but anyway: Dr. Paterson, what is your initial value of nut, which is the solution variable for the Spalart-Allmaras model? Is it zero? How did you expect the model to produce turbulence from initial zero nut?
See it now? Hrv |
Hrv,
No, I'm not self-flage
Hrv,
No, I'm not self-flagellating or being more talkative than normal. Yes, my initial condition is zero, and I expect the model (as with any RANS turbulence model) to produce turbulence through the production term. For the SA model, the production term is a function of the vorticity magnitude, which will be generated by the no-slip condition, and in turn produce nuTilda and nut. If OF requires nonzero nuTilda in the free-stream, then this answers my question. For problems that have practically zero free stream turbulence (e.g., modeling a ship in a towing tank), what would be the recommended initial condition? Eric |
Well, have a look at the gener
Well, have a look at the generation term in RANS model by model.
Gibson-Launder RSTM, as the most general form: volTensorField P = -(R_ & fvc::grad(U_)); Thus, for no Reynolds stress, you get no production. k-epsilon: volScalarField G = nut_*2*magSqr(symm(fvc::grad(U_))); nut_ = Cmu*sqr(k_)/(epsilon_ + epsilonSmall_); So, for zero k you get zero nut_ and zero generation. Spalart-Allmaras: Cb1*Stilda*nuTilda_ This is multiplied by nuTilda, right? So for nuTilda = 0 you get no generation. It is the same for all models. Can you tell me which term in the Spalart-Allmaras model will produce turbulence if the original state is zero? I think you have already shown that nuTilda = 0 satisfies the transport equation, which rather proves my point. Hrv |
Hrv,
Mea culpa, you are rig
Hrv,
Mea culpa, you are right. Complete brain lock on my part. I had forgotten that the production term (of SA and most other RANS models) has nuTilda in it. That's what happens when you get old, when you try to do 10 things at once, and when you spend too much time as a research manager instead of research performer. By the way, I went back and looked at the last work I had done using the SA model. There I set free-stream nuTilda to 0.5*nu. I've now done the same with OF and all appears well. Thanks for the gentle reminder, and for the patience. Eric |
Hi everybody,
since OpenFOAM-
Hi everybody,
since OpenFOAM-1.3 there is a factor fv3 introduced into the SpalartAllmaras model. It is used for scaling Stilda. I canīt find any literature about it. Can anyone tell me what this factor is about and where something is published about it? Rolando |
Hi Rolando,
I read something
Hi Rolando,
I read something about SA model and DES(SA + LES): "Multiscale and Multiresolution Approaches in Turbulence" P. Sagaut, S. Deck, M. Terracol Imperial College Press. it is written that with the initial formulation was optimise (by new fv2, and fv3) to avoid a disturb of r (when Stilda become negative) you can read also a comparaison between the two models in Deck and al. 2002 Aerospace Science and Technology Vol 6, No 3 171-183 |
Hi Cedric,
thank you very muc
Hi Cedric,
thank you very much for that information. Rolando |
Has anyone ran rhoSimpleFoam w
Has anyone ran rhoSimpleFoam with SA? After checking all my dimensions, I'm still having the following error:
Selecting turbulence model SpalartAllmaras Starting time loop Time = 1 --> FOAM FATAL ERROR : incompatible dimensions for operation [U[0 1 -2 0 0 0 0] ] + [U[1 -2 -2 0 0 0 0] ] This seems to indicate that a density term is missing. Dimensions of my Time 0 files: mut [1 -1 -1 0 0 0 0] nuTilda [0 2 -1 0 0 0 0] p [1 -1 -2 0 0 0 0] T [0 0 0 1 0 0 0] U [0 1 -1 0 0 0 0] fvSolution includes: SIMPLE { nNonOrthogonalCorrectors 0; pMin pMin [1 -1 -2 0 0 0 0] 100; } SA model in turbulenceProperties is copied from incompressible simpleFoam tutorial, adding: alphah alphah [0 0 0 0 0 0 0] 0.7; thermoPhysicalProperties includes: hThermo<puremixture<consttransport<speciethermo<hc onstthermo<perfectgas>>>>>; mixture air 1 28.9 1007 0 1.84e-05 0.7; Also tried rhoTurbFoam which generated the following error: --> FOAM FATAL ERROR : LHS and RHS of + have different dimensions dimensions : [1 -1 -3 0 0 0 0] + [0 2 -3 0 0 0 0] This also seems to indicate that a density term is missing. Thanks in advance, Doug |
nuTildaEqn dimensions in the C
nuTildaEqn dimensions in the Compressible SA C-code appear to be inconsistent.
For the Compressible SA... tmp<fvscalarmatrix> nuTildaEqn ( fvm::ddt(rho_, nuTilda_) + fvm::div(phi_, nuTilda_) ... But for the Incompressible SA... tmp<fvscalarmatrix> nuTildaEqn ( fvm::ddt(nuTilda_) + fvm::div(phi_, nuTilda_) ... I guess this may be causing the dimensions error of my previous post. Several terms in the compressible nuTildaEqn include rho, while others don't. This seems like a bug to me, but I don't know the correct compressible SA equation to fix it. Can someone with more experience confirm this observation? Offer a fix? Thanks, Doug |
The answer was to delete phi f
The answer was to delete phi from prior incompressible run. Compressible phi includes density, whereas incompressible phi does not.
|
Doug could you please provide
Doug could you please provide any information on the specific purpose of the pMin variable that is set in the fvSolution file of rhoSimpleFoam?
I am struggling to get a converged solution in rhoSimpleFoam and initially was getting 'bounding p' statements per iteration. I decreased significantly the pMin value and dropped my under relax factor on p to 0.001 as well as trying to run laminar for a 100 iterations. This seemed to remove the 'bounding p' statement after a few iterations. The laminar model aslo blew up after about 104 iterations. But I am baffled by pMin importance and how to get my solution to converge with some sort of turbulence included as well as decent under-relax factors that will not restrict the changing of the field variables too much. Any comments on your experience with pMin and rhoSimpleFoam would be great. I have posted my setup and explained the problem in a recent post to which i have had no reply yet. See the post "'bounding p' error using rhoSimpleFoam", if you like. Thanks for your time. Regards Shaun.D |
Shaun,
I found rhoSimpleFoa
Shaun,
I found rhoSimpleFoam to be very sensitive to all of the relaxation factors. As I recall, I added rho to the list of relaxation factors, and I initially set p at 0.001 or maybe 0.0001 and the others in the range of 0.01. It took several hours of babysitting the code and gradually incresing the relaxation factors after every 50 to 100 cycles. If any one factor is increased too quickly, the result became unstable and I'd restart at a prior checkpoint. I also used paraFoam to see the results, with the values of p and v being the best indicators of convergence or lack thereof. magU was also useful as an indicator of convergence. My analysis was at about Mach 0.3, and I've read elsewhere in the forum that this solver works best for subsonic flow. Good luck. Doug |
G'day Doug, thanks for the rep
G'day Doug, thanks for the reply.
Your comments make sense with what I have experienced thus far. I.e. the solver is very temperamental. Have you continued using rhoSimpleFoam since for any other cases perhaps? With pMin, do understand its function at all? Cheers and thanks for the quick response. Shaun.D |
Shaun,
I needed rhoSimpleFo
Shaun,
I needed rhoSimpleFoam for one particular task, completed the work, and have moved on. In the future I would use rhoSimpleFoam again should I need to perform a similar analysis. I never researched the definition or utility of, nor did I adjust pMin. I simply copied pMin from one of the tutorials. Doug |
Hi Shaun&Doug!
During the f
Hi Shaun&Doug!
During the first iterations of the solution process it might happen that the pressure drops below reasonable values (sometimes even belw 0!). In older versions of rhoSimpleFoam the solver aborted if the pressure fell between 0 and the user had to specify a lower under-relaxation for p. In newer versions of rhoSimpleFoam, if the pressure falls below pMin it is set to pMin and the solver resumes. Bernhard |
Thank you Bernhard for your co
Thank you Bernhard for your comments and the swiftness of your response.
Regards Shaun.D |
Hello everyone,
I`m trying to
Hello everyone,
I`m trying to use rhoSimpleFoam to solve the flow around a RAE2922 airfoil but, with any tyurbulence model or even if the turbulence model is switch off, I obtain a dimension error between LHS and RHS. I read the previous posts but I`m not able to fix my mistake. Could anyone give me a hint to proceed? Thanks a lot Daniele Exec : rhoSimpleFoam . rae2822a Date : May 09 2008 Time : 18:14:17 Host : aquila.recherche.polymtl.ca PID : 25970 Root : /home/dabon/OpenFOAM/dabon-1.4/run/tutorials/rhoSimpleFoam Case : rae2822a Nprocs : 1 Create time Create mesh for time = 0 Reading thermophysical properties Selecting thermodynamics package hThermo<puremixture<sutherlandtransport<speciether mo<hconstthermo<perfectgas>>>> > Reading field U Reading/calculating face flux field phi Creating turbulence model Selecting turbulence model LaunderGibsonRSTM Starting time loop Time = 1 --> FOAM FATAL ERROR : LHS and RHS of + have different dimensions dimensions : [0 2 -1 0 0 0 0] + [1 -1 -1 0 0 0 0] #0 Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) #1 Foam::error::abort() #2 Foam::operator+(Foam::dimensionSet const&, Foam::dimensionSet const&) #3 Foam::tmp<foam::geometricfield<foam::typeofsum<dou ble,>::type, Foam::fvPatchField, Foam::volMesh> > Foam::operator+<double,>(Foam::tmp<foam::geometric field<double,> > const&, Foam::GeometricField<double,> const&) #4 Foam::compressible::turbulenceModel::muEff() const #5 Foam::compressible::turbulenceModels::LaunderGibso nRSTM::divRhoR(Foam::Geometric Field<foam::vector<double>, Foam::fvPatchField, Foam::volMesh>&) const #6 main #7 __libc_start_main #8 __gxx_personality_v0 From function operator+(const dimensionSet& ds1, const dimensionSet& ds2) in file dimensionSet/dimensionSet.C at line 379. |
Hi Daniele
Have you modifie
Hi Daniele
Have you modified your solver? Because the error strongly suggests that you are missing rho in the nominator on the LHS or rho in the denominator on the RHS. Best regards, Niels |
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. |
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 |
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 |
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 |
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 |
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... |
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 |
Hello Hi Hello Hi!
Happy ne
Hello Hi Hello Hi!
Happy new year! A question concerning DES. Quote:
And what about nut? Another question, has DDES been implemented? Thanks Daniel |
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 |
wow, sorry for that. Daniel
wow, sorry for that. Daniel
|
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 |
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 |
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? |
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 |
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 |
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 |
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.
|
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. |
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). |
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 14:26. |