|
[Sponsors] |
RunTime Functions: combining "fieldMinMax" and "surface" |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 14, 2012, 04:16 |
RunTime Functions: combining "fieldMinMax" and "surface"
|
#1 |
Senior Member
Julien
Join Date: Jun 2012
Location: France
Posts: 152
Rep Power: 13 |
Hi dear community,
I want to extract from a large unsteady calculation some data, but focusing only on a part of my domain. So I use the "surfaces" function in my controldict: Code:
functions { p_Maison { type surfaces; functionObjectLibs ("libsampling.so"); enabled true; outputControl timeStep; interpolationScheme cellPoint; surfaceFormat vtk; fields ( p ); surfaces ( P_bati { type patch; patches ( batiment_patch0 ); interpolate true; triangulate false; } ); } } I want also to isolate the extreme values of this field. I know a bit about the fieldMinMax function. Second question: I tried from the $FOAM_TUTORIAL folder the Linux command: Code:
grep -r 'fieldMinMax' Third question: how to combine these two functions ? More precisely, I want to have the min and max values of a given field (here, P) but only on one patch of my calculation. Is it possible to do this? Thanks a lot for your help Djub |
|
December 23, 2012, 19:38 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
@second question: one good strategy to find out which parameters are required is to not give any. Then one after one give them to OF until it stops complaining
__________________
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 |
||
January 21, 2013, 05:26 |
|
#3 |
Senior Member
Julien
Join Date: Jun 2012
Location: France
Posts: 152
Rep Power: 13 |
Hi!
I was mistaken with the fieldMinMax function: it gives the extreme value of one field. But I didnot want these values: I am looking for a field of min/max values in time. Saying, for a transient analysis, I would like the two fields Fm dans FM that gives: for all space point (x,y,z), for all time t, Fm(x,y,z) < F(x,y,z,t) < FM(x,y,z) These fields represent, for each location, the extreme values in time. For the moment, I can do this by writing each time step on the hard drive, and then, read them (with MatLab) and calculate the extreme values. But this solution is quite heavy and "expensive" in terms of space disk. I thought it could be possible to calculate these two fields "inline", keeping only the currents field and the two extreme fields. Any ideas? |
|
January 21, 2013, 08:49 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Code:
calcMin { type expressionField; fieldName FMin; outputControl timeStep; outputInterval 1; expression "storedMin"; autowrite true; variables ( "storedMin=min(storedMin,F);" ); storedVariables( { name storedMin; initialValue "1e20"; } ); }
__________________
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 |
||
January 21, 2013, 09:54 |
|
#5 |
Senior Member
Julien
Join Date: Jun 2012
Location: France
Posts: 152
Rep Power: 13 |
Hi Bernhard ,
thanks for quick reply. I added the libraries in my controldict, and I put your instructions within my functions { ... } . My controlDict looks like: Code:
... libs ( "libOpenFOAM.so" "libsimpleSwakFunctionObjects.so" "libswakFunctionObjects.so" "libgroovyBC.so" ); functions { calcMin { type expressionField; fieldName FMin; outputControl timeStep; outputInterval 1; expression "storedMin"; autowrite true; variables ( "storedMin=min(storedMin,F);" ); storedVariables( { name storedMin; initialValue "1e20"; } // line 77 ); } speed { type probes; ... PHP Code:
PHP Code:
|
|
January 21, 2013, 11:23 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
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 |
||
January 21, 2013, 12:33 |
|
#7 |
Senior Member
Julien
Join Date: Jun 2012
Location: France
Posts: 152
Rep Power: 13 |
It is OK now for the warning, but the error is still there...
OH No! I realize I changed my computer! So I do not have installed swak4foam. And again I have errors while compiling... (cf http://www.cfd-online.com/Forums/openfoam/103279-contrib-swak4foam.html#post367473) I am working with GeekoCFD (http://susestudio.com/a/2qtLK2/geekocfd) and I thought sawk4Foam was allready installed... Tomorrow I will try to fallow my own installation explainations... |
|
February 11, 2013, 11:31 |
|
#8 |
Senior Member
Julien
Join Date: Jun 2012
Location: France
Posts: 152
Rep Power: 13 |
Hi Bernard,
1/ Finally, the use of swak4foam was very easy and quite straitforward. I did not had to modify nothing; it worked well on his own. 2/ Wonderfull! I can see my fields pmin and pmax changing in time. I suppose now I can use the sample utility on those two fields to restrict the field on focus the attention only in my patch. Thanks a lot! I knew that swak4foam was awesome , know I know it will save me hours of coding! Simple, efficient, clear: bravo to swak4foam! |
|
December 11, 2016, 09:37 |
buoyantPimpleFoam fails with -withFunctionObjects
|
#9 | ||||
Member
a
Join Date: Oct 2014
Posts: 49
Rep Power: 11 |
Dear All,
I have tried to create a new field using both---1. coded functions and 2. using expressionField as given below, I am applying this quoted text to the standard tutorial of "hotRoom" in buoyantPimpleFoam Quote:
Quote:
I found out that when we run the application with " -withFunctionObjects " paraFoam know the new field written when I tried the same quoted text to the standard tutorial of "cylinder" in potentialFoam, I can isualize the new field in paraFoam. But " -withFunctionObjects " fails with buoyantPimpleFoam Quote:
Quote:
Please help Thanks and regards. |
|||||
September 10, 2017, 19:32 |
|
#10 | |
New Member
Esmaeel Eftekharian
Join Date: Jan 2016
Location: Sydney, Australia
Posts: 16
Rep Power: 10 |
Quote:
I am trying to use functionObject libraries in swak4foam to calculate some fields. I have successfully installed Openfoam 222 and the compatible version of swak4foam (https://github.com/Unofficial-Extend...-swak4Foam.git swak4Foam) on an HPC cluster. The problem is that I receive the following error while using swak4foam " Unknown function type expressionField Valid functions are : 9 ( initSwakFunctionObject partialWrite patchProbes probes removeRegisteredObject sets surfaces writeDictionary writeRegisteredObject ) " Looking at the libraries compiled by Swak4FOAM, I found that FunctionObject is not in the list of compiled libraries, though Swak4FOAM has been correctly installed. Here is the list of compiled libraries: libgroovyBC.so libgroovyStandardBCs.so libsimpleLagrangianFunctionObjects.so libsimpleSearchableSurfaces.so libswak4FoamParsers.so libswakChemistryModelFunctionPlugin.so libswakCoalCloudAdaptor.so libswakDynamicMeshFunctionPlugin.so libswakDynamicMesh.so libswakFvcSchemesFunctionPlugin.so libswakFvOptions.so libswakLagrangianCloudSourcesFunctionPlugin.so libswakLagrangianParser.so libswakLocalCalculationsFunctionPlugin.so libswakMeshQualityFunctionPlugin.so libswakMeshWaveFunctionPlugin.so libswakMRFFunctionPlugin.so libswakQuantileFunctionPlugin.so libswakRandomFunctionPlugin.so libswakSourceFields.so libswakSurfacesAndSetsFunctionPlugin.so libswakThermoTurbFunctionPlugin.so libswakTopoSources.so libswakTransportTurbFunctionPlugin.so Is there any specific reason why FunctionObject does not exist in the list of libraries? Thank you in advance for your time and support. Kind Regards Esmaeel |
||
September 11, 2017, 17:01 |
|
#11 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
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 |
||
September 11, 2017, 18:12 |
|
#12 | |
New Member
Esmaeel Eftekharian
Join Date: Jan 2016
Location: Sydney, Australia
Posts: 16
Rep Power: 10 |
Quote:
Thanks for your response. Yes, I have added libswakFunctionObject.so to the controlDict: libs ( "libIOFunctionObjects.so" "libOpenFOAM.so" "libgroovyBC.so" "libswakFunctionObjects.so"); Below is the list of libraries compiled after compiling swak4foam, I do not know why libswakFunctionObject is not in the list, while swak4foam was successfully compiled. Is there any way to add libswakFunctionObject to other compiled swak4foam libraries? libgroovyBC.so libgroovyStandardBCs.so libsimpleLagrangianFunctionObjects.so libsimpleSearchableSurfaces.so libswak4FoamParsers.so libswakChemistryModelFunctionPlugin.so libswakCoalCloudAdaptor.so libswakDynamicMeshFunctionPlugin.so libswakDynamicMesh.so libswakFvcSchemesFunctionPlugin.so libswakFvOptions.so libswakLagrangianCloudSourcesFunctionPlugin.so libswakLagrangianParser.so libswakLocalCalculationsFunctionPlugin.so libswakMeshQualityFunctionPlugin.so libswakMeshWaveFunctionPlugin.so libswakMRFFunctionPlugin.so libswakQuantileFunctionPlugin.so libswakRandomFunctionPlugin.so libswakSourceFields.so libswakSurfacesAndSetsFunctionPlugin.so libswakThermoTurbFunctionPlugin.so libswakTopoSources.so libswakTransportTurbFunctionPlugin.so |
||
September 12, 2017, 07:15 |
|
#13 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
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 |
||
Tags |
extraction of a field, functionobjects |
|
|