|
[Sponsors] |
December 14, 2010, 10:41 |
surface sampling during runtime
|
#1 |
Member
fisch
Join Date: Feb 2010
Posts: 97
Rep Power: 16 |
Hello,
I' more or less beginner in programming in OpenFoam; so hopefully i'm not bugging you with silly questions... I want to do something like plane sampling during the runtime of my solver and at best i will have at the final end my sampling areas like the boundary patches to treat them in common in every timestep e.g. in paraview as vtk files. I tried to extract lines of the code of sample.C and of http://www.cfd-online.com/Forums/openfoam-programming-development/82878-averaging-due-parallel-running-cuttingplane.html but it was not working for solvers with meshmotion (produced memory access errors as soon meshmotion routines want to handle the mesh). I have no idea how to proceed... Can you help me? I'm thankful for every little advide. rupert |
|
December 14, 2010, 17:26 |
|
#2 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
I use the following for monitoring the free surface in an interFoam simulation. You have to put it in your controlDict. You can alter it for your case with the same definitions that are used in sampleDict. Have fun!
Code:
functions ( elevation { type surfaces; functionObjectLibs ( "libsampling.so" ); outputControl outputTime; surfaceFormat raw; fields ( alpha1 ); surfaces ( topFreeSurface { type isoSurface; isoField alpha1; isoValue 0.5; interpolate true; } ); } ) |
|
March 1, 2011, 10:39 |
|
#3 |
Member
Florian Ettner
Join Date: Mar 2009
Location: Munich, Germany
Posts: 41
Rep Power: 17 |
Bernhard, thank your for this piece of code.
I would like to understand it a little better, but I cannot find the respective source code. It seems to me that functions() can be combined with a lot of stuff, but not the one I'm looking for... Which "types" are possible? So far I've found "surfaces", "probes", "fieldAverage". Which other options are there? Can I tell OF to continue the existing output file of a stopped run or does it always start a new file? Specifically, I would like to post-process some numbers (scalars) which I calculate during the run to characterize the flow. Thanks, Florian |
|
March 1, 2011, 17:03 |
|
#4 |
Senior Member
Steven van Haren
Join Date: Aug 2010
Location: The Netherlands
Posts: 149
Rep Power: 16 |
us the famous "bananas" trick for problems like this:
Code:
type bananas;//fieldAverage; Code:
--> FOAM FATAL ERROR: Unknown function type bananas Valid functions are : 9 ( cellSource faceSource fieldAverage fieldMinMax probes readFields sets surfaceInterpolateFields surfaces ) |
|
March 2, 2011, 08:00 |
appending to existing output file
|
#5 |
Member
Florian Ettner
Join Date: Mar 2009
Location: Munich, Germany
Posts: 41
Rep Power: 17 |
Thank you, Steven,
as far as I understand it now, a function object is created which takes the values from a runTimeSelectionTable which is provided by a library ("libsampling.so" in this case). However, the writing options seem to be limited to: timestep, outputTime The result is always written into a folder named after the starting time of the computation (e.g. probes/0.0/p). If the computation is stopped and then continued, it creates a new folder with the latest time step (e.g. probes/1.0/p) I would like to change this behaviour, so that it always writes to the same file and appends if it already exists (e.g. probes/p), but I cannot find the source code of this function object. Can anybody help me there? Thanks in advance! |
|
March 2, 2011, 09:42 |
|
#6 |
Senior Member
Steven van Haren
Join Date: Aug 2010
Location: The Netherlands
Posts: 149
Rep Power: 16 |
Here is the source code for how the probes function samples and appends to a file:
/software/OpenFOAM/OpenFOAM-1.7.1/src/sampling/probes/probesTemplates.C |
|
March 2, 2011, 12:14 |
|
#7 |
Member
Florian Ettner
Join Date: Mar 2009
Location: Munich, Germany
Posts: 41
Rep Power: 17 |
That's what I was looking for, thank you!
Somehow, I was looking for something like functions.C because I thought that's the class which determines I/O. |
|
November 1, 2012, 07:42 |
|
#8 |
New Member
Join Date: Aug 2012
Posts: 14
Rep Power: 14 |
hello Bernhard,
I would like to ask you how do you know the sampling function input in controlDict? I just found the sampling file (.c and .H) but it didnt tell you how to use them. Is there any instruction about how to setup these ultities? Thanks Cloudy |
|
October 3, 2013, 07:52 |
Sampling for a specific timestep
|
#9 |
New Member
Rob Gordon
Join Date: Aug 2013
Posts: 8
Rep Power: 13 |
Hi,
I was wondering if anyone knew how to output a cuttingPlane for a specific time step. I currently output horizontal slice surfaces at the outputTime but would like to output other surfaces at selected time steps. Is this possible? My cuttingPlane file Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.2.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ cuttingPlane { type surfaces; functionObjectLibs ("libsampling.so"); outputControl outputTime; setFormat raw; surfaceFormat vtk; interpolationScheme cellPointFace; fields (U UMean); surfaces ( vertPlane // I would like to output this at only select timesteps { type cuttingPlane; planeType pointAndNormal; pointAndNormalDict { basePoint (-425 0 100); normalVector (0 1 0); } interpolate true; } horPlane2 { type cuttingPlane; planeType pointAndNormal; pointAndNormalDict { basePoint (-425 0 1.5); normalVector (0 0 1); } interpolate true; } horPlane10 { type cuttingPlane; planeType pointAndNormal; pointAndNormalDict { basePoint (-425 0 10); normalVector (0 0 1); } interpolate true; } ); } |
|
April 30, 2014, 19:06 |
|
#10 | |
Senior Member
Join Date: Jan 2013
Posts: 372
Rep Power: 14 |
Dear Bernhard,
When we use the utilities you mentioned, can we get the velocity normal to and parallel with the iso-surface? Particualy when the iso-surface is curved. Do you have any experience with that? Thank you. OFFO. Quote:
|
||
February 12, 2015, 13:31 |
|
#11 |
Member
Vignesh
Join Date: Oct 2012
Location: Darmstadt, Germany
Posts: 66
Rep Power: 14 |
Dear All,
I am simulating (2D) the shape of static meniscus attached to a wall. The interface is set horizontal at the start, which later changes its shape according to the contact angle defined at the wall, eventually forming a meniscus. I use the function object (given below) to extract the shape of the interface. I see oscillations of the interface when plotted, but i don't see it when visualised using paraview. Can someone explain why does it happen or how to rectify this ? Code:
functions ( elevation { interpolationScheme cell; type surfaces; functionObjectLibs ( "libsampling.so" ); outputControl outputTime; surfaceFormat raw; fields ( alpha1 ); surfaces ( interpolatedIso { // Iso surface for interpolated values only type isoSurface; // always triangulated isoField alpha1; isoValue 0.5; interpolate true; regularise true; } ); } );
__________________
Thanks and Regards Vignesh |
|
June 8, 2016, 05:28 |
|
#12 |
Senior Member
Agustín Villa
Join Date: Apr 2013
Location: Alcorcón
Posts: 314
Rep Power: 15 |
Hello
I know this thread is a bit old (even older threads were re-opened after a while), but if I have understood well, it is possible to use the commands I use in my sampleDict as function objects, as it is posted here. Am I right? |
|
February 7, 2022, 08:49 |
sample surfaces problem while running in parallel
|
#13 |
New Member
Join Date: Sep 2021
Posts: 6
Rep Power: 5 |
Hello everyone
I am having the problem,while running in parallel, it only generates the planeA but not the left_x patch Does anyone know ? Thank you sampledSurface { type surfaces; libs ("libsampling.so"); libs ("libOpenFOAM.so"); writeControl timeStep; writeInterval 1; enabled true; surfaceFormat boundaryData; interpolationScheme none; interpolate false; triangulate false; fields ( U p ); surfaces ( left_x { type patch; patches ("left_x"); triangulate false; } planeA { type plane; triangulate false; planeType pointAndNormal; pointAndNormalDict { point (4.186 4.18 2); normal (1 0 0); triangulate false; //zone zone2; } } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Gmsh] Error : Self intersecting surface mesh, computing intersections & Error : Impossible | velan | OpenFOAM Meshing & Mesh Conversion | 3 | October 22, 2015 12:05 |
[Gmsh] Problem with Gmsh | nishant_hull | OpenFOAM Meshing & Mesh Conversion | 23 | August 5, 2015 03:09 |
[Gmsh] boundaries with gmshToFoam | ouafa | OpenFOAM Meshing & Mesh Conversion | 7 | May 21, 2010 13:43 |
sampling of a curved surface with distance-based coordinate? | johannesk | OpenFOAM Post-Processing | 0 | May 2, 2010 17:53 |
CFX4.3 -build analysis form | Chie Min | CFX | 5 | July 13, 2001 00:19 |