CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Laminar Isothermal Flow in a duct (https://www.cfd-online.com/Forums/main/100409-laminar-isothermal-flow-duct.html)

FMDenaro May 3, 2012 13:55

Quote:

Originally Posted by HectorRedal (Post 359153)
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

madhukar_m_rao May 5, 2012 09:23

Quote:

Originally Posted by HectorRedal (Post 359153)
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) ?

HectorRedal May 6, 2012 14:55

Quote:

Originally Posted by madhukar_m_rao (Post 359470)
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.

madhukar_m_rao May 7, 2012 02:32

Quote:

Originally Posted by HectorRedal (Post 359579)
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,
Madhukar

hewei May 7, 2012 12:51

1 Attachment(s)
Quote:

Originally Posted by madhukar_m_rao (Post 359656)
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

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

HectorRedal May 7, 2012 15:48

Quote:

Originally Posted by madhukar_m_rao (Post 359656)
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

Dear 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.

HectorRedal May 7, 2012 15:50

Quote:

Originally Posted by hewei (Post 359776)
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,

hewei May 7, 2012 17:11

Quote:

Originally Posted by HectorRedal (Post 359799)
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

madhukar_m_rao May 8, 2012 00:05

Quote:

Originally Posted by hewei (Post 359776)
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,
Madhukar

HectorRedal June 2, 2012 07:04

1 Attachment(s)
Quote:

Originally Posted by madhukar_m_rao (Post 359838)
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

Hi 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.

What's your impression about these new results?

I have also updated the results for the lid driven cavity flow.
You can take a look at them in the following link:
https://sites.google.com/site/hector.../cfd-example-1

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

Best regards,
Hector Redal


All times are GMT -4. The time now is 19:34.