CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Using Probe for part of a patch

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By fumiya

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 22, 2009, 06:58
Default Using Probe for part of a patch
  #1
ndr
New Member
 
Join Date: Aug 2009
Location: Stuttgart, Germany
Posts: 20
Rep Power: 16
ndr is on a distinguished road
Hi everybody,

I'm using a slightly modified rhoTurbFoam solver with an additional field to calculate the temperature gradient for each timestep at a wall with constant temperature (based on the wallGradU tool). The field for wallGradT is zero for the internal field and only takes values at boundaries. The output of wallGradT within each timestep looks ok.

To monitor the temperature Gradient over time I tried to use the probe utility with two points which are part of the wall. But the probe only returns zero for those points and all timesteps. The code inside the ControlDict looks like this:

Code:
functions
(
    probes
    {
         type probes;
        name probes;
        functionObjectLibs ("libsampling.so");
        probeLocations
       (
         (0.025627 0 -0.00023237)
         (0.0518278 0 -0.000461021)
        );
        fields
        (
         wallGradT
        );
    }
Using the sample utility for the complete patch I get the correct values of wallGradT at exactly the coordinates used for the probe but sample is writing a new directory for each time step and I would like to get one single file with all data for the two points.
The same problem occurs if I try to monitor the temperature which is constant at the wall by definition. While sample returns the constant value, using probe at the same points results in a non-constant temperature.

Any ideas why? Is there any chance to get the probe utility to work for points that are part of a patch?

Thanks a lot

Nils
ndr is offline   Reply With Quote

Old   August 27, 2009, 06:45
Default
  #2
ndr
New Member
 
Join Date: Aug 2009
Location: Stuttgart, Germany
Posts: 20
Rep Power: 16
ndr is on a distinguished road
Nobody got any ideas how to fix this?
ndr is offline   Reply With Quote

Old   November 5, 2009, 22:59
Default
  #3
Member
 
Sven Winkler
Join Date: May 2009
Posts: 70
Rep Power: 16
sven is on a distinguished road
Hey Nils,

how exactly do you use the wallGradT? I only know it to use it as a post-processing tool. How can I use it in such a way, that I can probe the walltemperature Gradient with time?
sven is offline   Reply With Quote

Old   November 6, 2009, 05:29
Default
  #4
ndr
New Member
 
Join Date: Aug 2009
Location: Stuttgart, Germany
Posts: 20
Rep Power: 16
ndr is on a distinguished road
Hi Sven,

I did not succeed to use the probe utility, so post-processing really seems to be the only way to use wallGradT right now, writing the results into the time directories.
As far as I know to create data over time you will need to extract the wallGradT sets out of each time directory. Another possibility would be to use Paraview, which should be able to plot a variable over time for a specific point of your grid, but as I do not use Paraview most of the time I don't know the details.
ndr is offline   Reply With Quote

Old   November 7, 2009, 20:51
Default
  #5
Member
 
Sven Winkler
Join Date: May 2009
Posts: 70
Rep Power: 16
sven is on a distinguished road
Hey Nils,

I found another way to deal with the wallGradT. You can let it write out by your solver, see http://www.cfd-online.com/Forums/ope...tml#post235428. Then the solver writes out GradT for every timestep in the according folder. Then it is also possible to probe the GradT. However, so far I dont know how to probe at a patch in order to get wallGradT. I ll let you know if I find out!

PS: Are you studying Aerospacce engineering in Stuttgart? If so, I know you!

Cheers Sven
sven is offline   Reply With Quote

Old   November 8, 2009, 03:47
Default
  #6
ndr
New Member
 
Join Date: Aug 2009
Location: Stuttgart, Germany
Posts: 20
Rep Power: 16
ndr is on a distinguished road
Hey Sven,

yes I am and I know you too.

Regarding the solver modification: It is a possibility, especially for the wallGradT field. But to get the Nusselt number and still have a solver applicable to several cases you will have to define the reference temperatures within a properties file and let the solver read them from there. Otherways you will have to change the solver every time you calculate another case.

Thanks for thinking about the probing problem. Personally I think I will use some kind of script to extract the values I need out of the several time directories and write them into a new data file. It seems easier than getting OpenFOAM to probe at walls...
ndr is offline   Reply With Quote

Old   January 27, 2019, 03:46
Default Use patchProbes function
  #7
Senior Member
 
fumiya's Avatar
 
Fumiya Nozaki
Join Date: Jun 2010
Location: Yokohama, Japan
Posts: 266
Blog Entries: 1
Rep Power: 18
fumiya is on a distinguished road
In newer versions of OpenFOAM, you can use the patchProbes function objects to extract any patch values.

Usage:
https://www.openfoam.com/documentati...8H_source.html

Best regards,
Fumiya
pedrobritoCFD likes this.
__________________
[Personal]
fumiya is offline   Reply With Quote

Old   April 4, 2019, 06:26
Default The probe dictionary for probing at a boundary
  #8
New Member
 
Pedro Brito
Join Date: Mar 2019
Location: Coimbra
Posts: 1
Rep Power: 0
pedrobritoCFD is on a distinguished road
Greetings,


Here is a sample dictionary for probing data in a specific surface (e.g. patch type wall), for those who, like me, where struggling with post processing. Although this is an old post, I related with the problems stated by the original post.

As Fumiya recommended, I used the "patchProbes" type, and worked like a charm .
In my case, I wished to determine the magnitude of the wall shear stress along the longitudinal cord of a sinusoidal pile, to predict the aeolian erosion phenomena. I'm using OpenFOAM 6, but it may run on version 4 or earliest.

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
-------------------------------------------------------------------------------
Description
    Writes out values of fields from cells nearest to specified locations.

\*---------------------------------------------------------------------------*/

        type            patchProbes;
        libs            ("libsampling.so");
        writeControl    writeTime;
        writeInterval   1;
        patchName    pile; //your patch name.

        fields
        (
            mag(wallShearStress) //self explanatory
        );

        probeLocations //where you pretend to acquire the field values (e.g. coordinates of a solid contour)
        (
        (-0.18 0 0.000033)
        (-0.16 0 0.001842)
        (-0.14 0 0.0070519)
        (-0.12 0 0.015033)
        (-0.1 0 0.024824)
        (-0.08 0 0.035242)
        (-0.06 0 0.045033)
        (-0.04 0 0.053014)
        (-0.02 0 0.0582241)
        (0 0 0.060033)
        (0.02 0 0.0582241)
        (0.04 0 0.053014)
        (0.06 0 0.045033)
        (0.08 0 0.035243)
        (0.1 0 0.024824)
        (0.12 0 0.015033)
        (0.14 0 0.0070519)
        (0.16 0 0.001842)
        (0.18 0 0.000033)
        );
// ************************************************************************* //
And here is the output, after naming this file "probes" and saving it in the system directory. Running the command on the terminal (in the case folder), after reconstructing the case (I ran the simulation in parallel):

Code:
postProcess -func probes
Code:
# Probe 0 (-0.18 0 3.3e-05)
# Probe 1 (-0.16 0 0.001842)
# Probe 2 (-0.14 0 0.0070519)
# Probe 3 (-0.12 0 0.015033)
# Probe 4 (-0.1 0 0.024824)
# Probe 5 (-0.08 0 0.035242)
# Probe 6 (-0.06 0 0.045033)
# Probe 7 (-0.04 0 0.053014)
# Probe 8 (-0.02 0 0.0582241)
# Probe 9 (0 0 0.060033)
# Probe 10 (0.02 0 0.0582241)
# Probe 11 (0.04 0 0.053014)
# Probe 12 (0.06 0 0.045033)
# Probe 13 (0.08 0 0.035243)
# Probe 14 (0.1 0 0.024824)
# Probe 15 (0.12 0 0.015033)
# Probe 16 (0.14 0 0.0070519)
# Probe 17 (0.16 0 0.001842)
# Probe 18 (0.18 0 3.3e-05)
#       Probe             0             1             2             3             4             5             6             7             8             9            10            11            12            13            14            15            16            17            18
#        Time
         0.05    0.00812375     0.0486656      0.103218      0.202102      0.260979      0.368682      0.449216      0.505387      0.524113      0.441765      0.191399     0.0293541     0.0925993     0.0917813      0.110918      0.157276      0.172236     0.0714515     0.0545825
          0.1    0.00304048     0.0291893     0.0702135      0.160661      0.223368      0.336903      0.414714      0.461403      0.452548      0.317412     0.0632581     0.0886352     0.0634599     0.0444747     0.0663746     0.0820202      0.348371      0.396325      0.407224
         0.15    0.00219157     0.0233504     0.0573112      0.135767      0.193464      0.301907      0.375173      0.414224      0.385939      0.208974     0.0894143     0.0515102     0.0274199      0.118178      0.256518     0.0298252     0.0720626      0.121465      0.211515
          0.2   0.000317146     0.0192842     0.0485084      0.114845      0.163949      0.257824      0.323314        0.3569      0.326684       0.16094     0.0798012     0.0470957     0.0287921    0.00160348       0.17379      0.080933      0.120902      0.063199     0.0287449
         0.25   9.91385e-05     0.0128659     0.0353914     0.0935272      0.140232       0.23368      0.299773      0.331962      0.296714      0.121005     0.0647813     0.0335426     0.0225647     0.0241121     0.0542552      0.137843      0.113272      0.168129     0.0107513
        0.275   0.000933794     0.0137927     0.0354688     0.0910858      0.136083      0.227175      0.292087      0.323466      0.287537      0.112964     0.0627004     0.0316193     0.0257205     0.0456268    0.00309331     0.0948076     0.0103962      0.105846     0.0336834
      0.29999    0.00115858     0.0139257     0.0351789     0.0895515      0.133666      0.223192      0.286862      0.317162      0.279511      0.103656     0.0590132     0.0280062      0.026292      0.056477       0.03052      0.051015     0.0357504     0.0730952     0.0310486
      0.32499    0.00132025     0.0139533     0.0348882     0.0885491      0.132211      0.221041      0.284273      0.314306      0.276675      0.102205     0.0571866     0.0276987     0.0241274     0.0284396     0.0116062     0.0295978     0.0471425     0.0600559     0.0250804
      0.34999    0.00146334     0.0140347     0.0347931     0.0881113      0.131617      0.220365      0.283791       0.31419      0.277864      0.106574     0.0575375      0.028975     0.0253038    0.00796679    0.00366753     0.0263226     0.0054078     0.0453666     0.0814393
      0.37499    0.00149459     0.0140362     0.0347008     0.0878197      0.131235      0.219929      0.283445      0.314011        0.2783      0.108578     0.0590058     0.0308226     0.0252579    0.00519227     0.0111267     0.0259332     0.0240844      0.020473     0.0561315
      0.39999    0.00144252     0.0139263     0.0345044     0.0874193      0.130689      0.219076      0.282247      0.312436      0.275912      0.104938     0.0586087     0.0301557     0.0201244    0.00721542     0.0110934      0.028751     0.0168153     0.0176079     0.0344984
      0.42499    0.00139541     0.0138053     0.0342918     0.0870116      0.130133       0.21817       0.28092       0.31065      0.273131      0.100561     0.0575061     0.0270903      0.016177    0.00762516     0.0111678     0.0263648      0.011257     0.0136171     0.0175207
      0.44999    0.00137903     0.0137282     0.0341346     0.0866983      0.129709      0.217498      0.279962       0.30939      0.271256     0.0977444      0.056436     0.0250706     0.0153476    0.00730477     0.0125094     0.0244744    0.00478569     0.0104467    0.00237883
      0.47499    0.00137827     0.0136891     0.0340385     0.0864958      0.129438      0.217094      0.279426       0.30873      0.270399     0.0967061      0.055944     0.0242147     0.0150675    0.00770179     0.0160519     0.0201978   0.000678855    0.00364309    0.00573916
      0.49999    0.00136975     0.0136539     0.0339626     0.0863405      0.129232      0.216791      0.279032      0.308255      0.269815     0.0960792     0.0558005      0.023914     0.0148956    0.00936768     0.0183594     0.0153105   0.000459373    0.00420457    0.00293835
      0.52499    0.00134534     0.0136008     0.0338711     0.0861685      0.129001      0.216429      0.278526      0.307605      0.268904      0.094871     0.0555834     0.0239204     0.0146512     0.0113811     0.0179326     0.0106653     0.0038947    0.00436211    0.00307923
      0.54999     0.0013198     0.0135413       0.03377     0.0859815      0.128747       0.21602      0.277932      0.306821      0.267754     0.0932577     0.0551493     0.0239432     0.0146551     0.0127155     0.0151596    0.00792817    0.00490665    0.00388077    0.00465588
      0.57499    0.00131076     0.0135025     0.0336938      0.085833      0.128546      0.215701      0.277481      0.306237      0.266933     0.0921748      0.054758     0.0240069     0.0148123     0.0130067     0.0119264    0.00779767    0.00465549    0.00384501    0.00217017
      0.59999    0.00131281     0.0134868     0.0336518     0.0857441      0.128428      0.215528       0.27726      0.305975      0.266634      0.091919     0.0546242     0.0240987      0.014935     0.0122131     0.0106525    0.00802452    0.00479977    0.00179612   9.12606e-05
      0.62499    0.00131477      0.013479     0.0336276     0.0856894      0.128356      0.215429      0.277142      0.305845      0.266508     0.0918554     0.0546363     0.0238898     0.0147085     0.0103716     0.0107583    0.00938249    0.00352769    0.00115267    0.00077925
      0.64999    0.00130937     0.0134656     0.0336017     0.0856374      0.128286  
(...)
It may seem messy, but one can easily import it to libreOffice or Excel, and re-arrange as a matrix, with data tools. The main advantage of the probes functionality in post processing samples is, as states in the OpenFOAM manual, it writes the data in a single file in time-value format, so it is suitable for plotting time depending graphs in transient simulations.

An alternative is the boundaryProbes utility for post processing data. It is identical to the latter, but it's not a probe per se, because it writes the data in separate files at scheduled write times. So is suitable for probing certain field data at a surface (boundary) in steady-state simulations, where only the last write time (last iteration) really matters. After running the simulation and reconstructing the domain:

Code:
postProcess -func boundaryProbes -latestTime
And the respective dictionary (named boundaryProbes and saved in the system directory):

Code:
/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  6
     \\/     M anipulation  |
-------------------------------------------------------------------------------
Description
    Writes out values of fields at a specified list of points, interpolated to
    specified boundary patches.

\*---------------------------------------------------------------------------*/
type            sets;
libs            ("libsampling.so");

executeControl  writeTime;
writeControl    writeTime;

interpolationScheme    cellPoint;
setFormat        raw;

fields (mag(wallShearStress));

points
(
        (-0.18 0 0.000033)
        (-0.16 0 0.001842)
        (-0.14 0 0.0070519)
        (-0.12 0 0.015033)
        (-0.1 0 0.024824)
        (-0.08 0 0.035242)
        (-0.06 0 0.045033)
        (-0.04 0 0.053014)
        (-0.02 0 0.0582241)
        (0 0 0.060033)
        (0.02 0 0.0582241)
        (0.04 0 0.053014)
        (0.06 0 0.045033)
        (0.08 0 0.035243)
        (0.1 0 0.024824)
        (0.12 0 0.015033)
        (0.14 0 0.0070519)
        (0.16 0 0.001842)
        (0.18 0 0.000033)
);
maxDistance 0.001;

patches     ("pile");

sets
(
    points
    {
        type        boundaryPoints;
        axis        xyz;
        points      $points;
        maxDistance $maxDistance;
        patches     $patches;
    }
);

// ************************************************************************* //
The output is a set of time-cases, each one with a text file with the field values at the prescribed time stamp and coordinate location.

Cheers
Pedro Brito

Last edited by pedrobritoCFD; April 10, 2019 at 12:33.
pedrobritoCFD is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with cyclic boundaries in Openfoam 1.5 fs82 OpenFOAM 36 January 7, 2015 00:31
[mesh manipulation] Using createPatch in place of couplePatches sripplinger OpenFOAM Meshing & Mesh Conversion 8 November 13, 2009 07:14
CheckMeshbs errors ivanyao OpenFOAM Running, Solving & CFD 2 March 11, 2009 02:34
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 08:19
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12


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