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

Get pressure from velocity

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 27, 2014, 04:37
Default
  #41
Member
 
Join Date: Aug 2014
Posts: 58
Rep Power: 11
samycfd is on a distinguished road
NO ! But I still get a result. But it has not converged. I am using the conjugate gradient solver (cgs) and I get :

cgs stopped at iteration 1500 without converging to the desired tolerance 1e-006 because the maximum number of iterations was reached.
The iterate returned (number 119) has relative residual 0.067

Normally this solver is fast and if after 1500 iterations it has not converged it will never converge I guess. ( with 5000 iterations same residual )
samycfd is offline   Reply With Quote

Old   August 27, 2014, 04:57
Default
  #42
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by samycfd View Post
NO ! But I still get a result. But it has not converged. I am using the conjugate gradient solver (cgs) and I get :

cgs stopped at iteration 1500 without converging to the desired tolerance 1e-006 because the maximum number of iterations was reached.
The iterate returned (number 119) has relative residual 0.067

Normally this solver is fast and if after 1500 iterations it has not converged it will never converge I guess. ( with 5000 iterations same residual )

this is an indication that your BC.s do not satisfy the compatibility relation...
Are you using homogeneous Neumann bc.s?
FMDenaro is offline   Reply With Quote

Old   August 27, 2014, 04:59
Default
  #43
Member
 
Join Date: Aug 2014
Posts: 58
Rep Power: 11
samycfd is on a distinguished road
Ah okay
I am using homogeneous Neumann BCs, that's why I was thinking that a value in one point needed to be defined.
samycfd is offline   Reply With Quote

Old   August 27, 2014, 05:10
Default
  #44
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by samycfd View Post
Ah okay
I am using homogeneous Neumann BCs, that's why I was thinking that a value in one point needed to be defined.
if the compatibility relation is satisfied the solver converges without that...
you can check that by integrating over the volume both LHS (which will be zero) and RHS and checking if the integral of the source term (RHS) is zero
FMDenaro is offline   Reply With Quote

Old   August 27, 2014, 05:13
Default
  #45
New Member
 
Parth Thaker
Join Date: Mar 2014
Location: Surat , Gujarat , INDIA
Posts: 26
Rep Power: 12
Parth04 is on a distinguished road
need help about implementing orlanski's (non reflecting) boundary codition at outflow boundary. . .
also , what should be b.c. for pressure, when velocity b.c. is orlanski's b.c. . . .
solving stratified flow problem using FVM

thnx in advance
Parth04 is offline   Reply With Quote

Old   August 27, 2014, 05:44
Default
  #46
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by Parth04 View Post
need help about implementing orlanski's (non reflecting) boundary codition at outflow boundary. . .
also , what should be b.c. for pressure, when velocity b.c. is orlanski's b.c. . . .
solving stratified flow problem using FVM

thnx in advance

this topic concerns BC.s for elliptic equation, you are actaully talking about convective-type of BC.s
Parth04 likes this.
FMDenaro is offline   Reply With Quote

Old   August 27, 2014, 05:49
Default
  #47
Member
 
Join Date: Aug 2014
Posts: 58
Rep Power: 11
samycfd is on a distinguished road
In my case don't I integrate over the surface the RHS and the LHS ?
I get the idea even I am not sure of how doing that. Numerical integration with a Gauss quadrature approximation for example ?
samycfd is offline   Reply With Quote

Old   August 27, 2014, 05:53
Default
  #48
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by samycfd View Post
In my case don't I integrate over the surface the RHS and the LHS ?
I get the idea even I am not sure of how doing that. Numerical integration with a Gauss quadrature approximation for example ?
you have to do a volume integral, the LHS becomes a surface integral as

Int [V] Div Grad P dV = Int [SV] dp/dn dS = 0

The volume integral of the source term must be zero, even if you can write as surface integral according to the LHS.
FMDenaro is offline   Reply With Quote

Old   August 27, 2014, 07:16
Default
  #49
Member
 
Join Date: Aug 2014
Posts: 58
Rep Power: 11
samycfd is on a distinguished road
Okay.
I used the trapezoidal approximation function of Matlab to integrate the RHS and it's around 9.0.
edit: the lid velocity has been set to 1 m/s .
This is my RHS :

samycfd is offline   Reply With Quote

Old   August 27, 2014, 10:38
Default
  #50
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
when computing the RHS of the pressure equation you need the values of the normal velocity along the walls, did you consider it is zero? The previous plot of the velocity seems not reporting the wall but only interior points
FMDenaro is offline   Reply With Quote

Old   August 28, 2014, 04:09
Default
  #51
Member
 
Join Date: Aug 2014
Posts: 58
Rep Power: 11
samycfd is on a distinguished road
when I export the velocity from FLUENT the values are located on the cell-center, so near the edges I won't have 0 for the normal velocity or 1 for the lid velocity because it's not really the edges but a little bit to the interior.

I tried to add boundaries to the velocity field( 0 everywhere for v and the same for u excepted on the lid where the velocity is set to 1 ). When I am doing that I don't need to set a Dirichlet point for pressure. But the RHS integral is different from 0. (10^4)

I will post some results so you can see.
samycfd is offline   Reply With Quote

Old   August 28, 2014, 04:50
Default
  #52
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
how do you construct the discrete source term in the pressure equation?
If you set the exact normal velocity component and have the correct discretization of the source term it should actually work and converge without fixing a value.
FMDenaro is offline   Reply With Quote

Old   August 28, 2014, 05:26
Default
  #53
Member
 
Join Date: Aug 2014
Posts: 58
Rep Power: 11
samycfd is on a distinguished road
I use finite difference to compute the first derivatives of u and v along x and y. and then I construct : RHS = mu/rho * ( Ux^2 +Vy^2 + 2*Uy*Vx ).
samycfd is offline   Reply With Quote

Old   August 28, 2014, 05:33
Default
  #54
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by samycfd View Post
I use finite difference to compute the first derivatives of u and v along x and y. and then I construct : RHS = mu/rho * ( Ux^2 +Vy^2 + 2*Uy*Vx ).

but how do you work on the boundary when the dp/dn=0 BC is applied?
FMDenaro is offline   Reply With Quote

Old   August 28, 2014, 05:41
Default
  #55
Member
 
Join Date: Aug 2014
Posts: 58
Rep Power: 11
samycfd is on a distinguished road
it could sound weird but I am doing nothing because I am using FEM and the Neumann boundaries ( dp/dn=0) are naturally applied.

Take a look at the variationnal problem ( weak formulation ) of div( grad P ) = RHS

int (grad P grad phi) - int ( dp/dn )|sur le bord = int ( RHS phi )

dp/dn = 0

finally we just have :
int (grad P grad phi) = int ( RHS phi )

And we can write this as a linear system KP = RHS where K is a stiffness matrix.

But maybe I am wrong...


And I want to add that I don't know exactly how dealing with the BC during the computation of derivatives with finite differences. At the moment I am using Neumann everywhere. So I am just copying the value to the edge so the gradient on the would be zero.
samycfd is offline   Reply With Quote

Old   August 28, 2014, 07:54
Default
  #56
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
ok, I'll try to give idea of how I would proceed in a Finite Volume approach....

Assume dv/dt=a=0, so that Div a=0. Assume Div (vv)=ac and Div (2ni Gradv)=ad.
Hence the momentum equation simply writes

ac + Grad P = ad


Therefore one gets
Div a= -Div ac-Div Grad P + Div ad=0.

This leads to the pressure equationDiv Grad P = Div (ad-ac)

with the BC.s

dP/dn = n.(ad-ac)

As a consequence, if you set dP/dn =0 then you must set also n.(ad-ac)=0.
For example, assume a 1D mesh, in the node i you have to discretize the pressure equation, with second order discretization one has

[(dP/dx)i+1/2 - (dP/dx)i-1/2]/dx = [(axd-axc)i+1/2 - (axd-axc)i-1/2]/dx


Assume for example that now the section i-1/2 lies on a wall where you have to set the BC.s. Consequently the previous equation writes


[P(i+1) - P(i)]/dx^2 = [(axd-axc)(i+1) +(axd-axc)(i)]/2dx

This is the correct implementation of the BC that, as you see, modifies also the source term in a way that the compatibility relation is satisfied.
FMDenaro is offline   Reply With Quote

Old   August 28, 2014, 08:05
Default
  #57
Member
 
Join Date: Aug 2014
Posts: 58
Rep Power: 11
samycfd is on a distinguished road
In the finite volume the source term is also modified, I agree but not in the Finite Element Method referring to a lot of papers about Neumann BC. I have never used the finite volume method. Do you advise me to use it instead of Finite Element?

When I was dealing only with rectangular grid I was using the Finite differences and I was modifying the souce term and the matrix of laplacian to implement Dirichlet or Neumann BC. ( And now I know that I have to use any kind of mesh I have to adapt the method and I choosed Finite element ... )
samycfd is offline   Reply With Quote

Old   August 28, 2014, 08:42
Default
  #58
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by samycfd View Post
In the finite volume the source term is also modified, I agree but not in the Finite Element Method referring to a lot of papers about Neumann BC. I have never used the finite volume method. Do you advise me to use it instead of Finite Element?

When I was dealing only with rectangular grid I was using the Finite differences and I was modifying the souce term and the matrix of laplacian to implement Dirichlet or Neumann BC. ( And now I know that I have to use any kind of mesh I have to adapt the method and I choosed Finite element ... )

I don't see how is possible theoretically that you set dP/dn=0 without changing (congruently) also the source term near the wall. Maybe you are referring as to some method where the correction is implicitly implemented by the shape function... but remember the FV is only a special case of FEM where you use a special step-wise shape function...therefore I suppose something is implicitly modified.

However, try using the procedure I suggested instead of discretizing the pressure equation directly in FD term
FMDenaro is offline   Reply With Quote

Old   August 28, 2014, 09:38
Default
  #59
Member
 
Join Date: Aug 2014
Posts: 58
Rep Power: 11
samycfd is on a distinguished road
I understand your point and I am starting to believe that I am wrong and of course it's wrong given the results.. .

I would like to, but I don't understand the whole point

1)
Quote:
[P(i+1) - P(i)]/dx^2 = [(axd-axc)(i+1) +(axd-axc)(i)]/2dx
Isn'it ? [P(i+1) - P(i)]/dx^2 = [(axd-axc)(i+1) +(axd-axc)(i-1)]/2dx

2) Finally you discretize the equation with FD in all interior nodes and apply a specific treatment for this discretization on the boundaries by set all the dp/dn value on edges to 0 ?
samycfd is offline   Reply With Quote

Old   August 28, 2014, 11:30
Default
  #60
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,768
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
1) No... the RHS is written by setting dP/dx|i-1/2= (axd-axc)i-1/2=0 at wall.
Thus the RHS becomes [(axd-axc)i+1/2]/dx. Then, assuming you know the values only at nodes in centroid (...i-1,i,i+1...) of the cells you can write a linear interpolation between i+1 and i

[(axd-axc)i+1/2]/dx=0.5*[(axd-axc)i+1 + (axd-axc)i ]/dx


2) I discretize in the interior nodes in a similar way... for example, in the 1D lines I write

[(dP/dx)i+1/2 - (dP/dx)i-1/2]/dx = [(axd-axc)i+1/2 - (axd-axc)i-1/2]/dx

as

[P(i+1)-2P(i)+P(i+1)]/dx^2 = [(axd-axc)i+1 - (axd-axc)i-1]/2dx
FMDenaro is offline   Reply With Quote

Reply

Tags
pressure velocity


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
static vs. total pressure auf dem feld FLUENT 17 February 26, 2016 13:04
Timestep and Pressure Correction Relationship in SIMPLE rks171 Main CFD Forum 23 May 4, 2012 01:04
Initial pressure and transverse velocity fields to initialize turbulence model nickvinn Main CFD Forum 0 February 29, 2012 10:11
How to set pressure BC with mass Velocity Magnitud arwang FLUENT 2 March 12, 2007 20:04
how to print the results from CFX-4.2 cfd_99 Main CFD Forum 5 June 21, 1999 09:23


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