# How to determine maximum's location on patch

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

 July 7, 2012, 11:27 How to determine maximum's location on patch #1 Member   Victor-S. Eberhart Join Date: Oct 2011 Posts: 35 Rep Power: 8 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

 July 10, 2012, 03:36 #2 New Member   Gwenael Hauet Join Date: Jan 2010 Location: Grenoble, France Posts: 4 Rep Power: 9 Did you look into foamCalc ? __________________ Gwen

 July 10, 2012, 03:48 #3 Member   Victor-S. Eberhart Join Date: Oct 2011 Posts: 35 Rep Power: 8 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

July 10, 2012, 05:53
#4
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,020
Rep Power: 43

Quote:
 Originally Posted by vigges 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
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++

 July 10, 2012, 05:58 #5 Member   Victor-S. Eberhart Join Date: Oct 2011 Posts: 35 Rep Power: 8 Bernhard, thanks a lot!! I'm going to look into that.

 July 10, 2012, 08:30 #6 Member   Victor-S. Eberhart Join Date: Oct 2011 Posts: 35 Rep Power: 8 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?

July 10, 2012, 09:20
#7
Assistant Moderator

Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,020
Rep Power: 43
Quote:
 Originally Posted by vigges 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)

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Kart OpenFOAM Meshing & Mesh Conversion 1 February 4, 2010 05:38 ivanyao OpenFOAM Running, Solving & CFD 2 March 11, 2009 03:34 unoder OpenFOAM Installation 11 January 30, 2008 21:30 adorean Open Source Meshers: Gmsh, Netgen, CGNS, ... 24 April 27, 2005 08:19 Andrea CFX 2 October 11, 2004 05:12

All times are GMT -4. The time now is 12:19.