CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Calculating divDevReff

Register Blogs Community New Posts Updated Threads Search

Like Tree127Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 5, 2017, 03:16
Thumbs up reactingFoam abou Source trem and transport
  #61
New Member
 
Wahahawsw
Join Date: Feb 2017
Posts: 6
Rep Power: 9
wangwsw is on a distinguished road
I have same problem with the reactingFoam. As i have implemented my thermophysicalModel.
I have a few problems as following :
1: In the UEqn.H, how is turbulence->divDevRhoReff() calculated in the code?
2: In the EEqn.H, how is turbulence->alphaEff() and reaction->Sh() calculated in the code?
3: In the YEqn.H, how is turbulence->muEff() and reaction->R(Yi) calculated in the code?
As i can't find their code, I am troubled by these problems. I want to know how these terms are calculated .
Thank you very much in advance if you have some ideas about those problems.
wangwsw is offline   Reply With Quote

Old   March 5, 2017, 04:14
Default
  #62
New Member
 
Elyas_Kermani
Join Date: Dec 2015
Location: Iran
Posts: 12
Rep Power: 11
Elyas_Mosibat is on a distinguished road
hi
first , could you tell me about your turbulence model? or LESProperties?
Elyas_Mosibat is offline   Reply With Quote

Old   March 7, 2017, 03:14
Default
  #63
Member
 
Emeline Noel
Join Date: Dec 2013
Location: Paris
Posts: 31
Rep Power: 13
zarox is on a distinguished road
Hi,

I use qtcreator in order to explore the code, you would be able to find source code for each piece. On your OpenFoam folder type qmake -project *, this would create a .pro file to be open with qtcreator. It depend on the version of OF you have, for 4.x the turbulence model are in src folder under turbulenceModel folder, for you that would be the compressible subfolder. I am in holidays and don't have access to the code, it is only by memory, so scuse me if there are some mistake.

Zarox
zarox is offline   Reply With Quote

Old   March 8, 2017, 10:02
Default div
  #64
New Member
 
Wahahawsw
Join Date: Feb 2017
Posts: 6
Rep Power: 9
wangwsw is on a distinguished road
Quote:
Originally Posted by Elyas_Mosibat View Post
hi
first , could you tell me about your turbulence model? or LESProperties?
Firstly, thank you very much for your reply.As I use kepsilon turbulence model.
Now, I get some answer from the code.
My views are as follows:
1, turbulence->divDevRhoReff() is consisted with two terms: nut()+nu();
2, turbulence->muEff() is consisted with mut()+mu()
3, The reaction->R(Yi) could be found in the chemistrModel.So is the reaction->Sh()
Did I get mistake with those ?
Now I get confused with the term of alphaEff(). In some conference,
alphaEff()=laminar flow alpha +turbulence alpha
As some foams use alphaEff(), while some foams use turbulence->alphaEff().
what's the difference between alhaEff() and turbulence-alphaEff() ?
Thank you ver much if you get some idea about this question!
wangwsw is offline   Reply With Quote

Old   May 24, 2017, 14:39
Default
  #65
New Member
 
Elyas_Kermani
Join Date: Dec 2015
Location: Iran
Posts: 12
Rep Power: 11
Elyas_Mosibat is on a distinguished road
Hello
I simulated a channel with (2pi,2,pi) and Re_tau=590 to evaluate dynamic smagorinsky model in two modes
First I used the original coding in the OpenFOAM, i.e., the divDevReff with the same definition in openFOAM library as follows;
tmp<fvVectorMatrix> GenEddyVisc::divDevReff(volVectorField& U) const
{
Return
(
- fvm::laplacian(nuEff(), U)
- fvc::div(nuEff()*dev(T(fvc::grad(U))))
);
}
In the second case, I’ve removed the dev(T(fvc::grad(U))) and replaced that with T(fvc::grad(U)). I have attached my U+ plot in two cases and DNS data. The results show a little difference. I would like to know
1-Why openFOAM uses dev(T(fvc::grad(U))) instead of T(fvc::grad(U))?
2-Could you say this term is used only for stability? and will have no effect on the accuracy of results?
3-Why the accuracy of the simulation doesn’t acceptable in both cases using DS? I think the dynamicSmagorinsky model must be the most precise one among all the eddy-viscosity models.
Attached Images
File Type: png u+1.png (26.5 KB, 48 views)

Last edited by Elyas_Mosibat; May 25, 2017 at 02:58.
Elyas_Mosibat is offline   Reply With Quote

Old   May 29, 2017, 05:45
Default
  #66
Member
 
Emeline Noel
Join Date: Dec 2013
Location: Paris
Posts: 31
Rep Power: 13
zarox is on a distinguished road
Hi Elyas,


For incompressible flow divergence of the stress tensor is only the Laplacian of the velocity, for Stoke hypothesis with Newtonian fluids

\nabla . \tau = \nu \Delta \bf {u}

The fvc::div(nuEff()*dev(T(fvc::grad(U)))) term add to the divergence of the stress tensor a part that depend on the divergence of the velocity:

for dev function

\nabla . \tau = \nu \Delta \bf {u} + \nu \frac{2}{3} \nabla (\nabla . \bf {u})


for dev2 function, leading to the same formula between compressible and incompressible flow
\nabla . \tau = \nu \Delta \bf {u}+ \nu \frac{1}{3} \nabla (\nabla . \bf {u})

My answers :

1- Switch dev of the transpose gradient with the transpose gradient give :

\nabla . \tau = \nu \Delta \bf {u} + \nu \nabla (\nabla. \bf{u})

instead of :

\nabla . \tau = \nu \Delta \bf {u} + \nu \frac{2}{3} \nabla (\nabla . \bf {u})

2- I don't know why OpenFOAM use this additional term, even if I understood that in the new formulation it is convenient for the standardization of turbulence model structure between compressible and incompressible flow.
As your test is showing, the changed of the term even if it would be theoretically zero is not in the numerical framework and so difference arise.

3- to take into account wall effect on the decrease of the turbulence for LES, I think the WALE is more suitable. Smagorinsky model family use the
strain rate tensor, but the eddy of turbulence decay can't be only represent by the strain tensor, strain arise near wall that is not due to turbulence. That is the point of the WALE model to add the rotational rate tensor.


By the way thank you for your contribution, now I think we have a hint that the "stabilization" term have an effect on the solution.
zarox is offline   Reply With Quote

Old   January 25, 2018, 07:39
Default
  #67
New Member
 
Hagen
Join Date: Nov 2016
Posts: 16
Rep Power: 10
HagenC is on a distinguished road
Quote:
Originally Posted by GerhardHolzinger View Post
We are solving for all kinds of stuff.
If you apply Reynolds-averaging to your governing equations and apply the Boussinesq hypothesis, then you solve for the Reynolds averaged flow quantities.
The pressure is the sum of the actual, Reynolds averaged pressure and the isotropic part of the Reynolds stress tensor.
The actual pressure is also the isotropic part of a general fluid stress tensor. However, for probably historical reasons, we separate the pressure and the (shear) stresses. In solid mechanics there is no such distinction, at least up to the point I got in contact with solid mechanics and FE simulation.

If you apply spatial filtering to derive the governing equations with LES turbulence modelling, then you end up with equations for the grid-scale flow quantities. The sub-grid stress tensor in LES modelling is analogous to the Reynolds stress tensor in RANS modelling.
Also in LES modelling, the pressure you solve for is the sum of the actual pressure and the isotropic part of the sub-grid stress tensor.

The beauty of this derivations is, although, we get equations for different things (temporal or spatially filtered flow quantities), the equations have the same mathematical structure. This allows the makers of CFD simulation software to implement a generic handling of turbulence.
Hi all,
Thank you Gerald for the very nice explanation.
Nevertheless, there is still something that confuses me:
So we have a
modified pressure = pressure + isotropic part of Reynolds/subgrid stress tensor
If I now measure a static pressure in an experiment, what do I need to do to compare my pressure to?
For incompressible case I have to correct with the density of course, but do I also need to remove the isotropic stresses from the pressure?
If so, how to get to those values? I think the Reynolds stresses can be extracted from the turbulent kinetic energy k, but in case of LES?
Thank you very much in advance!
Greets
Christina
HagenC is offline   Reply With Quote

Old   January 25, 2018, 07:57
Default
  #68
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Dear Christina,

I would like to refer to https://holzmann-cfd.de/publications...s-and-openfoam page 90.
lumpor likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 25, 2018, 08:35
Default
  #69
New Member
 
Hagen
Join Date: Nov 2016
Posts: 16
Rep Power: 10
HagenC is on a distinguished road
Dear Tobi,

thank you for your reply.
On page 91/92 I found:
"Note: If we solve the incompressible Reynolds-Averaged Navier-Stokes equations, we are not calculating the real pressure fi eld p. Instead we have the modi ed pressure p. For most of the problems this is not a big deal and we do not have to consider this. Only if we are using some modifi ed equations in OpenFOAM where we need the real pressure, we have to recalculate the real pressure field by subtracting the kinetic part."

So as I want a real pressure, the answer is yes, I have to remove the kinetic part?

On page 90 I found the pressure is modified by 2/3*rho*k for Reynolds stresses. And in case of LES?

Thank you again.
Greets
Christina
HagenC is offline   Reply With Quote

Old   January 25, 2018, 09:17
Default
  #70
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
I am not into the turbulence modeling but as far as I understood, the LES approach just approximates the turbulent viscosity differently. The eddy-viscosity hypothesis still holds and thus, the pressure is modified. However, I would imagine that the term:
\frac{2}{3}\rho k

is not really big, at least not for air. Nevertheless, it is my personal derivation based on the literature I was reading. I could be also wrong. I am just a student.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   December 19, 2018, 13:00
Default
  #71
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
Hi,

I wanted to ask a question with the most experienced... I am conducting a study of DRAG REDUCTION and consequently, a new term appears in the Navier Stokes equation responsible for the polymeric stress.

I could insert it into the equation using this form:

Quote:
::divDevReff(volVectorField& U) const
{
return
(
- fvc::div(tau_/rho_, "div(tau)")
- fvm::laplacian(nuEff(), U)
- fvc::div(nuEff()*dev2(T(fvc::grad(U))))
);
}
? I performed tests in this way, and the velocity profile in a pipe was not 'attractive', especially when compared to the results of a k-Omega model. Of course, there is a chance that the problem will be in the tau equation, but ... I wanted to eliminate the other hypotheses.
I tried to create a class just for him...

Quote:
::divTau(volVectorField& U) const
{
return
(
- fvc::div(tau_/rho_, "div(tau)")
);
}
...but OpenFOAM does not compile, and unfortunately I can not say why.

Thx
gu1 is offline   Reply With Quote

Old   April 22, 2019, 23:29
Default
  #72
Senior Member
 
zhangyan's Avatar
 
Yan Zhang
Join Date: May 2014
Posts: 120
Rep Power: 12
zhangyan is on a distinguished road
Quote:
Originally Posted by Tobi View Post
I am not into the turbulence modeling but as far as I understood, the LES approach just approximates the turbulent viscosity differently. The eddy-viscosity hypothesis still holds and thus, the pressure is modified. However, I would imagine that the term:
\frac{2}{3}\rho k

is not really big, at least not for air. Nevertheless, it is my personal derivation based on the literature I was reading. I could be also wrong. I am just a student.
Hi Tobi,
Thanks for your fantastic derivations!
I found that in RANS, the modified pressure is p + 2/3 rho k.
And in LES, the modified pressure is p - 2/3 rho k.
To use the absolute pressure, maybe we can overwrite the function overwrite the divDevRhoReff in a modified turbulence model, and include the twoThirdRhoK therm. Is this right?
The twoThirdRhoK term is easy to add, why people don't do this?
__________________
https://openfoam.top
zhangyan is offline   Reply With Quote

Old   October 27, 2019, 12:15
Default
  #73
Senior Member
 
David Long
Join Date: May 2012
Location: Germany
Posts: 104
Rep Power: 14
keepfit is on a distinguished road
Quote:
Originally Posted by Tobi

For incompressibe flow: divDevReff reads

Code:
 tmp<fvVectorMatrix> laminar::divDevReff(volVectorField& U) const
{
    return
    (
      - fvm::laplacian(nuEff(), U)
      - fvc::div(nuEff()*dev(T(fvc::grad(U))))
    );
}


Why we use fvc::div(...) here rather than fvm::div(...)? does the fvc term go to RHS of [A][x]=[b] automatically?

Or it is just matrix subtraction between square matrix and column matrix:

M_laplacian (n x n) - M_fvcdiv (n x 1)?

Last edited by keepfit; October 29, 2019 at 05:21.
keepfit is offline   Reply With Quote

Old   October 27, 2019, 16:11
Default
  #74
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
We cannot make the transposed grad(U) implicit
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   October 27, 2019, 18:43
Default
  #75
Senior Member
 
David Long
Join Date: May 2012
Location: Germany
Posts: 104
Rep Power: 14
keepfit is on a distinguished road
Quote:
Originally Posted by Tobi View Post
We cannot make the transposed grad(U) implicit
Quote:
fvc::div(nuEff()*dev(T(fvc::grad(U))))
so the fvc::div(...) returns a column vector and then we do matrix subtraction with the fvm::laplacian(...) term? Still confused about this.
keepfit is offline   Reply With Quote

Old   October 27, 2019, 19:15
Default
  #76
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Got it, ... good question. Should be as you said. The explicit guy should go to the RHS (to the source). However, I would have to investigate into that here in more detail. As you said: Matrix - Vector. But with fvc and fvm it should be done in a correct way.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   October 29, 2019, 11:06
Default
  #77
Senior Member
 
David Long
Join Date: May 2012
Location: Germany
Posts: 104
Rep Power: 14
keepfit is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Got it, ... good question. Should be as you said. The explicit guy should go to the RHS (to the source). However, I would have to investigate into that here in more detail. As you said: Matrix - Vector. But with fvc and fvm it should be done in a correct way.

Can you also give some explanation of the following equation for viscous force (incompressible flow, Henrik Rusche's PhD thesis P156), especially the
expansion:


div[mu*T(grad(u))] = grad(U) & grad(mu) + mu*grad[div(U)]


keepfit is offline   Reply With Quote

Old   October 29, 2019, 13:33
Default
  #78
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,


  • the code explanation is given here fvm::laplacian - fvc::div
  • The equation manipulation should be related to numerics. Out of the box, the equation you wrote should be possible to treat completely implicitly while the first version contains the transposed grad(U) which has to be handled explicitly
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   January 11, 2020, 17:11
Default Some questions about divDevRhoReff
  #79
New Member
 
Saddam Hijazi
Join Date: May 2016
Posts: 17
Rep Power: 10
SaddamH is on a distinguished road
I have question regarding the divDevRhoReff for the turbulent incompressible case
SaddamH is offline   Reply With Quote

Old   January 11, 2020, 17:13
Default
  #80
New Member
 
Saddam Hijazi
Join Date: May 2016
Posts: 17
Rep Power: 10
SaddamH is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Dear Emeline,

Resubstituting everything into divDevRhoReff we get:

-\nabla \bullet \left\{\alpha \rho \nu_\text{eff}\left(
\left[(\nabla \otimes \textbf{U})^\text{T} \right] -  \frac{2}{3}\text{tr}\left[(\nabla \otimes  \textbf{U})^\text{T}\right]\textbf{I}\right)\right\}
-\Delta(\alpha \rho \nu_\text{eff} \textbf{U})

\alpha is the phase fraction and the negative signs come from the fact that the shear-rate tensor stand on the left hand side in the equation. \rho \nu_\text{eff} is the dynamic viscosity and based on the fact that I assume it to be constant (density constant as well), we can take it out of the derivatives. The fraction is One here (single phase). Okay. Bringing everything to the RHS, dividing the equation by the density, assuming the kinematic viscosity to be constant and that we model only one phase (\alpha = 1) we get:



Hi Tobi, thank you for you answer, I would like to clarify some doubts that I have, in this part that I quoted from your previous reply, you say that \rho \nu_\text{eff} is the dynamic viscosity is constant. I suppose that you assume laminar setting otherwise, \rho \nu_\text{eff} = \rho (\nu + \nu_t) and the second term is not constant and therefore can't be taken outside the divergence operator. Secondly, why you wrote the second term the following way ?

-\Delta(\alpha \rho \nu_\text{eff} \textbf{U})

should not be written like this ?

-\nabla \bullet \left\{ \alpha \rho \nu_\text{eff} \nabla \otimes \textbf{U})  \right\}

Thank you very much.
SaddamH is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating Vorticity David CFX 28 October 29, 2017 19:02
Calculating Drag Ajay Rao FLUENT 8 February 15, 2010 10:15
what is Fluent calculating? tomek FLUENT 1 July 24, 2006 18:52
errors in calculating ustcer FLUENT 1 April 4, 2004 14:08
Calculating Coefficients shabah CFX 2 June 19, 2001 00:59


All times are GMT -4. The time now is 22:33.