CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

fixedGradient use

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

Like Tree2Likes
  • 1 Post By immortality
  • 1 Post By immortality

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 6, 2013, 13:34
Arrow fixedGradient use
  #1
Senior Member
 
James
Join Date: May 2013
Posts: 116
Rep Power: 12
Tensian is on a distinguished road
Hi everyone,

In my setup, I have an inlet and an outlet. The only info is that P_in=0 Pa and P_out=-20 Pa, so can I use fixedGradient in this way?

(p file)

in----type fixedValue
value 0
out---type fixedGradient
gradient -20

I guess itīs something more complex than this. If so, how can I compute my pressure gradient with the information I have?

Thanks.
Tensian is offline   Reply With Quote

Old   August 6, 2013, 16:39
Default
  #2
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
Hi
set both to fixedValue if you have their values and set velocities to fixedGradient.
temperature in inlet should be fixedValue and in outlet fixedGradient.
immortality is offline   Reply With Quote

Old   August 7, 2013, 04:42
Default
  #3
Senior Member
 
James
Join Date: May 2013
Posts: 116
Rep Power: 12
Tensian is on a distinguished road
Thanks for the reply Ehsan,

I am not sure if I understanding well. Do you mean :

(p file)

in----type fixedValue
value uniform 0

out---type fixedValue
value uniform -20

(u file)

in----type fixedGradient
gradient ???
out---type fixedGradient
gradient ???

If I set fixedValue for p and zeroGradient for U the solution converges but without physical meaning. Which values should I put for gradient in the U file???

Thank you so much
Tensian is offline   Reply With Quote

Old   August 7, 2013, 05:14
Default
  #4
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
U's should be zeroGradient when p value is specified.how you say its physically meaningless? you should specify p and T in inlet and only p at outlet.
immortality is offline   Reply With Quote

Old   August 7, 2013, 05:41
Default
  #5
Senior Member
 
James
Join Date: May 2013
Posts: 116
Rep Power: 12
Tensian is on a distinguished road
Ehsan,

I attach the files of my last simulation. It has no physical meaning because I expect velocitites between 4-6 m/s and pressure values of about 0/-20 Pa, and the results starts to increase in magnitude until they reach values of about 1e10 in both variables.
Is anyone understanding what's happening? I have used zeroGradient instead of pressureInletVelocity in a first stage, but nothing seems to change...

P file
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 2 -2 0 0 0 0];

internalField uniform 0;

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

in_right
{
type fixedValue;
value uniform 0;
}

out
{
type fixedValue;
value uniform -20;
}

wall
{
type zeroGradient;
}


}

U file
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
in_left
{
type pressureInletVelocity;
value uniform (0 0 0);
}

in_right
{
type pressureInletVelocity;
value uniform (0 0 0);
}

out
{
type zeroGradient;
}

wall
{
type fixedValue;
value uniform (0 0 0);
}


}

// ************************************************** *********************** //

T file

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [ 0 0 0 1 0 0 0 ];

internalField uniform 293;

boundaryField
{

in_left
{
type fixedValue;
value uniform 293;
}
in_right
{
type fixedValue;
value uniform 293;
}
out
{
type zeroGradient;
}
wall
{
type fixedValue;
value uniform 306;
}


}


// ************************************************** *********************** //

I am a beginner so if someone knows a better way to make the set up, I only have a channel (a little complex) with two inlets, an outlet and a wall. I know pressure at inlet and at oultlet, I have no info about verlocities and I know temperature values on the boundaries.

Thanks for all your help, itś difficult to star with OF alone...
Tensian is offline   Reply With Quote

Old   August 7, 2013, 16:54
Default
  #6
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
Hi
is your case incompresseble or compressible?
its nice if you could send me your case so that I can have a look into it(delete unnecessary files if you want to send for little space)
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 8, 2013, 05:56
Default
  #7
Senior Member
 
James
Join Date: May 2013
Posts: 116
Rep Power: 12
Tensian is on a distinguished road
Hi Ehsan,

I am working with stationary, incompressible and laminar flow (low Re and M, and quasistationary state due to the values of Strouhal and Womersley numbers). I attach my files (excep mesh file, I am not allowed to share it). I am a beginner in OF. but I have tried several things realted to BCs, URFs, nonOrthogonalCorrectors...and always failed!I cannot understand why pressure driven flows gives so many problems.

If you see something wrong or you have any suggestions Iĺl be very grateful (I have been working on this issue several weeks, and all threads related seems to have similar troubles)

Thank you for your knoweldge Ehsan!

(I read some of your posts, it will be useful for me to start using pressureTools, but first I need to solve this!)CASE_PRESSURE_DRIVEN.tar.gzCASE_PRESSURE_DRIVEN.tar.gz
Tensian is offline   Reply With Quote

Old   August 9, 2013, 15:30
Default
  #8
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
Hi
set internalField to -.25 and test it and after that if not resolved set "value uniform 4" for velocity.
why nNonOrthogonalCorrectors set to 8?is your mesh unstructured? its too high.it better be 3 for maximum for bad meshes.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 10, 2013, 05:54
Default
  #9
Senior Member
 
James
Join Date: May 2013
Posts: 116
Rep Power: 12
Tensian is on a distinguished road
Thanks Ehsan, but I am not sure if I am understanding well:

You say "set internalField to -.25 and test it and after that if not resolved set "value uniform 4" for velocity"

1. Do you mean that I have to write in p file:

internalField uniform -0.25 or -25 for the initial condition??

2. If I have no success, you suggest that I write:

internalField uniform (0 4 0) or this magnitude you propose is related to any BC in the U file?

Why have you made this choice? Are these values arbitrary or you have used any theoreticall results? Please give me some light over this...

Thank you so much for your help, I hope I can return to you some day...
Tensian is offline   Reply With Quote

Old   August 10, 2013, 07:41
Default
  #10
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
Hi James
you have put -0.25 in out:
out
{
type fixedValue;
value uniform -0.25;
}
it should be -0.25 or -25?
I say one time set internalField value same as outlet(-25 or -.25 ?) instead of inlet value(0),
set that value for velocity on inlet patches,that value only used for first iteration and may be better that it has some velocity instead of starting from rest,and 4 is a guess only test it for 1 or 6 too.
your welcome.hope this resolved.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 12, 2013, 07:13
Default
  #11
Senior Member
 
James
Join Date: May 2013
Posts: 116
Rep Power: 12
Tensian is on a distinguished road
Hi Ehsan,

Unfortunately, I have no success with only establishing the internalField of pressure file the same as the outle value. At first (maybe the first 30 iterations) all looks good, but then suddenly residuals started to rise up and values of pressure and velocity explodes.

I am not understanding how to use the other advise. If I set a value for velocity in patches I guess I am changing the problem (or at least overconstraining it, because at these boundaries I have established info for pressure).

Do you think it is a good practise??

For example:

p file:

internalField uniform -20

in---fixedValue 0
out--fixedValue -20
wall---zeroGradient

U file

internalField uniform 1 (this value is a guess as you said?)

in---pIOV (0 0 0) (or a zeroGRadient??)
out---zeroGradient (or a fixedValue, the same as I put in internalField 1??)
wall---fixedValue uniform (0 0 0)

I am disappointed, I see many degrees of freedom (maybe the problem is the mesh, but I have tried three or four different mesh configurations, or perharps the problem is turbulence, because I am on limit of laminar-turbulent flow, or even the sharp geometry makes solovers go crazy...)

Thank you so much for all your recommendations!
Tensian is offline   Reply With Quote

Old   August 12, 2013, 08:30
Default
  #12
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
Hi
its good if you send me your mesh so that I can run it to see what happen.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 13, 2013, 04:21
Default
  #13
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
have a look:http://www.cfd-online.com/Forums/ope...tml#post442470
Tensian likes this.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Old   August 13, 2013, 11:31
Default
  #14
Senior Member
 
James
Join Date: May 2013
Posts: 116
Rep Power: 12
Tensian is on a distinguished road
Ehsan,

All looks great!I am starting simulation and residuals are falling and magnitude of variables remain bounded as expected! At first it looks like OF diverges a little with respect to FLUENT values, I need to do a grid independency study. But nothing could be possible without your last post!

Thank you so much, your help was awesome!

I only have one doubt. If I want to establish a pressure gradient of 20 Pa, how can I set the static pressure at the outlet? I have P_total_in=101325 Pa, P_total_out=101305 Pa, but P_static_out=P_total_out-0.5*rho*v^2, but I donīt have info about velocity values at the outlet. Is it enough to set a fixedValue of 101305) I guess I have to compute first dynamic pressure, but I donīt know how without v values.

Once again THANK YOU VERY MUCH FOR SHARING KNWOLEDGE!
Tensian is offline   Reply With Quote

Old   August 13, 2013, 11:59
Default
  #15
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 26
immortality is on a distinguished road
I'm glad your problem resolved.could you send me the corrected case?
you should set something lower than 101325 in outlet and let solver compute the velocity there after that look that if p0 is 101325 or is lower or upper and adjust pressure,but I don't understand,if total pressures are the same then what makes the flow of fluid?
and could you do something for me? please click on balance button in one of my posts you like and approve that.so my rep power can be increased and correct! thanks
Tensian likes this.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
fixedGradient BC type with the channelOodles solver Bedotto OpenFOAM Running, Solving & CFD 5 April 15, 2019 09:49
fixedGradient BC immortality OpenFOAM Pre-Processing 0 July 5, 2013 02:17
fixedGradient BC w/ non-uniform wall spacing brent_craven OpenFOAM 5 September 19, 2012 12:12
wall temperature fixedGradient in buoyantBoussinesqSimpleFoam David_010 OpenFOAM 0 February 8, 2010 10:05
fixedGradient boundary condition skabilan OpenFOAM Running, Solving & CFD 2 December 3, 2009 13:55


All times are GMT -4. The time now is 18:26.