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/)
-   -   A turbulent test case for rhoCentralFoam (https://www.cfd-online.com/Forums/openfoam-solving/110002-turbulent-test-case-rhocentralfoam.html)

immortality December 2, 2012 17:38

A turbulent test case for rhoCentralFoam
 
can anyone send me the pdf file that creators of rhoCentralFoam have provided?
do you know a turbulent test case of this solver?

Traib December 3, 2012 01:58

Hi,

I too was looking for turbulent test cases for various density-based solvers. I have tried creating the cases myself by modifying the cases like forwardStep and wedge15Ma5- they seem to work just fine, except for one problem with rhoCentralFoam that the standard k-e didn't work in some cases but RNG k-e worked for all. I had only recently read a paper about the comparison between realizable and RNG k-e models and they it suggested RNG k-e to be better for density based solvers and high-velocity flows. Other than that, I have been trying to learn why the case with rhoCentralFoam but I haven't found anything yet, seems very bizzare to me.

What I did was modified boundary conditions, added k, epsilon, mut, and alphat initial conditions, chose turbulence model, and made changes in fvschemes file for discretizations of turbulent terms.

The results for single-species flows seem to work well, but when I tried with multi-species equilibrium as well as non-equilibrium flows using combustion-density based solver I have been meeting lots of problems, which makes me think I could be missing something. I've studied the codes for these solvers and related functions, but can't see things that I am missing- its like searching for something without knowing what that something is:confused::(...

So anyone know more about this, please help.

immortality December 3, 2012 04:21

hi
have you tried kOmegaSST to this solver?is this model suitable or RNG k-e is better?could you send me the article?
Im beginner in openfoam.can you send me one of your cases to me that i understand what changes i should do in fvschemes and fvsolution especially.
Thank you.

Traib December 3, 2012 06:21

Hi,

I am new to OPenFOAM too so I am afraid my answers might not be completely helpful to you.

I haven't worked with k-omega in OpenFOAM, but its not very different from k-e while setting up. Basically, the only difference is the parameters in the turbulence equations which are by default given with the model, while in your case you can modify using omega instead of epsilon.

About setting up a case, see the below for fvschemes and fvsolution. I had once checked discretizations required for several solvers and these are from those cases. However I should mention that I did waste some time of listing these which is quite unnecessary.

If you want to know what discretizations are required you can check the source code of the solvers and find out directly; in case you miss any the error message in the terminal window will clearly mention which discretizations are undefined.

Similarly, while setting up the case if you have missed any dictionary or initial conditions then those will also appear in their respective error messages in the terminal window. So its quite simple to figure out.

===== fvschemes dictionary for rhoCentralFoam =====

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

// listed all the required discretization fields required in
// rhoCentalFoam.C along with a default (or spcific) schemes for each.
// schemes were mostly arbitrarily chosen for a turbulent viscous flow case.

fluxScheme Kurganov;

ddtSchemes
{
default Euler;
//ddt(rho) Euler;
//ddt(rhoU) Euler;
//ddt(rhoE) Euler;
//ddt(rho,U) Euler;
//ddt(rho,e) Euler;
}

gradSchemes
{
default Gauss linear;

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(T) Gauss linear;
grad(epsilon) Gauss linear;
grad(k) Gauss linear;
}

divSchemes
{
default Gauss linear;
div(tauMC) Gauss linear;

div(phi) Gauss linear;
div(phi,epsilon) Gauss linear;
div(phi,k) Gauss linear;
div(phiEp) Gauss linaer;
div(phiUp) Gauss linear;
div(sigmaDotU) Gauss linear;
}

laplacianSchemes
{
default Gauss linear corrected;

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,epsilon) Gauss linear corrected;
laplacian(DkEff,k) Gauss linear corrected;

}

interpolationSchemes
{
default linear;
reconstruct(rho) vanLeer;
reconstruct(U) vanLeerV;
reconstruct(T) vanLeer;

interpolate(rho) linear;
interpolate(U) linear;
interpolate(T) linear;
interpolate(e) linear;
interpolate(c) linear;
interpolate(rhoU) linear;
interpolate(rPsi) linear;
interpolate(muEff) linear;
interpolate(tauMC) linear;
}

snGradSchemes
{
default corrected;

snGrad(U) corrected;

}


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

Traib December 3, 2012 06:24

=========== example fvsolution dictionary for rhoCentralFoam======

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

// example solvers

solvers
{
"(rho|rhoU|rhoE)"
{
solver diagonal;
}

U
{
solver smoothSolver;
smoother GaussSeidel;
nSweeps 2;
tolerance 1e-09;
relTol 0;
}

e
{
$U;
tolerance 1e-10;
relTol 0;
}

"(k|epsilon)"
{
solver smoothSolver;
smoother GaussSeidel;
nSweeps 2;
tolerance 1e-09;
relTol 0;
}


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

immortality December 3, 2012 13:42

thank you dear Traib.I used them and now works.but all of density terms rho,rhoUx,rhoUy are zero.seems it doesn't solve continuity equation or anything like this.whats your nice suggestion?
thank you again.

Traib December 5, 2012 04:56

Hi ehsan,

Sorry I do now know what you mean by "terms rho,rhoUx,rhoUy are zero"- where is this, is it in the solution you mean?

About the continuity, rhoCentraLFoam does solve for continuity, see below:

00178 // --- Solve density
00179 solve(fvm::ddt(rho) + fvc::div(phi));
00180

----taken from rhoCentralFoam.C of the solver source codes directory. You should check the source codes for these info. The momentum and inviscid equations are solved differently for inviscid and viscous cases.

About rho,rhoUx and rhoUy being zero, I am not sure what you mean but if you can explain a bit I can try to check...

Regards.

immortality December 5, 2012 05:46

yes I mean in the solution.rho terms are zero at all the time steps.my initial condition is zero pressure and temperature because I want a channel become full during time(from empty obviously) is my approach incorrect?
and can I use rho field in my boundary conditions to define other fields in groovyBC?

Traib December 5, 2012 06:40

You can try giving some internalField value at first and the later solution can be initialized from the actual values you give in the inlet;

immortality December 5, 2012 07:28

as an instance look at this time step:

Mean and max Courant Numbers = 0.140537 0.296461
deltaT = 1.31579e-07
Time = 4.86842e-06

diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal: Solving for rhoUx, Initial residual = 0, Final residual = 0, No Iterations 0
diagonal: Solving for rhoUy, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver: Solving for Ux, Initial residual = 1.13168e-05, Final residual = 2.04904e-17, No Iterations 3
smoothSolver: Solving for Uy, Initial residual = 0.00894171, Final residual = 1.97135e-17, No Iterations 3
diagonal: Solving for rhoE, Initial residual = 0, Final residual = 0, No Iterations 0
smoothSolver: Solving for e, Initial residual = 1.43136e-05, Final residual = 1.55745e-10, No Iterations 201
smoothSolver: Solving for omega, Initial residual = 0.000587127, Final residual = 1.92363e-11, No Iterations 2
smoothSolver: Solving for k, Initial residual = 0.00730572, Final residual = 1.34671e-10, No Iterations 2
ExecutionTime = 38.88 s ClockTime = 58 s

immortality January 9, 2014 16:24

Hi dear Traib
my work have been finished since 4 months ago,I had a look into log of the solution and encountered this question again. did you find out why rho residuals are zero while in rhoCentralFoam, density should obtain from continuity equation? only because it has been written in explicit form,right?

Endel March 18, 2014 07:25

Hi!

I'm getting the exact same error as Immortality: in the log-file all rho*-residuals and number of iterations are 0.

Do you have a solution to this yet?

maHein March 18, 2014 12:56

It is not an error. The fields rho, rhoU and rhoE are solved using an explicit time marching algorithm (1st order Euler). Therefore, no iterations are needed.

See also in the source code:

Code:

solve(fvm::ddt(rho) + fvc::div(phi));
The change of density in a cell for each time step is simply the diverence of the fluxes over the cell faces.

Regards

sathya123 April 20, 2014 06:32

Quote:

Originally Posted by immortality (Post 469329)
Hi dear Traib
my work have been finished since 4 months ago,I had a look into log of the solution and encountered this question again. did you find out why rho residuals are zero while in rhoCentralFoam, density should obtain from continuity equation? only because it has been written in explicit form,right?

Hello, my name is Sathyanarayanan, I was reading your post where you were requesting turbulent test cases in rhoCentralFoam. Were you successful in creating a test case with turbulence?
I am currently working on understanding the hypersonic flow through the inlet of a scramjet at freestream velocity of mach 4. I used a kepsilon model, but did now obtain the expected shocks at the forecowl region,
Would it be possible for you to provide me a sample tutorial with turbulence in rhoCentralFoam?


All times are GMT -4. The time now is 07:21.