|
[Sponsors] |
Sample different fields in different sets and surfaces |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 1, 2016, 09:10 |
Sample different fields in different sets and surfaces
|
#1 |
New Member
Ion
Join Date: Mar 2014
Posts: 2
Rep Power: 0 |
Is it possible to sample different fields for different sets and surfaces?
If the pressure field is relevant just in some patch and temperature in other one, is there a way to obtain both without having to call the sample utility twice? The keys here are:
|
|
April 4, 2016, 07:26 |
|
#2 |
Senior Member
Join Date: Jun 2012
Location: Germany, Bochum
Posts: 230
Rep Power: 16 |
AFAIK this is not possible. You could create multiple sampleDict files and maybe make it automatic by writing a small script.
|
|
April 4, 2016, 10:33 |
|
#3 | |
New Member
Ion
Join Date: Mar 2014
Posts: 2
Rep Power: 0 |
Quote:
First of all, thanks for replying Making several calls to sample would require loading the case several times, and that's precisely what I'm trying to avoid. Let's see if someone comes with a different solution in which the case gets loaded and then all samples are performed. Cheers! |
||
November 2, 2017, 13:17 |
|
#4 |
New Member
Lennart Steffen
Join Date: Mar 2017
Location: Braunschweig, Germany
Posts: 17
Rep Power: 9 |
You can do that with function objects in system/controlDict.
Not sure that helps, because you have to decide in advance what you want to get sampled, or at least changes only apply to future times. Here's an example: Code:
functions ( someSampleSets { type sets; functionObjectLibs ("libsampling.so"); setFormat raw; interpolationScheme cellPoint; outputControl outputTime; sets ( someSet { type uniform; axis x; start (0 0 0); end (1 1 1); nPoints 100; } someOtherSet { type uniform; axis y; start (1 0 0); end (0 1 1); nPoints 100; } ); fields ( U p ); } someSurfaces { type surfaces; functionObjectLibs ("libsampling.so"); surfaceFormat raw; interpolationScheme cellPoint; outputControl outputTime; fields ( alpha ); surfaces ( someSurface { type isoSurface; isoField alpha; isoValue 0.5; interpolate true; } ); } ); |
|
December 18, 2020, 06:38 |
How do you run sampling with this setting?
|
#5 | |
New Member
Join Date: Aug 2020
Posts: 16
Rep Power: 6 |
Quote:
the thread is a bit old but I am trying to the exact same thing. I tried the code in OF version 7 but I am not sure how I am supposed to run singleGraph utiliy. OF doesn't create sets of samples when I run my case with the "postprocess -func singleGraph" in terminal. My controlDict File is below. What am I doing wrong here? Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application interFoam startFrom startTime; startTime 0; stopAt endTime; endTime 10; deltaT 2e-4; writeControl runTime; writeInterval 2e-2; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable false; adjustTimeStep yes; maxCo 0.4; maxAlphaCo 0.4; functions { Co { // Mandatory entries (unmodifiable) type CourantNo; libs ("libfieldFunctionObjects.so"); // Optional entries (runtime modifiable) rho rho; // Optional (inherited) entries field <phi>; result <fieldResult>; region region0; enabled true; log true; timeStart 0; timeEnd 10; executeControl adjustableRunTime; executeInterval 2e-2; writeControl adjustableRunTime; writeInterval 2e-2; } singleGraph { someSampleSets { type sets; functionObjectLibs ("libsampling.so"); setFormat raw; interpolationScheme cellPoint; outputControl outputTime; sets ( line0 { type lineCell; axis y; start (0.02 -0.04 0); end (0.02 0.04 0); } line1 { type lineCell; axis y; start (0.045 -0.04 0); end (0.045 0.04 0); } ); fields (U p k omega nut Co); } } #includeFunc probes; } |
||
Tags |
multiple fields, openfoam, sample |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sample not working correctly | sihaqqi | OpenFOAM Running, Solving & CFD | 1 | July 12, 2014 02:36 |
sample utility problem | And | OpenFOAM Post-Processing | 36 | May 20, 2014 09:50 |
Sample utility only samples pressure?! (not velocity) | cfddwarf | OpenFOAM Post-Processing | 2 | May 14, 2012 13:36 |
erros when running sample command | hewei | OpenFOAM Post-Processing | 3 | April 15, 2012 05:50 |
Understanding the coordinates of sample utility | vishwa | OpenFOAM Post-Processing | 4 | March 25, 2010 13:51 |