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)

HectorRedal April 25, 2012 06:15

Laminar Isothermal Flow in a duct
 
Hello,

First of all, I would like to say that I have developed a code using the FEM (Finite Element Method) based on the CBS (Characteristic Based Split) Algorithm.
Using this code, now, I would like to simulate a Laminar Isothermal Flow in a rectangular channel for an incompressible flow.

I have set up the following boundary conditions:
1. Inlet condition:
U1 = 1.0 U2 = 0.0
2. Solid wall condition (walls of the rectangular channel/duct)
U1 = 0.0 U2 = 0.0
3. Outlet condition:
P = 0.0

But, to my surprised, using this boundary conditions for an incompressible fluid flow, what I get is a recirculation of the flow. When stating a recirculation, I mean to say that the flow at the end of the duct (outlet) enters the domain instead of following the inlet velocity.
Very strange.

I cannot see the flow developing with the length of the duct / channel.

Does anybody have an idea why this is happening?
Do I have missed anything?

Best regards,
Hector.

cdegroot April 25, 2012 10:59

What are the rest of your BCs? How do you specify pressure at the inlet and walls and how do you specify velocity at the outlet? Is the duct long enough for the flow to exit fully-developed?

BMCombustor April 25, 2012 11:15

Regardless of the duct length, you shouldn't have recirculation. I don't know how you set up pressure outlet but why don't you change your outlet BC to outflow? By that, you just need to set zero gradient for all variables at your outlet and just check for the continuity to be satisfied.

HectorRedal April 25, 2012 18:49

Quote:

Originally Posted by cdegroot (Post 356938)
What are the rest of your BCs? How do you specify pressure at the inlet and walls and how do you specify velocity at the outlet? Is the duct long enough for the flow to exit fully-developed?

Neither do I specify the pressure at the inlet nor at the walls.
In the inlet and in the walls I specify the velocity.
I only specify the velocity at the inlet. I don't specify the pressure at the outlet.
The length of the duct is ten time the required length for the flow to be developed.

HectorRedal April 25, 2012 18:55

Quote:

Originally Posted by BMCombustor (Post 356943)
Regardless of the duct length, you shouldn't have recirculation. I don't know how you set up pressure outlet but why don't you change your outlet BC to outflow? By that, you just need to set zero gradient for all variables at your outlet and just check for the continuity to be satisfied.

Do you refer by outflow condition to null velocity gradient?

cdegroot April 25, 2012 19:34

Quote:

Originally Posted by HectorRedal (Post 357053)
Neither do I specify the pressure at the inlet nor at the walls.
In the inlet and in the walls I specify the velocity.
I only specify the velocity at the inlet. I don't specify the pressure at the outlet.
The length of the duct is ten time the required length for the flow to be developed.

Hmm... you need to have a boundary condition for both velocity and pressure at all boundaries. You should be extrapolating pressure to the inlet and wall boundaries. Is that what you mean by not specifying pressure perhaps?

BMCombustor April 25, 2012 20:08

Quote:

Originally Posted by HectorRedal (Post 357054)
Do you refer by outflow condition to null velocity gradient?

I'm not familiar with the term "null velocity gradient" but I mean that for general variable "PHI" at outlet node is equal to its neighbor, i.e. PHI(N,J)=PHI(N-1,J) which N stands for the outlet node.

doctor evil April 25, 2012 23:30

I'm not quite sure about what did u mean by "3. Outlet condition:P = 0.0". But I guess the outlet BC might be the problem. I agree with BMCombustor's reply.

madhukar_m_rao April 26, 2012 04:57

Assuming that the CBS has been implemented following the description in "The Finite Element Method - Vol. 3" by Zienkiewicz, Taylor, and Nithiarasu, Chapter 3, the boundary conditions for outflow have been discussed in section 3.8.1 of that book.

HectorRedal April 27, 2012 11:36

1 Attachment(s)
Quote:

Originally Posted by cdegroot (Post 357058)
Hmm... you need to have a boundary condition for both velocity and pressure at all boundaries. You should be extrapolating pressure to the inlet and wall boundaries. Is that what you mean by not specifying pressure perhaps?

May I can disagree with you on this?

I am following an example of the following book:
Fundamentals of the Finite Element Method for Heat and Fluid Flow.
Roland W. Lewis and Perumal Nithiarasu.
Example 7.01.1, on page 218.
As an attachment, I have uploaded the drawing that appears for this example.
You can see, that on boundaries you only need to specify one of the variables: either pressure or velocity.

On the other hand, I totally agree with you that on boundaries you need to extrapolate the pressure, but in my opinion using the velocity boundary condition, and the conservation momentum equation.

Do you agree on this?

HectorRedal April 27, 2012 11:41

Quote:

Originally Posted by BMCombustor (Post 357063)
I'm not familiar with the term "null velocity gradient" but I mean that for general variable "PHI" at outlet node is equal to its neighbor, i.e. PHI(N,J)=PHI(N-1,J) which N stands for the outlet node.

Sorry for the misleading information I could have provided you with.
When stating "null velocity gradient", I mean to say that the gradient of the velocity is null. This is equivalent to say that at the far end of the duct, the velocity at one point is the same as the velocity of their neighbors. I think that this statement is in agreement with what you have stated.

Maybe then I need to change the boundary condition at the end of the duct for a boundary condition that enforces this condition.

Thanks for your help and support.

HectorRedal April 27, 2012 11:46

Quote:

Originally Posted by madhukar_m_rao (Post 357133)
Assuming that the CBS has been implemented following the description in "The Finite Element Method - Vol. 3" by Zienkiewicz, Taylor, and Nithiarasu, Chapter 3, the boundary conditions for outflow have been discussed in section 3.8.1 of that book.

Hello madhukar.

As you have correctly mentioned, I am following the description of the book from Zienkiewicz.
But, I am trying to simulate the example that appears on other book:
Fundamentals of the Finite Element Method for Heat and Fluid flow, W. Lewis and P. Nithiarasu.
You can find it on chapter 7.10.1.
I have uploaded in a previous response a copy of the drawing that appears in the book related to this example.

You can take a look at it.
Any comment suggestion will be highly appreciated.

Thanks for your comments and support.

cdegroot April 27, 2012 11:51

Quote:

Originally Posted by HectorRedal (Post 357502)
May I can disagree with you on this?

I am following an example of the following book:
Fundamentals of the Finite Element Method for Heat and Fluid Flow.
Roland W. Lewis and Perumal Nithiarasu.
Example 7.01.1, on page 218.
As an attachment, I have uploaded the drawing that appears for this example.
You can see, that on boundaries you only need to specify one of the variables: either pressure or velocity.

On the other hand, I totally agree with you that on boundaries you need to extrapolate the pressure, but in my opinion using the velocity boundary condition, and the conservation momentum equation.

Do you agree on this?

You may indeed disagree. First, I must admit I am not experienced in finite element methods; my background is in finite volume methods. However, in order to have a well-posed mathematical problem, a parabolic PDE needs conditions on all boundaries. If your numerical method somehow internally takes care of the pressure at boundaries where it is not specified, then fine, but this is still a boundary condition. Can you perhaps elaborate on how your method treats pressure at boundaries where it is unspecified? Similarly, how are you treating velocity at the outlet?

FMDenaro April 27, 2012 17:01

Can I have some answer about the following points?
- Are you using a 2D steady or unsteady formulation ? What about your Re number?
- Have you checked the divergence-free constraint in each element?
- What about the shape functions for V and p?
- Have you checked if the solution is independent from the fixed pressure value? It must be...

madhukar_m_rao April 28, 2012 10:41

Dear Hector,

Have you validated your code for the driven cavity problem or any similar benchmark problem without inlet/outlet?

For the channel problem, how are you calculating / setting the pressure at the inlet
and the velocities at the outlet? (See Fig 3.2 in Zienkiewicz's book).

Regards,

HectorRedal April 28, 2012 11:13

Quote:

Originally Posted by madhukar_m_rao (Post 358101)
Dear Hector,

Have you validated your code for the driven cavity problem or any similar benchmark problem without inlet/outlet?

For the channel problem, how are you calculating / setting the pressure at the inlet
and the velocities at the outlet? (See Fig 3.2 in Zienkiewicz's book).

Regards,

Dear Madhukar,

I have validated my code towards the benchmark typical test case that is the lid driven cavity flow problem, as you precisely has stated.
The results that I am getting for this test case can be found at the following link to my personal web site:
https://sites.google.com/site/hector.../cfd-example-1

They are not very good results. There is a slightly error. I bitterly must admit that I don't know where the problem is. I am struggling to discover where the error is.

Regarding the boundary conditions, as mentioned before, I do not set neither the pressure at the inlet, nor the velocity at the outlet.

Kind regards,

HectorRedal April 28, 2012 11:17

Quote:

Originally Posted by FMDenaro (Post 357567)
Can I have some answer about the following points?
- Are you using a 2D steady or unsteady formulation ? What about your Re number?
- Have you checked the divergence-free constraint in each element?
- What about the shape functions for V and p?
- Have you checked if the solution is independent from the fixed pressure value? It must be...

Dear Filippo,

I am using a unsteady formulation.
The Reynolds number I am using is 10 (Re = 10).
I am using the an equal shape formulation for the Velocity and Pressure fields.
I have not checked if the solution is independent from the fixed pressure value, but once I check it, I will come back with the results.

Thanks for your help and support.
Kind regards.

FMDenaro April 28, 2012 13:15

Quote:

Originally Posted by HectorRedal (Post 358158)
Dear Filippo,

I am using a unsteady formulation.
The Reynolds number I am using is 10 (Re = 10).
I am using the an equal shape formulation for the Velocity and Pressure fields.
I have not checked if the solution is independent from the fixed pressure value, but once I check it, I will come back with the results.

Thanks for your help and support.
Kind regards.

ok,m don't forget to check the divergence-free constraint.
Furthermore, how do you check the steady condition? I am not an expert of FEM, however I remember that velocity and pressure should have different degree in the shape functions, try to check the BB conditions.
Are you using a coupling velocity-pressure formulation?

madhukar_m_rao May 1, 2012 01:05

Quote:

Originally Posted by HectorRedal (Post 358156)
Dear Madhukar,

I have validated my code towards the benchmark typical test case that is the lid driven cavity flow problem, as you precisely has stated.
The results that I am getting for this test case can be found at the following link to my personal web site:
https://sites.google.com/site/hector.../cfd-example-1

They are not very good results. There is a slightly error. I bitterly must admit that I don't know where the problem is. I am struggling to discover where the error is.

Regarding the boundary conditions, as mentioned before, I do not set neither the pressure at the inlet, nor the velocity at the outlet.

Kind regards,

[1] Regarding the driven cavity case on your website, you can try
mesh refinement to see if you get a better match.

[2] I would recommend verification and validation as described in the
book, "Verification of Computer Codes in Computational Science and
Engineering," by Knupp and Salari, Chapman & Hall/CRC, 2003.

[3] For the channel problem, what are your initial conditions?
and time step?

[4] After the first time step, what is the computed pressure at the
inlet nodes and the computed velocities at the outlet nodes?

HectorRedal May 3, 2012 13:31

Quote:

Originally Posted by madhukar_m_rao (Post 358573)
[1] Regarding the driven cavity case on your website, you can try
mesh refinement to see if you get a better match.

[2] I would recommend verification and validation as described in the
book, "Verification of Computer Codes in Computational Science and
Engineering," by Knupp and Salari, Chapman & Hall/CRC, 2003.

[3] For the channel problem, what are your initial conditions?
and time step?

[4] After the first time step, what is the computed pressure at the
inlet nodes and the computed velocities at the outlet nodes?

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,


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