|
[Sponsors] |
June 19, 2017, 07:00 |
Understanding the viscous stress tensor
|
#1 |
Member
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9 |
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 ? |
|
June 19, 2017, 11:44 |
|
#2 |
Senior Member
Hector Redal
Join Date: Aug 2010
Location: Madrid, Spain
Posts: 243
Rep Power: 17 |
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. |
|
June 19, 2017, 16:38 |
|
#3 |
Member
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9 |
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 |
|
June 19, 2017, 16:57 |
|
#4 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73 |
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. |
|
June 19, 2017, 17:18 |
|
#5 |
Member
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9 |
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. |
|
June 19, 2017, 17:30 |
|
#6 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73 |
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? |
|
June 19, 2017, 17:35 |
|
#7 |
Senior Member
Hector Redal
Join Date: Aug 2010
Location: Madrid, Spain
Posts: 243
Rep Power: 17 |
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 |
|
June 19, 2017, 17:39 |
|
#8 | ||
Member
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9 |
Quote:
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:
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. |
|||
June 19, 2017, 17:44 |
|
#9 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73 |
Quote:
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 |
||
June 19, 2017, 17:48 |
|
#10 | |
Senior Member
Hector Redal
Join Date: Aug 2010
Location: Madrid, Spain
Posts: 243
Rep Power: 17 |
Quote:
|
||
June 19, 2017, 17:58 |
|
#11 |
Member
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9 |
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). |
|
June 19, 2017, 18:04 |
|
#12 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73 |
Quote:
But physically there is no force due to gravity if density, temperature and pressure are homogeneous... the solution is the rest |
||
June 19, 2017, 18:12 |
|
#13 |
Member
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9 |
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. |
|
June 19, 2017, 18:27 |
|
#14 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73 |
Quote:
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... |
||
June 19, 2017, 23:38 |
|
#15 | |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34 |
Quote:
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. |
||
June 20, 2017, 03:47 |
|
#16 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73 |
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. |
|
June 20, 2017, 04:29 |
|
#17 |
Member
benoit favier
Join Date: Jun 2017
Posts: 64
Rep Power: 9 |
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. |
|
June 20, 2017, 06:54 |
|
#18 |
Senior Member
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 1,285
Rep Power: 34 |
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.
|
|
June 20, 2017, 13:12 |
|
#19 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,877
Rep Power: 73 |
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
|
|
|
|
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 |