Laminar Isothermal Flow in a duct

 Register Blogs Members List Search Today's Posts Mark Forums Read

May 3, 2012, 13:55
#21
Senior Member

Filippo Maria Denaro
Join Date: Jul 2010
Posts: 3,809
Rep Power: 42
Quote:
 Originally Posted by HectorRedal Dear Madhukar, First of all, I would like to thank you for your ideas and help you had provided to me. Next, I am going to answer your questions, so as to pinpoint which is the problem with my code. The initial conditions for the problem are the following: - velocity equal to zero in all nodes that do not have a boundary condition for the velocity - pressure equal to zero in all nodes that do not have a boundary condition for the pressure. The time step is set to a value minor than the value specified for the CFL condition for this algorithm. After the first step of the algorithm, I have observed the following strange behaviour (I am using an structured grid formed with quad elements): For odd nodes, the velocity goes in the same direction than the velocity boundary conditions. For even nodes, the velocity goes in the contrary direction than the velocity boundary conditions. In the outlet, the velocity goes in the same direction as in the inlet, but as you can observe, there are a lot of nodes (inner nodes) that have the velocity with a direction opposite to the boundary conditions. Quite strange! Does this behaviour have to do with the incompressiblity of the fluid? Best regards,
I suspect you are simply encountering spurious solution, your patchwork resembles that one encountered with FV non-staggered grids...

First of all, I suggest starting with an initial condition of uniform flow everiwhere (U= constant, V=0) and a linear pressur law along x

May 5, 2012, 09:23
#22
New Member

Join Date: Nov 2010
Location: Bangalore, India
Posts: 20
Rep Power: 9
Quote:
 Originally Posted by HectorRedal Dear Madhukar, First of all, I would like to thank you for your ideas and help you had provided to me. Next, I am going to answer your questions, so as to pinpoint which is the problem with my code. The initial conditions for the problem are the following: - velocity equal to zero in all nodes that do not have a boundary condition for the velocity - pressure equal to zero in all nodes that do not have a boundary condition for the pressure. The time step is set to a value minor than the value specified for the CFL condition for this algorithm. After the first step of the algorithm, I have observed the following strange behaviour (I am using an structured grid formed with quad elements): For odd nodes, the velocity goes in the same direction than the velocity boundary conditions. For even nodes, the velocity goes in the contrary direction than the velocity boundary conditions. In the outlet, the velocity goes in the same direction as in the inlet, but as you can observe, there are a lot of nodes (inner nodes) that have the velocity with a direction opposite to the boundary conditions. Quite strange! Does this behaviour have to do with the incompressiblity of the fluid? Best regards,
Most likely. What element types are you using for the velocity and pressure?
Also, are you using split A or split B formulation for time-stepping (see Zienkiewicz's book) ?

May 6, 2012, 14:55
#23
Senior Member

Hector Redal
Join Date: Aug 2010
Posts: 201
Rep Power: 10
Quote:
 Originally Posted by madhukar_m_rao Most likely. What element types are you using for the velocity and pressure? Also, are you using split A or split B formulation for time-stepping (see Zienkiewicz's book) ?
I am using Quad elements in the mesh.

I am using the split A formulation for the time-stepping.
According to the reference (Zienkiewicz's book), this split allows the use of equal interpolation for the shape functions in quad elements.
I am using shape functions for the velocity and for the pressure with equal degrees for both.

May 7, 2012, 02:32
#24
New Member

Join Date: Nov 2010
Location: Bangalore, India
Posts: 20
Rep Power: 9
Quote:
 Originally Posted by HectorRedal I am using Quad elements in the mesh. I am using the split A formulation for the time-stepping. According to the reference (Zienkiewicz's book), this split allows the use of equal interpolation for the shape functions in quad elements. I am using shape functions for the velocity and for the pressure with equal degrees for both.
You can try one or both of the following:

[1] use a velocity/pressure element combination that satisfies BB.

[2] ensure global mass conservation by adjusting the outlet velocity field
such that the outlet mass flow matches the inlet mass flow.

Best regards,

May 7, 2012, 12:51
#25
Member

Join Date: May 2010
Posts: 61
Rep Power: 9
Quote:
 Originally Posted by madhukar_m_rao You can try one or both of the following: [1] use a velocity/pressure element combination that satisfies BB. [2] ensure global mass conservation by adjusting the outlet velocity field such that the outlet mass flow matches the inlet mass flow. Best regards, Madhukar
It seems that I did the same simulation work. I just set the all pressure conditions as zerogradient except the outlet one is fivedvalue 0.
And the velocity is uniform: U=1 and V=0 at inlet, fixed wall is zero and outlet is zerogradient.
the solution as shown in pic,the left down one is the velocity at inlet and right one is the velocity at x=4.
I find the velocity at the inlet is not zero but half of the inlet. I am not sure if the solution is right or not.
Thank you,
Wei
Attached Images
 velocity at x=0 and x=4.jpg (28.3 KB, 4 views)

Last edited by hewei; May 7, 2012 at 15:11.

May 7, 2012, 15:48
#26
Senior Member

Hector Redal
Join Date: Aug 2010
Posts: 201
Rep Power: 10
Quote:
 Originally Posted by madhukar_m_rao You can try one or both of the following: [1] use a velocity/pressure element combination that satisfies BB. [2] ensure global mass conservation by adjusting the outlet velocity field such that the outlet mass flow matches the inlet mass flow. Best regards, Madhukar

Firtst of all, I would like to thank you for your help and support.
After this, I would like to mention that accorting to the reference (Zienkiewicz, chapter 3.4: Circunventing the Babuska - Brezzi restricction ), split A avoids any restriction on the nature of the two shape functions used for velocity and for pressue.
As I have mentioned in an previous answer, I am using equal degree in both velocity shape functions and pressure shape functions.

According to this reference:
A finite element formulation for the Stokes problem allowing equal velocity-pressure interpolation. Ramon Codina - Jordi Blasco. Comput. Methods Appl. Mech. Engrg 143 (1997) 373 - 391, the use of equal velocity interpolation can be used in the CBS scheme algorithm.

Consequently, a doubt arises to me at this point. If according to Zienkiewicz and Codina/Blasco this type of interpolation functions are feasible, why are they failing in my case?

Kind regards.

May 7, 2012, 15:50
#27
Senior Member

Hector Redal
Join Date: Aug 2010
Posts: 201
Rep Power: 10
Quote:
 Originally Posted by hewei Hi Madhukar, It seems that I did the same simulation work. I just set the all pressure conditions as zerogradient except the outlet one is fivedvalue 0. And the velocity is uniform: U=1 and V=0 at inlet, fixed wall is zero and outlet is zerogradient. the solution as shown in pic,the left down one is the velocity at inlet and right one is the velocity at x=4. I find the velocity at the inlet is not zero but half of the inlet. I am not sure if the solution is right or not. Thank you, Wei
Hi Hewei,

I would like bring up the following question.
Are you using the same algorithm than me for carrying this simulation?
What I would like to know if you are using the CBS algorithm for the finite element method.

Best regards,

May 7, 2012, 17:11
#28
Member

Join Date: May 2010
Posts: 61
Rep Power: 9
Quote:
 Originally Posted by HectorRedal Hi Hewei, I would like bring up the following question. Are you using the same algorithm than me for carrying this simulation? What I would like to know if you are using the CBS algorithm for the finite element method. Best regards,
Hi Hector,
I used the OpenFoam to simulate the flow, as we know ,the OpenFoam is basically on FV method,I adopted the icoFoam to do that, so I am not sure this information may help you on FEM.

yours,
Wei

May 8, 2012, 00:05
#29
New Member

Join Date: Nov 2010
Location: Bangalore, India
Posts: 20
Rep Power: 9
Quote:
 Originally Posted by hewei Hi Madhukar, It seems that I did the same simulation work. I just set the all pressure conditions as zerogradient except the outlet one is fivedvalue 0. And the velocity is uniform: U=1 and V=0 at inlet, fixed wall is zero and outlet is zerogradient. the solution as shown in pic,the left down one is the velocity at inlet and right one is the velocity at x=4. I find the velocity at the inlet is not zero but half of the inlet. I am not sure if the solution is right or not. Thank you, Wei
Have you checked global mass conservation?

Assuming that you wrote your own code, you can check the results against
one of the freely available open source codes.

Best regards,

June 2, 2012, 07:04
#30
Senior Member

Hector Redal
Join Date: Aug 2010
Posts: 201
Rep Power: 10
Quote:
 Originally Posted by madhukar_m_rao Have you checked global mass conservation? Assuming that you wrote your own code, you can check the results against one of the freely available open source codes. Best regards, Madhukar

After struggling with the code, I discovered a bug in my code when assembling the force terms in the CBS Algorithm. The force term were correctly calculated, but the assembly utility failed to assemble the forces from each element.
Once I have fixed this bug, I have re-run the test case. I am enclosing the results I have obtained.

It appears to me that this are miles better than the ones I had previously got.

I have also updated the results for the lid driven cavity flow.
You can take a look at them in the following link:

I would like to thank all of you for your kind help and support.
Thank you very much!!!

Best regards,
Hector Redal
Attached Images
 LaminarIsothermalFlow.png (33.0 KB, 5 views)

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post junbbung FLUENT 1 December 2, 2012 06:57 rvallejo CFX 1 November 16, 2009 10:49 kjetil OpenFOAM Running, Solving & CFD 3 July 21, 2009 09:15 jane luo Main CFD Forum 15 April 12, 2004 17:49 Peter Kostka Main CFD Forum 3 May 9, 2002 17:02

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