How to apply a turbulence model to the rhoCentralFoam solver?
From a paper I read it found that generally rhoCentralFoam is more accurate than sonicFoam and so I intend to use that for my problem. Having looked at the tutorials for rhoCentralFoam and some information on it, none of them have turbulence models used. Is it straightforward to include a turbulence model with the rhoCentralFoam solver and if so how would I go about that? If possible could you explain with reference to one of the rhoCentralFoam tutorials such as forwardStep so that I can try it with a tutorial case.
Thanks for your help anyone. |
Anyone able to help with this?
|
Hello,
although the tutorials are only laminar / inviscid, rhoCentralFoam supports turbulence out of the box. Simply enable it in the turbulenceProperties file. Kind regards, Martin |
Quote:
I am new to the solver and OpenFOAM, If you have figured out how to do it, could you please share with me the case file or setting? |
in constant/turbulenceProperties you can change the
simulationsType: simulationsType RAS; RAS { RASModel kOmega; turbulence on; printCoeffs on; } |
Quote:
However, I dont know whether my k, nut, omega, and alphat setting is correct or wrong. Do you understand how to check whether the turbulence file setting is correct or wrong? #I am sorry for grammatical error, english is not my native language. |
please show me your 0-directory files for the turbulence properties.
|
Quote:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1812 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object alphat; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -1 0 0 0 0]; internalField uniform 0.001; boundaryField { inlet { type fixedValue; value uniform 0.001; } outlet { type inletOutlet; inletValue uniform 0.001; value uniform 0.001; } bottom { type symmetryPlane; } body { type compressible::alphatWallFunction; value uniform 0.001; } empty { type empty; } dummy { type empty; } } // ************************************************** *********************** // /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1812 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 1e-8; boundaryField { inlet { type fixedValue; value uniform 1e-8; } outlet { type waveTransmissive; value uniform 1e-8; gamma 1.4; } bottom { type symmetryPlane; } body { type kqRWallFunction; value uniform 1e-8; } empty { type empty; } dummy { type empty; } } // ************************************************** *********************** // /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1812 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object nut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { inlet { type fixedValue; value uniform 1e-5; } outlet { type waveTransmissive; value uniform 1e-5; gamma 1.4; } bottom { type symmetryPlane; } body { type nutkWallFunction; value uniform 0; } empty { type empty; } dummy { type empty; } } // ************************************************** *********************** // /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1812 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object omega; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 -1 0 0 0 0]; internalField uniform 1; boundaryField { inlet { type fixedValue; value uniform 1; } outlet { type inletOutlet; inletValue uniform 1; value uniform 1; } bottom { type symmetryPlane; } body { type omegaWallFunction; value uniform 1; } empty { type empty; } dummy { type empty; } } // ************************************************** *********************** // /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1812 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField uniform 1; boundaryField { inlet { type fixedValue; value uniform 1; } outlet { type waveTransmissive; value uniform 1; field p; gamma 1.4; phi sigmaDotU; rho rho; psi thermo:psi; lInf 0.1; fieldInf 1; } body { type zeroGradient; } empty { type empty; } dummy { type empty; } } // ************************************************** *********************** // /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1812 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; object T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 1 0 0 0]; internalField uniform 1; boundaryField { inlet { type fixedValue; value uniform 1; } outlet { type inletOutlet; inletValue uniform 1; value uniform 1; } bottom { type symmetryPlane; } body { type zeroGradient; } empty { type empty; } dummy { type empty; } } // ************************************************** *********************** // /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1812 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (3 0 0); boundaryField { inlet { type fixedValue; value uniform (3 0 0); } outlet { type inletOutlet; inletValue uniform (3 0 0); value uniform (3 0 0); } bottom { type symmetryPlane; } body { type noSlip; } empty { type empty; } dummy { type empty; } } // ************************************************** *********************** // /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1812 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSchemes; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // fluxScheme Kurganov; ddtSchemes { default Euler; } gradSchemes { default Gauss linear; } divSchemes { default none; div(phi,U) bounded Gauss linearUpwind limited; div(tauMC) Gauss linear; div(phi,omega) Gauss linear; div(phi,k) Gauss linear; } laplacianSchemes { default none; laplacian(muEff,U) Gauss linear corrected; laplacian(alphaEff,e) Gauss linear corrected; laplacian((rho*DomegaEff),omega) Gauss linear corrected; laplacian((rho*DkEff),k) Gauss linear corrected; } interpolationSchemes { default linear; reconstruct(rho) vanLeer; reconstruct(U) vanLeerV; reconstruct(T) vanLeer; } snGradSchemes { default corrected; } wallDist { method meshWave; //Poisson; //advectionDiffusion; //exactDistance; } // ************************************************** *********************** // /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1812 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvSolution; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // solvers { "(rho|rhoU|rhoE)" { solver diagonal; } U { solver smoothSolver; smoother GaussSeidel; nSweeps 2; tolerance 1e-09; relTol 0.01; } h { $U; tolerance 1e-10; relTol 0; } e { $U; tolerance 1e-10; relTol 0; } omega { $U; tolerance 1e-10; relTol 0; } k { $U; tolerance 1e-10; relTol 0; } } // ************************************************** *********************** // |
for alphat:
try for all: type calculated; value uniform 0; except for symmetry plane: type symmetry; how did you come up with 1e-8 for k ? how did you come up with 1 for omega? for nut: change every type to: type calculated; value uniform 0; except for walls: type nutkWallFunction; value uniform 0; and symmetry planes: type symmetry; |
Quote:
I will try to change the setup, many thanks for your guidance. About the value of k and omega, they were my dumb guess value. I was commercial CFD software user who always pick up default value from the software so my understanding about turbulence value is still shallow. Would you mind to give me suggestion about some reference about "how to define the value of k and omega for different Mach number regimes"? I would really appreciate it Sir. :) |
https://www.cfd-online.com/Wiki/Turb...ary_conditions
here is everything you need to know. make sure that when you are starting the simulation your time step is small. increase your time step gradually. in your controlDict make these changes: adjustTimeStep yes; maxCo 1; //or any other number thats also ok maxDeltaT 0.01; //optionally you can limit your max delta time step |
Quote:
I will try another case of rhoCentralFoam by following your guidance. [emoji1] |
Quote:
Hello Sir, I have succeeded to implement the kw-SST in rhoCentralFoam and the simulation was run without error. However, eventhough I implemented "noSlip" boundary condition at wall with boundary layer mesh, the velocity at wall remains non-zero. :confused: Do you know where to spot the problem Sir? I will upload the case file if someone still interested in this case. |
yeah i know what you mean.
if you choose the "no slip"-condition i can assure you that openfoam takes it into consideration when calculation the velocity field. the problem is that paraview might have problems displaying it bc it doesn't consider the no-slip condition. you can translate your simulation to VTK by executing: foamToVTK -latestTime a new directory with vtk-files will be created. you can open it now and you will see your 0-velocity at boundaries correctly. |
Quote:
no problem, I have resolved it. It is due to post processing file format read by Paraview. I am using WSL and open the post processing file in xx.foam format. I found in this forum that the post processing format should be converted into VTK by "foamToVTK" command before it's processed using Paraview. |
Quote:
yes. many thanks! *sorry my website page is late refreshed and i have just noticed your reply after my post. |
Hey Febriyan! I have been trying to simulate the same thing as you, however I get the following error:
Mean and max Courant Numbers = nan nan I get this only when I impose the turbulence model k-Omega. Any idea how to resolve this? Thanks in advance! |
error in rhocentralFoam turbulence modeling (RAS)
Quote:
|
error in rhocentralFoam turbulence modeling (RAS)
this is my cases plzz any one help me
FoamFile { version 2.0; format ascii; class volScalarField; object alphat; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -1 0 0 0 0]; internalField uniform 0; boundaryField { INLET { type fixedValue;//calculated; value uniform 0; } OUTLET_2 { type inletOutlet;//zeroGradient;//calculated;//inletOutlet;//calculated; inletValue uniform 0; value uniform 0; } OUTLET { type inletOutlet;//zeroGradient;//calculated; //inletOutlet;//calculated; inletValue uniform 0; value uniform 0; } WALL_1 { type compressible::alphatWallFunction; value uniform 0; } WALL_NOZZLE { type compressible::alphatWallFunction; value uniform 0; } WALL_2 { type compressible::alphatWallFunction; value uniform 0; } } FoamFile { version 2.0; format ascii; class volScalarField; object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField uniform 3.75e-9; boundaryField { INLET { type fixedValue; value uniform 3.75e-9; } OUTLET_2 { type waveTransmissive;//inletOutlet;//waveTransmissive;//inletOutlet; value uniform 1.50000000000000002e-16; gamma 1.4; } OUTLET { type waveTransmissive;//inletOutlet;//waveTransmissive;//inletOutlet; value uniform 3.75e-9; gamma 1.4; } WALL_1 { type kqRWallFunction; value uniform 3.75e-9; } WALL_NOZZLE { type kqRWallFunction; value uniform 3.75e-9; } WALL_2 { type kqRWallFunction; value uniform 3.75e-9; } } FoamFile { version 2.0; format ascii; class volScalarField; object nut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -1 0 0 0 0]; internalField uniform 0; boundaryField { INLET { type fixedValue;//calculated; value uniform 0; } OUTLET_2 { type waveTransmissive;//waveTransmissive;//calculated; value uniform 0; gamma 1.4; } OUTLET { type waveTransmissive;//calculated; value uniform 0; gamma 1.4; } WALL_1 { type nutkWallFunction; value uniform 0; } WALL_NOZZLE { type nutkWallFunction; value uniform 0; } WALL_2 { type nutkWallFunction; value uniform 0; } } FoamFile { version 2.0; format ascii; class volScalarField; object omega; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 -1 0 0 0 0]; internalField uniform 3.194e-5; boundaryField { INLET { type fixedValue; value uniform 3.194e-5; } OUTLET_2 { type inletOutlet;//inletOutlet; inletValue uniform 3.194e-5; value uniform 3.194e-5; } OUTLET { type inletOutlet;//zeroGradient;//inletOutlet; inletValue uniform 3.194e-5; value uniform 3.194e-5; } WALL_1 { type omegaWallFunction; value uniform 3.194e-5; } WALL_NOZZLE { type omegaWallFunction; value uniform 3.194e-5; } WALL_2 { type omegaWallFunction; value uniform 3.194e-5; } } FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField uniform 101325; boundaryField { INLET { type fixedValue;//totalPressure; //rho none; //psi thermo:psi; //gamma 1.4; //p0 uniform 225000; value uniform 225000;//$internalField; } WALL_1 { type zeroGradient; } WALL_NOZZLE { type zeroGradient; } WALL_2 { type zeroGradient; } OUTLET_2 { type waveTransmissive;//fixedValue; value uniform 101325; field p; gamma 1.4; phi sigmaDotU; rho rho; psi thermo:psi; lInf 1; fieldInf 101325; } OUTLET { type waveTransmissive;//fixedValue; value uniform 101325; field p; gamma 1.4; phi sigmaDotU; rho rho; psi thermo:psi; lInf 1; fieldInf 101325; } } FoamFile { version 2.0; format ascii; class volScalarField; location "0"; object T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 1 0 0 0]; internalField uniform 298.15; boundaryField { INLET { type fixedValue; value uniform 298.15; } WALL_1 { type zeroGradient; } WALL_NOZZLE { type zeroGradient; } WALL_2 { type zeroGradient; } OUTLET_2 { type inletOutlet; inletValue uniform 274; value uniform 274; } OUTLET { type inletOutlet; inletValue uniform 274; value uniform 274; } } FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { INLET { type fixedValue; value uniform (0.001 0 0); } WALL_1 { type noSlip; } WALL_NOZZLE { type noSlip; } WALL_2 { type noSlip; } OUTLET_2 { type inletOutlet; inletValue uniform (0.001 0 0); value uniform (0.001 0 0); } OUTLET { type inletOutlet; inletValue uniform (0.001 0 0); value uniform (0.001 0 0); } } |
All times are GMT -4. The time now is 02:39. |