CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Understanding the viscous stress tensor

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 19, 2017, 07:00
Default Understanding the viscous stress tensor
  #1
Member
 
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9
Benben is on a distinguished road
Hello,

i am having a hard time understanding the viscous stress tensor model.
For a compressible fluid in carthesian coordinates, the Navier Stokes equation can be written :


This seems to give results that are not physical. For exemple, considering a closed boxe containing a fluid.



There is a gradient of velocity "v" along the x axis due to the no slip condition on lateral walls.
And so du to this term of the equations :

The velocity variation "dv" is not the same at point A and B.

This should obviously not be the case as the problem is symetrical.
Why is that so ? Is there missing absolute value in my equation ?
Benben is offline   Reply With Quote

Old   June 19, 2017, 11:44
Default
  #2
Senior Member
 
Hector Redal
Join Date: Aug 2010
Location: Madrid, Spain
Posts: 243
Rep Power: 17
HectorRedal is on a distinguished road
Hi,

I am not sure if I have understood correctly the problem you are describing.
But, if there are no external forcing acting in the box, this means that we are facing an static problem. In that case, the velocity at any point of the fluid is zero. Consequently the stress tensor is zero as well at all points of the domain.
This situation matches what you observe in a real physical problem.

Best regards,
Hector.
HectorRedal is offline   Reply With Quote

Old   June 19, 2017, 16:38
Default
  #3
Member
 
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9
Benben is on a distinguished road
Hello, thanks for the answer.

The three forces acting on my fluid are the gravity, the pressure and the viscosity stress tensor.
My fluid is compressible (even if in the equation cited rho is taken off the temporal derivative, because the equations don't come from my work)
The fluid is contained inside of a fully closed boxe and an equilibrium between the pressure and the pressure should establish. (As the fluid is pulled to the bottom of the boxe by the gravity, the pressure at the botom should rize until the gradient compensate the gravity).


At initial time :
The pressure forces are null/compensating as the pressure is the same everywhere.
The viscous stress tensor is null as i initialize the velocity at 0 everywhere.
The gravity pulls the fluid toward the bottom of the boxe.

Which gives this configuration immediatly after the first time step (the velocity is null at the lateral boundaries due to the no slip condition).

I am programming a litle code in C to solve the Navier Stokes equation in transient with a finite differences methode, using the definition of the stress tensor cited above.
However, right after the first time step, i end up in the configuration illustrated, and by definition of my viscous stress, A and B point dont get the same vertical acceleration.

best regards
Benben is offline   Reply With Quote

Old   June 19, 2017, 16:57
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Your question means almost nothing if you do not specify the full set of BC.s. For compressible flows, you have to consider also the density and the energy equations along with the state equation.
However, if your problem is at low-Mach, this is not the best formulation to work with.
FMDenaro is offline   Reply With Quote

Old   June 19, 2017, 17:18
Default
  #5
Member
 
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9
Benben is on a distinguished road
Hello,

Every side of my square is a wall (no slip : lateral velocity is null at the wall, and there is no mass flux through the wall).
I am using an equation of state (Peng Robinson to be precise) to get the pressure at a given density (and at the constant temperature).
The temperature is constant inside of the boxe, so i am not solving any energy equation for now.

Why is my formulation of the equation bad for solving at low mach numbers ? I took a very naïve aproach and just programmed what seemed the easyest to do.

I am solving the equations explicitly with a time marching algorithm. This way i dont have to use a numerical solver. (I am programming every thing from scratch)
I calculate the variation of density with the mass balance equation, and the velocity variation with the momentum balance equation, which gives me the velocity and density of the fluid at the next time step. And then i calculate the pressure with the equation of state, and the viscosity with another formula, and repeat the process.
Benben is offline   Reply With Quote

Old   June 19, 2017, 17:30
Default
  #6
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Low-Mach flow means that you are working with a stiff problem where small density variations (due also to numerical errors) are amplified in the pressure variations.
If you have constant temperature, there is no buoyancy force, do you set an unstable density field to initialize the motion?
FMDenaro is offline   Reply With Quote

Old   June 19, 2017, 17:35
Default
  #7
Senior Member
 
Hector Redal
Join Date: Aug 2010
Location: Madrid, Spain
Posts: 243
Rep Power: 17
HectorRedal is on a distinguished road
You have specified the intial boundary conditions and the initial state of equilibrium. Since the boundary condition does not change (null velocity at all walls, no slip conditions), the state of equilibrium won't. So, if at initial the stress tensor is null everywhre, this would remain as such at any subsequent time steps.
As you correctly state, the gravity force induces some kind of gradient or pressure inside the box. But that gradient of pressure does not cause a viscous tensor if there is not any movement in the fluid.
This is applicable to both incompressible and compressible flows.
https://en.wikipedia.org/wiki/Hydrostatics
HectorRedal is offline   Reply With Quote

Old   June 19, 2017, 17:39
Default
  #8
Member
 
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9
Benben is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
Low-Mach flow means that you are working with a stiff problem where small density variations (due also to numerical errors) are amplified in the pressure variations.
If you have constant temperature, there is no buoyancy force, do you set an unstable density field to initialize the motion?

Indeed the probleme is very stiff, i have to use time step of the ordre of 10^-8 so that the pressure doesnt skyrocket. This is not really a probleme because the objective of the code is to simulate explosions that happend in a very short time laps.

I am initializing the density at a constant value everywhere.

Numerical error on the density was also a probleme until i rounded off everything at 8 significant digit.

I dont think i can use another methode than the one i described because i have to use a proper equation of state for high temperatures (the objective is to simulate explosions, at high temperature, high pressure, i can't use the ideal gaz law), and the good equations of state (Peng Robinson , Soave Redlick Kwong, ...) give several solution of density for one pressure at a given temperature (one for liquid state, one for gaz state, and one that is not physical).

Quote:
Originally Posted by HectorRedal View Post
You have specified the intial boundary conditions and the initial state of equilibrium. Since the boundary condition does not change (null velocity at all walls, no slip conditions), the state of equilibrium won't. So, if at initial the stress tensor is null everywhre, this would remain as such at any subsequent time steps.
As you correctly state, the gravity force induces some kind of gradient or pressure inside the box. But that gradient of pressure does not cause a viscous tensor if there is not any movement in the fluid.
This is applicable to both incompressible and compressible flows.
https://en.wikipedia.org/wiki/Hydrostatics
True, but i have velocity at the center of my boxe and no velocity at the wall, so that makes a velocity gradient near my walls, where the viscosity has an effect.
The velocity at the center comes from the gravity, and the velocity at the walls is null because, even if gravity accelerates it, i set the velocity to 0 here. But the inside of my square isn't at a wall boundary (only the sides of the square) so it is free to fall.


Thanks for the answers.
Benben is offline   Reply With Quote

Old   June 19, 2017, 17:44
Default
  #9
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Benben View Post
Indeed the probleme is very stiff, i have to use time step of the ordre of 10^-8 so that the pressure doesnt skyrocket. This is not really a probleme because the objective of the code is to simulate explosions that happend in a very short time laps.

I am initializing the density at a constant value everywhere.

Numerical error on the density was also a probleme until i rounded off everything at 8 significant digit.



True, but i have velocity at the center of my boxe and no velocity at the wall, so that makes a velocity gradient near my walls, where the viscosity has an effect.


Thanks for the answers.

Density constant means also pressure constant, there is no driving force to onset the motion...maybe you are not considering the equilibrium density rho0 such that if the difference from the density field is zero the gravity does not act
FMDenaro is offline   Reply With Quote

Old   June 19, 2017, 17:48
Default
  #10
Senior Member
 
Hector Redal
Join Date: Aug 2010
Location: Madrid, Spain
Posts: 243
Rep Power: 17
HectorRedal is on a distinguished road
Quote:
Originally Posted by Benben View Post
True, but i have velocity at the center of my boxe and no velocity at the wall, so that makes a velocity gradient near my walls, where the viscosity has an effect.
The velocity at the center comes from the gravity, and the velocity at the walls is null because, even if gravity accelerates it, i set the velocity to 0 here.


Thanks for the answers.
The velocity at the center is depicted in the intial figure you provided. Where does that velocity come from? Is that a real velocity? Is that an initial value for the velocity field? Is that a boundary condition maintained over the time domai?
HectorRedal is offline   Reply With Quote

Old   June 19, 2017, 17:58
Default
  #11
Member
 
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9
Benben is on a distinguished road
Yes, you are right, i am not considering the equilibrium density rho0 with the gravity field. I am considering the density as the mass of fluid per unit of fluid volume. I solve it's value with a mass balance equation.

And the velocity at the center of my figure is coming from the gravity : At initial time the density and the velocity is the same everywhere, so there is no pressure or viscous effect, but the gravity is acting on the fluid. This means that every cingle cell gets a velocity of -9.81*dt after the first time step "dt".
However, in order to respect the boundary condition, the velocities at the side walls are set to 0 (no slip), and at the bottom wall too (no flux trough the wall).
Benben is offline   Reply With Quote

Old   June 19, 2017, 18:04
Default
  #12
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Benben View Post
Yes, you are right, i am not considering the equilibrium density rho0 with the gravity field. I am considering the density as the mass of fluid per unit of fluid volume. I solve it's value with a mass balance equation.

And the velocity at the center of my figure is coming from the gravity : At initial time the density and the velocity is the same everywhere, so there is no pressure or viscous effect, but the gravity is acting on the fluid. This means that every cingle cell gets a velocity of -9.81*dt after the first time step "dt".
However, in order to respect the boundary condition, the velocities at the side walls are set to 0 (no slip), and at the bottom wall too (no flux trough the wall).


But physically there is no force due to gravity if density, temperature and pressure are homogeneous... the solution is the rest
FMDenaro is offline   Reply With Quote

Old   June 19, 2017, 18:12
Default
  #13
Member
 
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9
Benben is on a distinguished road
The reason why there is a pressure gradient in the water is the gravitation. Same for the air pressure that drops with altitude.
That's because the pressure equilibrate so that the gradient of pressure compensate the gravity.
In my exemple i took a box of fluid that has not reached the pressure gradient equilibrium, so the gravity has an effect. until i reach this steady state.
Benben is offline   Reply With Quote

Old   June 19, 2017, 18:27
Default
  #14
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Benben View Post
The reason why there is a pressure gradient in the water is the gravitation. Same for the air pressure that drops with altitude.
That's because the pressure equilibrate so that the gradient of pressure compensate the gravity.
In my exemple i took a box of fluid that has not reached the pressure gradient equilibrium, so the gravity has an effect. until i reach this steady state.

The equilibrium is when dp/dy = rho *fy but the velocity field will be zero at the steady state. Do you reach such solution at the end of the computation?
However, for water I don't understand how your compressible model could be able to work...
FMDenaro is offline   Reply With Quote

Old   June 19, 2017, 23:38
Default
  #15
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Quote:
Originally Posted by FMDenaro View Post
The equilibrium is when dp/dy = rho *fy but the velocity field will be zero at the steady state. Do you reach such solution at the end of the computation?
However, for water I don't understand how your compressible model could be able to work...

I am not sure if he is doing the simulation or not, but this small case could be tricky to solver. The standard momentum interpolation method produces non zero velocities near bottom and top walls. The body force weighted scheme (Fluent's) produce 0 (or approaching to 0) velocities.
arjun is offline   Reply With Quote

Old   June 20, 2017, 03:47
Default
  #16
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
I think that as dp/drho >> v^2 a small variation of density produces large pressure variation in the momentum and this is the reason to spurious velocity.
For this reason I worked on water flow with the effect of gravity using the incompressible model (div v=0) and the Bousinnesq approximation.
FMDenaro is offline   Reply With Quote

Old   June 20, 2017, 04:29
Default
  #17
Member
 
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9
Benben is on a distinguished road
Thank you very much for the help.

Yes, i am able to reach steady state solution where the velocity is close to zero (it never completly is when i stop my calculation, as it would take a lot of computation time, but the velocity is going smaller and smaller).

Sadly I can't use boussinesq's approximation, as i am working on a tool to modelize explosions, and i want to calculate precisely the pressure as a function of the density.
However it is likely that FMDenaro is right about the fact that the spurious velocity comes from numerical error, as i am not rounding the temporal momentum derivative after applying the effect of viscosity.

I was looking for an error in the equations but it might come from the implementation instead.
Thank you everyone for the help, i will try to solve this issue with the advices you gave me.
Benben is offline   Reply With Quote

Old   June 20, 2017, 06:54
Default
  #18
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34
arjun will become famous soon enougharjun will become famous soon enough
Yes it is numerical error. If you want correct velocities (or 0 vel) in the start, then start with correct pressure. In this case the pressure gradient matches with gravity.
arjun is offline   Reply With Quote

Old   June 20, 2017, 13:12
Default
  #19
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
To check for numerical errors (or bugs in the code), I suggest to start from a stable stratified condition to see if the initial zero velocity field would be perturbed
FMDenaro 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 the viscous stress tensor tau for viscous dissipation heating dgadensg OpenFOAM Programming & Development 5 January 17, 2023 16:20
[ANSYS Meshing] Error in Workbench "Unable to attach to geometry file" Jeremie84 ANSYS Meshing & Geometry 70 October 25, 2017 17:03
Add viscous stress term to sonicFoam Hillie OpenFOAM Programming & Development 4 April 14, 2016 03:53
Trouble with Viscous Stress Tensor Term otq OpenFOAM Programming & Development 0 August 4, 2014 10:14


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