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

calculate nusselt with swak4Foam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 12, 2012, 09:45
Default calculate nusselt with swak4Foam
  #1
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,111
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
Hi dear friends
im interested to use swak4Foam to calculate Nusselt along a patch.
is there any option to calculate patch gradient in swak4Foam?
nimasam is offline   Reply With Quote

Old   March 12, 2012, 10:40
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,905
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by nimasam View Post
Hi dear friends
im interested to use swak4Foam to calculate Nusselt along a patch.
is there any option to calculate patch gradient in swak4Foam?
Have a look at http://openfoamwiki.net/index.php/Co...her_field_are: (I think snGrad is what you're looking for)
gschaider is offline   Reply With Quote

Old   March 13, 2012, 07:55
Default
  #3
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,111
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
Quote:
functions
(
NusseltNumber
{
type patchExpression;
patches (
down
);
verbose true;
variables (
"Tsat=500;"
"lc2D=0.0786;"
);
expression "lc2D*snGrad(T)/(T-Tsat)";
accumulations (
max
min
average
);
}

);
the last question, how i can save it as a patch value for all patch faces! not just max, min or average value?
nimasam is offline   Reply With Quote

Old   March 13, 2012, 18:54
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,905
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by nimasam View Post
the last question, how i can save it as a patch value for all patch faces! not just max, min or average value?
Depends on what you want to do. There is a dumpSwakExpression-functionObject. That dumps all the values. The order is the order of the faces in the patch. So to make sense of this you've got to know that

If you want postprocess the boundary values in paraview then the best guess is to use the readFields-FO that comes with OpenFOAM to read a field that defines a groovyBC with that expression
gschaider is offline   Reply With Quote

Old   May 13, 2012, 01:32
Default
  #5
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,111
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
Quote:
Originally Posted by gschaider View Post
Depends on what you want to do. There is a dumpSwakExpression-functionObject. That dumps all the values. The order is the order of the faces in the patch. So to make sense of this you've got to know that
i did it,
Quote:
If you want postprocess the boundary values in paraview then the best guess is to use the readFields-FO that comes with OpenFOAM to read a field that defines a groovyBC with that expression
yes i want it for postProcessing in paraView, so tell me how i can manage it?
nimasam is offline   Reply With Quote

Old   May 14, 2012, 17:17
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,905
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by nimasam View Post
i did it,

yes i want it for postProcessing in paraView, so tell me how i can manage it?
Well. You need a field file where the boundary condition is set to the expression you want to visualize. The internalField and the "uninteresting" BCs can be uniform (or zeroGradient for the patches). Then in the input panel of the reader (whichever of the both you use) select in addition to the internalField the patch you're interested in. With the "Extract Block"-filter select that patch and visualize it in any way you see fit.

The "interesting" part is getting the patch field. Currently not sure how to do that in a functionObject. One way would be to write a field where the expression is "written" in a groovyBC in the initial timestep and then run the replayTransientBC-utility on it. The other would be to write a similar file but with a fixedValue-BC and then use funkySetBoundaryField to set the value-entry. The advantage of the second approach is that it works for the initial timestep as well.
gschaider is offline   Reply With Quote

Old   September 5, 2013, 11:37
Default
  #7
Member
 
Join Date: Jun 2011
Posts: 64
Rep Power: 5
maalan is on a distinguished road
Hi!

Quote:
Have a look at http://openfoamwiki.net/index.php/Co...her_field_are: (I think snGrad is what you're looking for)
Is there any function to calculate the curl(U) on a patch??
maalan is offline   Reply With Quote

Old   September 5, 2013, 14:19
Default
  #8
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,905
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by maalan View Post
Hi!



Is there any function to calculate the curl(U) on a patch??
No. I've explained it several times before: differential operators can only be calculated for the whole field at once and I don't want to trigger a calculation on thousands (millions) of cells just to update a few hundred faces, If a user wants that he should create that field with an expressionField-functionObject (curlU for instance) and then use it in his BC. Only downside is that this only happens at the end of the time-step. So for a solver that does several loops per timestep it might be inaccurate. But if it is for a patchExpression, swakExpression it shouldn't be a problem
__________________
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   September 6, 2013, 03:54
Default
  #9
Member
 
Join Date: Jun 2011
Posts: 64
Rep Power: 5
maalan is on a distinguished road
Quote:
No. I've explained it several times before: differential operators can only be calculated for the whole field at once and I don't want to trigger a calculation on thousands (millions) of cells just to update a few hundred faces, If a user wants that he should create that field with an expressionField-functionObject (curlU for instance) and then use it in his BC. Only downside is that this only happens at the end of the time-step. So for a solver that does several loops per timestep it might be inaccurate. But if it is for a patchExpression, swakExpression it shouldn't be a problem
Thanks for your reply bernhard, although I have looked for it and find nothing!!
In fact, I meant calculate the curl(U) by using functionObjects. So, if I try to calculate the curl(U) just in the patch I get this error:

Code:
--> FOAM FATAL ERROR: 
 Parser Error for driver PatchValueExpressionDriver at "1.1-4" :"field curl not existing or of wrong type"
"curl(U)"
  ^^^^
--|
I assume you mean calculate and store the curl(U) in the volume by means of an expressionField and then use the stored e.g. 'curlU' in the expression within the patchExpresion, isn't it?? In this way it works though I was not very sure of being right.

On the other hand, for a surface integral on a patch, always by using swakExpressions, should I use 'mag(Sf())' as 'dS' term as in the volume one I use 'vol()' as 'dV'??

Thank you very much!
maalan is offline   Reply With Quote

Old   September 6, 2013, 06:43
Default
  #10
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,905
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by maalan View Post
Thanks for your reply bernhard, although I have looked for it and find nothing!!
In fact, I meant calculate the curl(U) by using functionObjects. So, if I try to calculate the curl(U) just in the patch I get this error:

Code:
--> FOAM FATAL ERROR: 
 Parser Error for driver PatchValueExpressionDriver at "1.1-4" :"field curl not existing or of wrong type"
"curl(U)"
  ^^^^
--|
I assume you mean calculate and store the curl(U) in the volume by means of an expressionField and then use the stored e.g. 'curlU' in the expression within the patchExpresion, isn't it?? In this way it works though I was not very sure of being right.
That's exactly what I said with
"expressionField-functionObject (curlU for instance) and then use it in his BC"
(it may be a bit brief but as my time is limited I expect people to at least spend as much time reading the stuff as it took me to write it. Arrogant, I know. But that's me)

Quote:
Originally Posted by maalan View Post
On the other hand, for a surface integral on a patch, always by using swakExpressions, should I use 'mag(Sf())' as 'dS' term as in the volume one I use 'vol()' as 'dV'??

Thank you very much!
I'm not aware of vol() being implemented for patches. An exhaustive list of functions defined on patches can be found in Documentation/swakReference. Or an incomplete (but still valid) list for functions on patches at http://openfoamwiki.net/index.php/Contrib_groovyBC
__________________
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

Reply

Tags
nusselt, patch gradient, swak4foam

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
swak4Foam to calculate bubble velocity nimasam OpenFOAM 1 March 1, 2012 15:10
Calculate pressure between internal faces (with swak4foam) Kalas OpenFOAM Post-Processing 1 February 3, 2012 05:18
How to calculate Nusselt number SeRGeiSarov Main CFD Forum 4 May 6, 2009 01:57
how to calculate Nusselt number,in CFX? prayskyer CFX 2 June 19, 2006 01:24
how to calculate Nusselt number? prayskyer Main CFD Forum 0 June 17, 2006 20:57


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