CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Can anybody please check my boundary conditions? (https://www.cfd-online.com/Forums/openfoam/90934-can-anybody-please-check-my-boundary-conditions.html)

lovecraft22 July 25, 2011 14:10

Can anybody please check my boundary conditions?
 
1 Attachment(s)
Hi all;
I'm getting some strange results for a 2D circular cylinder run at 30 m/s, see this picture please:

http://dl.dropbox.com/u/2459663/1.png

Now, can anybody of you guys please check my case (attached) and tell me what I'm doing wrong?

Thank you!

srakshit July 25, 2011 16:12

Quote:

I'm getting some strange results for a 2D circular cylinder run at 30 m/s, see this picture please
In your setting,the velocity inlet is at 30 m/s but the outlet is at zeroGradient. This is creating the problem in your domain. keep the velocity constant at 30 m/s.

MasterCooler July 25, 2011 17:08

Hey lovecraft22,

without having had the files opened and analysed (I am in a windows session) it reminds me of a problem I had some months ago. Then as a really new user I did the mistake to violate the rules to create blocks in blockMesh. My block was created instead of in a right-hand in a left-hand coordinate system. It was very strange that I could create the blockMesh without having problems. Also I could show it in paraView where it looked really nice and as assumed. As I didn't expect any problem I didn't execute checkMesh but started the calculation directly. And saw really strange results, inexplicable and senseless results like yours.

Therefore the question: have you performed a checkMesh run and says checkMesh that your mesh is okay?

Further I can't comprehend the hint of srakshit. I did several simulation with fixedValue for inlet velocity and zeroGradient for outlet velocity. As I know it should work if you use a zeroGradient condition for pressure at the inlet and fixedValue condition for pressure at the outlet.

Cheers
MasterCooler

srakshit July 25, 2011 17:13

Yes, I agree with MasterCooler. Out of U and p, one value should be fixed for either inlet or outlet.

lovecraft22 July 26, 2011 02:18

Thanks to both of you.

I haven't performed a check mesh, I'll surely do that.
About my boundary conditions, how would you advise to set them as?

Thank you!

Balakrshnan Ramakrishnan July 26, 2011 08:25

can you please explain why you have mentioned

frontAndBack as symmetryPlane ?

and upper and lowerWall as empty?

Are you trying to do a simulation in Z direction???:confused:

lovecraft22 July 26, 2011 13:37

I'm trying to simulate a flow in the x-y plane, so the planes parallel to this have to be empty…

Balakrshnan Ramakrishnan July 26, 2011 13:40

are you sure??

can you try with frontAndBack with empty ,

upperWall and lowerWall with symmetry?

I think it will work.. :cool:

lovecraft22 July 26, 2011 13:50

1 Attachment(s)
Actually, if you look at my blockMeshDict you'll see that frontAndBack are the planes parallel to the xz plane (red in the following picture) while upperWall and lowerWall are the planes parallel to the xy plane (yellow in the following picture).
So, I think this boundary conditions should be fine…

srakshit July 26, 2011 15:59

If your domain is 1 cell thick in z direction, then keeping the frontAndBack patch as 'empty' will reduce the computational efforts (it wont solve U for that direction). Otherwise, i dont think it will matter. About the upper and lower wall, keeping them to 'symmetry' is a better choice. I have no idea what an empty patch will do at the wall, but again those area shouldn't effect the nature of flow you are working with.

Just use the suggestions mentioned earlier for your inlet and outlet boundary.

lovecraft22 July 26, 2011 16:29

Thank you Sukanata…
I haven't quite well understood what you mean with watch you suggested about the boundary conditions…

I'd really appreciate if you could give me some more detailed informations.

Thank you!

srakshit July 26, 2011 16:55

ok...since you are doing flow past a cylinder with 30 m/s velocity. Your inlet boundary is consistent (since Velocity is initialized and pressure is kept floating).
Problem is with your outflow boundary. Both of your variables are floating (which may be the reason for waves bouncing inside the domain and velocity rising upto 900 m/s.) Initialize either pressure or velocity for the the outlet. Try using 30 m/s for velocity outlet if outlet pressure is unknown.

lovecraft22 July 27, 2011 02:21

Ok, this way thought I'll set the velocity at the outlet at 30 m/s but that's not the physical case… Am I correct?

srakshit July 27, 2011 02:51

Are you validating some experiments?

If the pressure is unknown, you should define the velocity at the boundary. Keeping both of them floating is inconsistent. Since this is a steady state analysis of flow past a cylinder, you can assume a constant velocity.

lovecraft22 July 27, 2011 03:18

Ok, I'll set them as you suggested and we'll what comes out...

Just another quick question: which boundary conditions would you set if you were running a car in a free stream?

Thank you once again!

joel.lehikoinen July 27, 2011 03:22

If you are running an incompressible simulation you can naturally fix pressure at the outlet.

srakshit July 27, 2011 03:24

For an unsteady analysis, zero gradient for both pressure and velocity will be fine. But for steady state study, its better to have a steady state boundary for both inlet and outlet.

lovecraft22 July 27, 2011 07:31

Can't I set the pressure at the outlet to be the same as the freestream static pressure?

srakshit July 30, 2011 23:12

Yes, you can try setting the outlet pressure at freeStream.

lovecraft22 August 2, 2011 13:57

2 Attachment(s)
Hi again;
I changed the boundary conditions but I'm still getting some really strange results, se the picture attached: the free stream should be coming from left to right at 30 m/s.

I've also attached my new boundary conditions.

Does anybody have a clue of what's going on here?


Thank you!

srakshit August 3, 2011 04:47

Why the outlet pressure is set fixedValue = zero? It should be zeroGradient.

lovecraft22 August 3, 2011 06:53

2 Attachment(s)
Thank you Sukanta.

I changed the pressure boundary condition as the following:

Code:

boundaryField
{
    inlet
    {
        type            fixedValue;
        value          uniform 0;
    }

    outlet
    {
        type            zeroGradient;
    }

Now the overall flow field is more reasonable but the velocity is too high at some points and I still have some strange feature (see pic attached).

What do you think?


Thank you!

Balakrshnan Ramakrishnan August 3, 2011 07:00

Quote:

Originally Posted by srakshit (Post 318633)
Why the outlet pressure is set fixedValue = zero? It should be zeroGradient.

If the velocity is specified at the inlet, usually we take the case that outlet is at atmospheric pressure.
Since we use relative scale for pressure, we assume the atmospheric pressure is zero.
The outlet is to be set to zero if it is at atmospheric pressure.
If you get a pressure below zero, its less than atmospheric pressure.

I hope I am correct.

srakshit August 3, 2011 07:04

But why inlet is fixed at zero now? Change in to zeroGradient

You have 30 m/s constant flow. Just tell me one thing if U at inlet is 30 m/s and Pressure is zero in that patch...is it consistent?

Balakrshnan Ramakrishnan August 3, 2011 07:09

Quote:

Originally Posted by srakshit (Post 318660)
But why inlet is fixed at zero now? Change in to zeroGradient

You have 30 m/s constant flow. Just tell me one thing if U at inlet is 30 m/s and Pressure is zero in that patch...is it consistent?

I am not able to make the mesh given in this case since I use OF-1.7.x.
But from blockMeshDict I can say there is something wrong with naming the patches.
I guess in this case the patches inlet and outlet are swapped. But I am not sure.

:)
If the inlet is set to some velocity, say 30 m/s, the pressure is set to zeroGradient.
Also if the outlet is set to be with a pressure ( fixedValue )of zero , then the inlet
should be zeroGradient. I do this in my cases and I get good results

srakshit August 3, 2011 07:10

Quote:

If the velocity is specified at the inlet, usually we take the case that outlet is at atmospheric pressure.
Since we use relative scale for pressure, we assume the atmospheric pressure is zero.
The outlet is to be set to zero if it is at atmospheric pressure.
If you get a pressure below zero, its less than atmospheric pressure.

I hope I am correct.
I do not think the pressure specified in the solver is relative. So u should either keep it floating or keep the absolute pressure.

Balakrshnan Ramakrishnan August 3, 2011 07:21

Quote:

Originally Posted by srakshit (Post 318662)
I do not think the pressure specified in the solver is relative. So u should either keep it floating or keep the absolute pressure.

The solver uses Gauge pressure - reference to the atmospheric pressure- where atmospheric pressure is zero. In absolute pressures negative value is not possible(except in some cases like trees). But in our simulation we get negative pressures all the time. So it cannot be absolute pressure. whatever we do in normal CFD(everyday) is Gauge pressure.

Hope this helps

lovecraft22 August 3, 2011 07:48

1 Attachment(s)
1. I had to change the inlet condition also because otherwise I got an error which basically said that the solver couldn't find any reference cell for pressure.

2. Pressure is relative, so (I think) you can have 30m/s velocity with 0 pressure because that mean that the pressure s the same as ambient static pressure

3. Inlet and outlet are fine, just checked them in paraview.

4. I ran the simulation for another 1000 iterations and the strange behavior underlined in previous pic disappeared but I'm still getting way too high velocity…

Balakrshnan Ramakrishnan August 3, 2011 07:52

@lovecraft22

Why is there a zero velocity line (vertical streak of blue)at the inlet? is it due to your boundary conditions?

srakshit August 3, 2011 07:56

its because the velocity = 30 m/s at inlet.

what is the outlet velocity boundary in this case?

Balakrshnan Ramakrishnan August 3, 2011 07:56

1 Attachment(s)
May be you can have a look at my simulation -> see attached pic

lovecraft22 August 3, 2011 07:59

2 Attachment(s)
That's my inlet condition: he velocity is not 0 but 30m/s.

About the outlet, the velocity is around 3000 m/s!!
It's an hypersonic cylinder!

srakshit August 3, 2011 08:02

what boundary condition you are using for outlet?

Also what pRefValue you are using?

lovecraft22 August 3, 2011 08:08

Quote:

Originally Posted by Balakrshnan Ramakrishnan (Post 318679)
May be you can have a look at my simulation -> see attached pic

Could you upload your boundary conditions?

Thank you!

srakshit August 3, 2011 08:16

Try these boundary settings

for pressure

inlet
{
type freestreamPressure;
}

outlet
{
type freestreamPressure;
}

for velocity

inlet
{
type freestream;
freestreamValue uniform (30 0 0);
}

outlet
{
type freestream;
freestreamValue uniform (30 0 0);
}

lovecraft22 August 3, 2011 08:28

You have to define one pressure value at least.

I set the pressure value to 0 at the inlet and the rest as you suggested.
Now it's running, let's see what comes out.

Balakrshnan Ramakrishnan August 3, 2011 08:41

Quote:

Originally Posted by lovecraft22 (Post 318682)
That's my inlet condition: he velocity is not 0 but 30m/s.

About the outlet, the velocity is around 3000 m/s!!
It's an hypersonic cylinder!

Oops i thought you are just doing low velocity simulations.

which solver you use for hypersonic flows?

lovecraft22 August 3, 2011 08:43

I was just kidding about the fact that though I'm running a low velocity simulation yet I get an hypersonic velocity at the outlet…

Balakrshnan Ramakrishnan August 3, 2011 08:44

Quote:

Originally Posted by lovecraft22 (Post 318698)
I was just kidding about the fact that though I'm running a low velocity simulation yet I get an hypersonic velocity at the outlet…

Lol... :D

Which version of OF are you using?

lovecraft22 August 3, 2011 08:46

OpenFoam 2.0.0


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