CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   calculate nusselt with swak4Foam (http://www.cfd-online.com/Forums/openfoam-post-processing/98483-calculate-nusselt-swak4foam.html)

nimasam March 12, 2012 09:45

calculate nusselt with swak4Foam
 
Hi dear friends
im interested to use swak4Foam to calculate Nusselt along a patch.
is there any option to calculate patch gradient in swak4Foam?

gschaider March 12, 2012 10:40

Quote:

Originally Posted by nimasam (Post 348938)
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)

nimasam March 13, 2012 07:55

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?

gschaider March 13, 2012 18:54

Quote:

Originally Posted by nimasam (Post 349133)
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

nimasam May 13, 2012 01:32

Quote:

Originally Posted by gschaider (Post 349292)
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?

gschaider May 14, 2012 17:17

Quote:

Originally Posted by nimasam (Post 360760)
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.


All times are GMT -4. The time now is 17:02.