|
[Sponsors] |
September 20, 2017, 06:52 |
Favre or Reynolds Average in OpenFOAM?
|
#1 |
Senior Member
Join Date: Oct 2015
Location: Germany
Posts: 100
Rep Power: 11 |
Dear FOAMers,
I'm a bit confused. I cannot determine exactly whether OpenFOAM uses Reynolds (RANS) or Favre averaging (FANS) when performing compressible 'RAS' simulations. The OpenFOAM terminology clearly implies it's RANS, so the turbulent fluctuations are not density-normalised. This assumption proves reasonable for many compressible flows (and thus would fit my needs) but not unconditionally for supersonic flows or such including combustion etc. Instead, rationality suggests OpenFOAM solves FANS since (to my knowlegde) its 'RAS' models are applicable to incompressible as well as compressible cases with no need for any user interaction. Or does OpenFOAM choose the best suited approach by itself based on solver conditioning (fvSolution) or else? I searched the forum and the source but did not find a clear answer. Any help is appreciated. Regards and thanks in advance |
|
November 24, 2017, 16:27 |
Favre or Reynolds Average in OpenFOAM?
|
#2 |
New Member
Patrick H.
Join Date: Aug 2017
Location: Germany
Posts: 3
Rep Power: 9 |
Hello NablaDyn,
This is a question wich i ask myself a lot in the last time. So I am also really interested in the 'right' answer and i already think i did some progress in it. Well I think the problem with the compressible Reynolds-averaged-Navier-Stokes-Equations is, if they are averaging is done with the time averaging: and the splitting into: , the resulting equations are very unhandy because of the products of fluctuations between density and othe variables like the velocity (c.f. [1], p.91). This is shown as example in [2] for the continunity equation in index notation (c.f. [2], p.100): . The equations for the momentum and e.g. the total energy will much more complex. Beacause of this a density-weighted averaged is introduced (c.f. e.g. [1], p.91): and . This leads to the following equations without sources and body forces in index notation (c.f. [3], Equations (12), (13) and (14)): Continunity equation: Momentum equation: Total energy: . (You can also find these equations in [1], p.92 (without total energy equation) and in [4], p.176) These equations are called Favre-averaged Navier-Stokes equations but are also termed as compressible Reynolds-averaged Navier-Stokes equations (c.f. [5]). As shown in [3], after some assumptions the equations can be written as: , where . In tensor notation it should be: (1) (2) (3) (4) (5) . (6) Im looking on sonicFoam of OpenFOAM 4.1, which is a solver forr trans-sonic/supersonic, turbulent flow and there is first the continunity equation solved in rhoEqn.H (code-snippet of the equation): Code:
fvScalarMatrix rhoEqn ( fvm::ddt(rho) + fvc::div(phi) == fvOptions(rho) ); (7) after that UEqn.H is called (code-snippet of the equation): Code:
fvVectorMatrix UEqn ( fvm::ddt(rho, U) + fvm::div(phi, U) + MRF.DDt(rho, U) + turbulence->divDevRhoReff(U) == fvOptions(rho, U) ); . . . if (pimple.momentumPredictor()) { solve(UEqn == -fvc::grad(p)); fvOptions.correct(U); K = 0.5*magSqr(U); } which i think could be translated into: (8) (the is due to the negativ implementation of the terms in the function divDevRhoReff()) where (see [2], cap. 10.2): (9) and (c.f. [6]): (10) if we use (10) with (8): (11) and sort it: (12) and after that EEqn.H is called (code-snippet of the equation): Code:
fvScalarMatrix EEqn ( fvm::ddt(rho, e) + fvm::div(phi, e) + fvc::ddt(rho, K) + fvc::div(phi, K) + fvc::div(fvc::absolute(phi/fvc::interpolate(rho), U), p, "div(phiv,p)") - fvm::laplacian(turbulence->alphaEff(), e) == fvOptions(rho, e) ); (13) which is in coincidence with [7] if is used: . (14) The term is a aproxximation for the heat flux so we get after sorting and using (10) (c.f. [7]): (15) and with . (16) So if I interpret the following variables as averaged and favre averaged in the equations (7), (12) and (15): I get out of (7): . which is equivalent to (1). I get out of (12): and if I use I get: which is equivalent to (2). I get out of (15): . This equation is not equivalent. The variable is the approximation for . This leads me to the assumption, that the term is totaly neglected and also the part of the tensor is neglected in the total energy equation. Now this is my actual interpretation of the Code and the equations which were aviable to me until now. Does someone agree or disagree with the above text? The questions which are arising in me are: If the pressure, which is modeled in OpenFoam, is divided up like shown in equation (10), is this neglected in the Calculation of the equation of state? In which cases would the neglection of the terms in the total energy equation lead to a discrepancy of the solution which is not negligible? [1] Hirsch, Charles (2007): Fundamentals of computational fluid dynamics. 2. ed. Amsterdam: Elsevier/Butterworth-Heinemann (Numerical computation of internal and external flows, / Charles Hirsch ; Vol. 1). [2] Tobias Holzmann (2016): Mathematics, Numerics, Derivations and OpenFOAMŪ: Holzmann CFD. [3] https://www.cfd-online.com/Wiki/Favr...okes_equations [4] Wilcox, David C. (1993): Turbulence modeling for CFD. La Caņada, Calif.: DCW Industries Inc. [5] https://turbmodels.larc.nasa.gov/implementrans.html [6] https://www.openfoam.com/documentati...lence-ras.html [7] https://cfd.direct/openfoam/energy-equation/ |
|
December 4, 2017, 13:44 |
|
#3 | ||||
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66 |
Quote:
Code:
solve(UEqn == -fvc::grad(p)); However, the difference goes like the I^2 so it is small except for very high turbulence intensity scenarios. Note the origin comes from the Boussinesq hypothesis. It's not a compressibility issue. You find the same modified pressure p* for both RANS and FANS. Star-CCM and Fluent do the same thing. There is also a mention of it in Pope's book. It seems the general approach is to assume that the k contribution to pressure is negligible. This thread is useful, on calculating divdevreff but also contains some comments in the discussion on the modified pressure. Calculating divDevReff Quote:
First you need super high values of k. That should be apparent because k modifies the pressure. For thermo, you need an EOS which is pressure dependent. The other thing you need to check is properties. Very often, one assumes ideal gas where the specific heat and internal energy are only temperature dependent. So the modified pressure does not affect energy equation beyond pressure. So very often this modified pressure does not break anything. But you can imagine that you have a EOS that is highly dependent on pressure where this becomes a problem; and shouldn't forget to mention shockwaves. Quote:
Btw to answer the original question: Quote:
From a solver perspective, there is a fixed set of equations that gets solved (and they are the same equation). Hence the solver, (OF or any other solver) does not know whether these variables are the Reynolds ones or Favre ones because it's the same equation. Only the interpretation of the variables needs to be different. Remember in FANS you do not solve for the true velocity but a biased velocity, etc. |
|||||
January 13, 2018, 10:06 |
|
#4 | |
Senior Member
Join Date: Oct 2015
Location: Germany
Posts: 100
Rep Power: 11 |
Dear Patrick and Lucky,
thank you for your very detailed and helpful contributions to this thread. It really cleared things up. Quote:
Thanks again! Martin |
||
June 12, 2018, 18:31 |
|
#5 | |
Member
Join Date: Oct 2013
Posts: 92
Rep Power: 13 |
Quote:
Thanks. Last edited by fedvasu; June 13, 2018 at 00:38. |
||
October 13, 2018, 14:25 |
|
#6 |
Senior Member
Join Date: Mar 2011
Posts: 158
Rep Power: 15 |
Thank you for the detailed and illustrative contribution. It really helped me to better understand how OpenFoam deals with Reynolds and Favre averaging.
But what is still unclear for me is the following: How do I get to know which solver uses RANS or FANS equations? Do all solvers using the compressible NS equations solve for the FANS (=compressible RANS) equations? When I assume, as you already indicated, that the same equations are solved, where is the massweighted time averaging done? I do not find a hint in the code, where the velocity and specific enthalpy (which are the variables which are averaged with the density) are treated separately. What also confuses me a little bit: No word about Favre averaging is spent here: https://www.openfoam.com/documentati...lence-ras.html So how are the compressible NS equations time averaged when using RANS equations? Best Regards |
|
October 13, 2018, 14:34 |
|
#7 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,761
Rep Power: 66 |
You never know. The solver solves an equation like Ax=b and x can be anything. You have to infer based on the models whether x is a RANS of FANS or neither. In the case of RANS and FANS, the equations are identical (the A and b are the same). So you can say all solvers always solve the FANS. No one ever talks about it, because the equations are the same. Once you are given a solver you don't get to decide what x is. The solver solves for x. |
|
October 13, 2018, 15:18 |
|
#8 |
Senior Member
Join Date: Mar 2011
Posts: 158
Rep Power: 15 |
OK, yes, that's right.
If the equations are the same, x is the time averaged velocity when using the RANS equations and x is the massweighted time averaged velocity, for example. Thus, somewhere in the code there must be hidden the corresponding averaging equation, which provides the x to the solver. And I can't find such a hint in the code. Do you get my point? Last edited by tH3f0rC3; October 13, 2018 at 15:20. Reason: Misspelling |
|
October 14, 2018, 15:52 |
|
#9 |
New Member
Patrick H.
Join Date: Aug 2017
Location: Germany
Posts: 3
Rep Power: 9 |
It is the following way:
If you had all values continuous in time and spatial direction for a given problem. You could calculate the how ever shaped averaged value. If there is a flow, for which the simplifications, which are made for the incompressible Reynolds-averaging, are valid, you could now calculate the averaged values from the continuous values. The averaged values which a RANS-Solver would calculate directly. The same applies for a flow, for which the simplifications, made for the FANS-equation, are valid. As shown in different Sources and my previous post the Equations for incompressible RANS and the compressible FANS are under somehow shaped simplifications the same. So now it depends on your calculated flow how you have to interpret the of your solver calculated values. So if you only look at the equations (FANS and RANS) there could be two different flows, one compressible and one incompressible, which are different shaped in their actual values, but with proper averaging (FANS- and RANS-averaging consecutively) are the same in their averaged values. Means: OpenFOAM does no averaging. The averaged values are calculated directly with the solver. |
|
October 15, 2018, 08:01 |
|
#10 |
Senior Member
Join Date: Mar 2011
Posts: 158
Rep Power: 15 |
Thanks patrex for your explanation.
This point is also clear to me. I will try it this way to explain my problem: Let's assume we have a flow, for which the simplifications, which are made for the incompressible Reynolds-averaging, are valid. Which solver do I use in contrast to a case, where we assume a flow, for which the simplifications, made for the FANS-equation, are valid. After having solved the compressible Navier Stokes equations using for example the solver buoyantSimpleFoam I get values for u, p, T. After solving the incompressible Nasvier-Stokes equations using for example the solver buoyantBoussineswSimpleFoam I also get values for u, p, T. As far as I understand, the Reynolds-averaging is used to treat turbulence for incompressible problems and Favre-averaging to treat turbulence for compressible problems (to secure the validity of the continuity equation for the averaged flow). Comming back to my first question: -> How do I get to know which solver uses RANS or FANS equations? |
|
July 15, 2020, 12:20 |
Still unclear
|
#11 |
New Member
Stefan
Join Date: Oct 2015
Posts: 24
Rep Power: 11 |
Hi,
thanks for the usefull discussion. Sadly I am still strugling which version the solver compressibleInterFoam is using. How could i find this out?? All the Best Stefan |
|
July 16, 2020, 17:44 |
|
#12 |
New Member
Wenyuan Fan
Join Date: Mar 2017
Posts: 27
Rep Power: 9 |
Hi Stefan,
In the "compressibleInterPhaseTransportModel.H" file you can see that compressibleInterFoam is able to use two types of turbulence models, say, one-fluid and two-fluid formulations. As for the one-fluid formulation, FANS is used since the density field is used in the corresponding turbulence models, as implemented in the constructor in the "compressibleInterPhaseTransportModel.C" file. |
|
July 20, 2020, 05:14 |
|
#13 |
New Member
Stefan
Join Date: Oct 2015
Posts: 24
Rep Power: 11 |
Thanks a lot for this usefull information!!!!
|
|
June 30, 2023, 16:45 |
|
#14 | |
New Member
Khaled
Join Date: Jun 2023
Location: Hannover
Posts: 7
Rep Power: 3 |
Quote:
How can i write the code to compute Favre average , and define the time average terms of it ? I have tried all the possible ways but i could not reach anything . I am using OpenFOAM 1612+ |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Map of the OpenFOAM Forum - Understanding where to post your questions! | wyldckat | OpenFOAM | 10 | September 2, 2021 06:29 |
OpenFOAM 5.0 Released | CFDFoundation | OpenFOAM Announcements from OpenFOAM Foundation | 11 | June 6, 2018 00:48 |
Reynolds Stresses Tensor from OpenFoam | Irstea | OpenFOAM Post-Processing | 0 | August 29, 2017 10:04 |
OpenFOAM v3.0+ ?? | SBusch | OpenFOAM | 22 | December 26, 2016 15:24 |
URGENT - Simulation setup using Reynolds Tensor Transport (R) - OpenFOAM | beluiz93 | OpenFOAM | 1 | December 2, 2016 07:51 |