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/)
-   -   How to determine maximum's location on patch (http://www.cfd-online.com/Forums/openfoam-post-processing/104340-how-determine-maximums-location-patch.html)

vigges July 7, 2012 11:27

How to determine maximum's location on patch
 
Hi Foamers,

my simulation is running smoothly but now, I'm facing the next problem.
I need to find the maximum Nusselt number on my wall patch and its location, so that my further calculations can be executed.

I thought about hacking something into the patchAverage utility, in order to get the average Nusselt number and the maximum's location at the same time. Unfortunately, I have no clue how to do that.

Do you have any ideas?
Thanks in advance.
Victor

Gwenael July 10, 2012 03:36

Did you look into foamCalc ?

vigges July 10, 2012 03:48

Yes, I did. But afaik, it's not capable of determining the maximum value on a patch or its exact location on the patch.
I'm sure there is a solution but it would most likely involve programming in C... Let's say that is not my strong suit :rolleyes:

gschaider July 10, 2012 05:53

Everybody run: Bernhards usual answer

Quote:

Originally Posted by vigges (Post 370581)
Yes, I did. But afaik, it's not capable of determining the maximum value on a patch or its exact location on the patch.
I'm sure there is a solution but it would most likely involve programming in C... Let's say that is not my strong suit :rolleyes:

Recent versions of swak4Foam have a function maxPosition that gives you the location of the maximum on a patch. So something like (I'm doing this from memory)
Code:

functions {
    extremeP {
      type swakExpression;
      valueType patch;
      patchName wall;
      verbose true;
      expression "p";
      accumulations (min max);
    }
    maxPPosition {
      $extremeP;
      expression "maxPosition(p)";
      accumulations (average);
    }
    minPPosition {
      $maxPPosition;
      expression "minPosition(p)";
    }     
}

would give you minimum and maximum of p as well as their positions on the patch during the simulation.

Advantage: you don't have to program C++
Disadvantage: you'll have to pollute your machine with swak4Foam

vigges July 10, 2012 05:58

Bernhard, thanks a lot!!
I'm going to look into that.

vigges July 10, 2012 08:30

Works perfectly :-)

Let's assume that only the final time step's max location is needed. Is it feasible to only export this value/location to a file?

gschaider July 10, 2012 09:20

Quote:

Originally Posted by vigges (Post 370635)
Works perfectly :-)

Let's assume that only the final time step's max location is needed. Is it feasible to only export this value/location to a file?

funkyDoCalc can be used to specify calculations in a file and execute them on saved data.

@file: there should be some directories named swakExpression_foo there with the data (not 100% sure whether funkyDoCalc creates them)


All times are GMT -4. The time now is 11:52.