CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

Inlet temperature = outlet temperature + offset?

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By GerHan
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 3, 2016, 08:06
Question Inlet temperature = outlet temperature + offset?
  #1
New Member
 
Hans
Join Date: Sep 2016
Posts: 8
Rep Power: 9
GerHan is on a distinguished road
Hello OpenFoamers,

i am new to OpenFoam since 2 month. I am simulation a hot waterflow into a big cylinder using the bouyantBoussinesqPimpleFoam solver.

I managed to set up the case and the results are looking good in my opinion. Now to my problem:

My 0/T file looks like:
internalField uniform 20;
boundaryField
{
inlet
{
type fixedValue;
value 80;
}
outlet
{
type zeroGradient;
}
...
}
Now i want to change my constant inlet Temperature while the simulation. I want to check the outlet temperature, add 10 degrees and use the new calculated falue as inlet value until i reached a maximum temperature at the outlet!
I read something about cyclic (e.g. jumpCyclic) conditions?
But in that case my complete inlet flow is "connected" to the outlet, which i didnt really managed to set up.
Is it maybe possible to read the temperature values at the outlet every timestep, add a constant value and use it as inlet temperature?

Thank you in advance for reading my problems !
GerHan is offline   Reply With Quote

Old   November 4, 2016, 09:05
Default
  #2
New Member
 
Hans
Join Date: Sep 2016
Posts: 8
Rep Power: 9
GerHan is on a distinguished road
Hello Openfoamers,

i found the groovyBC application and after installing and setting it up i managed to set the temperature from the outlet onto the inlet with my offset:
In 0/T:
...
inlet
{
type groovyBC;
valueExpression "tOutlet+10";
variables "tOutlet{outlet}=T;";
value uniform 293;//=20° C
}
outlet
{
type zeroGradient;
}

In the end it works fine for me.
The only strange thing i cant explain is that the temperature at the inlet is much bigger at the wall than in the middle of the tube.
But after a few iterations the hole inlet face reaches the calculated temperature "tOutlet+10".

Maybe someone knows about this strange behaviour...

Regards
Luttappy likes this.
GerHan is offline   Reply With Quote

Old   November 7, 2016, 17:14
Default
  #3
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by GerHan View Post
Hello Openfoamers,

i found the groovyBC application and after installing and setting it up i managed to set the temperature from the outlet onto the inlet with my offset:
In 0/T:
...
inlet
{
type groovyBC;
valueExpression "tOutlet+10";
variables "tOutlet{outlet}=T;";
value uniform 293;//=20° C
}
outlet
{
type zeroGradient;
}

In the end it works fine for me.
The only strange thing i cant explain is that the temperature at the inlet is much bigger at the wall than in the middle of the tube.
But after a few iterations the hole inlet face reaches the calculated temperature "tOutlet+10".

Maybe someone knows about this strange behaviour...

Regards
I'm amazed that this worked in the form here: your inlet and your outlet have the same number of faces, right?

The problem is that the "first" face in the inlet patch and the "first" one in the outlet do not necessarily correspond. Therefor remove variables should usually only have uniform values (swak doesn't enforce this for cases where it actually makes sense). So better values for tOutlet would be (in increasing order of "physicality"):
"tOutlet{outlet}=average(T);"
"tOutlet{outlet}=sum(T*area())/sum(area());"
"tOutlet{outlet}=sum(T*phi)/sum(phi);"

If you need the non-averaged values from the outlets then there is something called mappedPatch and swak can work with that. Have a look at Examples/tests/mapping*
Luttappy likes this.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   November 8, 2016, 09:33
Default
  #4
New Member
 
Hans
Join Date: Sep 2016
Posts: 8
Rep Power: 9
GerHan is on a distinguished road
Thank you very much for your reply gschaider,

Yes my inlet patch and cell formation look the same like on the outlet.
Thanks to your codeline "tOutlet{outlet}=average(T);" i dont get the warning massage anymore which i think is because of the unifrom values like you explained:

-->FOAM Warning :
From Function ExpressionResult::getUniformInternal(const label size,bool noWarn)
in file ExpressionResult/ExpressionResultI.H at line 350
The minimum value 293 and the maximum 293 differ. I will use the average 293

But the strange behaviour i mentioned still occurs with both of the first 2 codelines that you posted.
The third one is crashing with an Error.

But i am glad enough that i solved the warning message (and did understand it) and the temperature is constant over the diameter after a few iterations!!

Regards
GerHan is offline   Reply With Quote

Old   November 8, 2016, 15:15
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by GerHan View Post
Thank you very much for your reply gschaider,

Yes my inlet patch and cell formation look the same like on the outlet.
Thanks to your codeline "tOutlet{outlet}=average(T);" i dont get the warning massage anymore which i think is because of the unifrom values like you explained:

-->FOAM Warning :
From Function ExpressionResult::getUniformInternal(const label size,bool noWarn)
in file ExpressionResult/ExpressionResultI.H at line 350
The minimum value 293 and the maximum 293 differ. I will use the average 293

But the strange behaviour i mentioned still occurs with both of the first 2 codelines that you posted.
The third one is crashing with an Error.

But i am glad enough that i solved the warning message (and did understand it) and the temperature is constant over the diameter after a few iterations!!

Regards
Yeah. The third variation (mass flow average) crashes probably because sum(phi) is 0 in the beginning. Something like "tOutlet{outlet}=sum(T*(phi+1e-10))/sum(phi+1e-10);" might fix that

The warning you posted means that swak automatically defaulted to variation 1 all the time.

No idea about the wall (but it might have something to do with your intitial conditions and the wall BC)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   November 14, 2016, 06:36
Default
  #6
New Member
 
Hans
Join Date: Sep 2016
Posts: 8
Rep Power: 9
GerHan is on a distinguished road
Yes the new third version is running proprely.

But this doesnt fix the bahaviour as well, but for my case its good enough.
thanks a lot for your posts gschaider, it helped me a lot.

Regards
GerHan is offline   Reply With Quote

Reply

Tags
inlet bc temperature


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
massflow of inlet and outlet are not equal knoedl1 OpenFOAM Running, Solving & CFD 11 July 3, 2018 14:00
Want Impeller Driven Fluid Flow: What Inlet and Outlet BC to use for Centrifugal Pump Zev Xavier FLUENT 3 May 9, 2016 06:42
simpleFoam: Non-uniform mesh near inlet & outlet causes incorrect velocity profile? Zaphod'sSecondHead OpenFOAM Running, Solving & CFD 0 January 28, 2015 05:17
UDF profile: Fluent method for coupling inlet and outlet I-mech Fluent UDF and Scheme Programming 0 May 10, 2014 10:36
what the result is negatif pressure at inlet chong chee nan FLUENT 0 December 29, 2001 05:13


All times are GMT -4. The time now is 23:50.