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/)
-   -   Small toolkit for reconstructing and interpolating fields (http://www.cfd-online.com/Forums/openfoam-post-processing/104747-small-toolkit-reconstructing-interpolating-fields.html)

wyldckat July 14, 2012 19:33

Small toolkit for reconstructing and interpolating fields
 
Greetings to all!

After looking into the issue described in this thread: http://www.cfd-online.com/Forums/ope...rsion-dat.html - I decided to look deeper into this and created a couple of hopefully useful utilities based on OpenFOAM technology for both direct usage, as well as educational purposes:
This thread is therefore hereby open for traditional QA related to this project ;)

Best regards,
Bruno

zfaraday January 19, 2015 13:56

Dear Bruno,

I'm working in a case where I need to create some fields with the function object ExpressionField. These fields are of the type surfaceScalarField (I tried to do it with volScalarFields but I had problems since these fields are manipulated only at patches). As they are surfaceScalarFields I can't display them in paraview, for this reason I asked in another thread what I could do regarding this issue. I was told about the tool you developed (you can find more info here:using swak4foam to implement a BC for heat convection with h(Tamb,Twall)) so I gave it a try to see if it was what I really needed.

At first, it looked like it was going to suit my needs perfectly. However, when I tried it I found out that it was developed to work only for single domain cases (it has no -region flag). My case is a multi region one so, as far as I know, this tool is not usable in my case. Is there any solution to it?

Thanks in advance.


Alex

wyldckat January 19, 2015 15:48

Greetings Alex,

Quote:

Originally Posted by zfaraday (Post 528174)
However, when I tried it I found out that it was developed to work only for single domain cases (it has no -region flag). My case is a multi region one so, as far as I know, this tool is not usable in my case. Is there any solution to it?

:eek: I've added this to my to-do list just now. The solution isn't straight forward, but it's almost as good. Problem is that I won't be able to look into this before this coming weekend.

If you want to try and solve this on your own, have a look at the source codes for the utilities in OpenFOAM. You can find the path to their main folder by running:
Code:

echo $FOAM_UTILITIES
Best regards,
Bruno

zfaraday January 19, 2015 16:00

Quote:

Originally Posted by wyldckat (Post 528191)
:eek: I've added this to my to-do list just now. The solution isn't straight forward, but it's almost as good. Problem is that I won't be able to look into this before this coming weekend.

No problem, there's no haste. Just let us know when you solve it! :rolleyes:

Thanks.

Best regards,

Alex

wyldckat January 25, 2015 17:42

Greetings Alex,

I've pushed just now the requested change. The "-region" should now work as intended... uh, after you download/"git pull" to update the source code and then rebuild, otherwise it won't work ;)

Problem is that the utility "reconstructSurfaceField" will not do what you're looking for. More details are explained here:

If you need to see the surface scalar fields, then try using the following steps (should work with OpenFOAM 2.*):
  1. Use foamToVTK to export the "surfaceFields", for example:
    Code:

    foamToVTK -region topAir -surfaceFields
  2. Open the files present in the example folder "VTK/topAir/surfaceFields".
  3. Now apply the filter "Glyphs" in ParaView. Don't forget to change the glyph to "Sphere" instead of "Arrow", in order to make it easier to visualize.
This is because foamToVTK only provides the surface fields in the centre of the faces :(.

Best regards,
Bruno


All times are GMT -4. The time now is 21:49.