|
[Sponsors] |
how to write sampling of lines and surfaces during run time |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 5, 2022, 04:13 |
how to write sampling of lines and surfaces during run time
|
#1 |
Member
Join Date: Apr 2021
Posts: 41
Rep Power: 4 |
Dear Foamers,
I am on OFv2112 and I run multiphase transient simulation using interFoam. I am able to post-process lines and surfaces after the run, using the postProcess command and writing them in the postProcessing directory. However I am not able to do it during run time and I would like to know how to do it. Here below are my sampling functions objects and controlDict files. Please could you help me and let me know what could be wrong here ? Many thanks in advance. FOfreeSurface Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2112 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location system; object sample; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // type surfaces; libs ("libsampling.so"); surfaceFormat vtk; // stl; fields (alpha.water); interpolationScheme cellPoint; executeControl writeTime; writeControl writeTime; surfaces2 ( topFreeSurface09 { type isoSurface; isoField alpha.water; isoValue 0.9; interpolate true; } topFreeSurface10 { type isoSurface; isoField alpha.water; isoValue 1.0; interpolate true; } ); // ************************************************************************* // Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2112 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location system; object sample; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // type sets; libs ("libsampling.so"); setFormat raw; fields (U alpha.water); interpolationScheme cellPoint; executeControl writeTime; writeControl writeTime; Npts 101; xline1 0.1; xline2 0.2; yline 0.1; zline 0.5; sets2 ( line1 { type uniform; axis distance; start ( $xline1 $yline 0 ); end ( $xline1 $yline $zline ); nPoints $Npts; } line2 { type uniform; axis distance; start ( $xline2 $yline 0 ); end ( $xline2 $yline $zline ); nPoints $Npts; } ); // ************************************************************************* // Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2112 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application interFoam; startFrom latestTime; stopAt endTime; endTime 120.0; deltaT 0.01; writeControl adjustableRunTime; writeInterval 0.05; purgeWrite 2; writeFormat ascii; writePrecision 8; writeCompression off; timeFormat general; timePrecision 8; runTimeModifiable yes; adjustTimeStep yes; maxCo 0.65; maxAlphaCo 0.65; maxDeltaT 0.1; functions { #include "solverInfo" #include "FOlines" #include "FOfreeSurface" } // ************************************************************************* // |
|
September 5, 2022, 11:27 |
|
#2 | |
Member
Al
Join Date: May 2019
Posts: 37
Rep Power: 6 |
Quote:
Quick How-To: Sample like in sampleDict during runtime Best, |
||
September 5, 2022, 14:34 |
|
#3 |
Member
Join Date: Apr 2021
Posts: 41
Rep Power: 4 |
Thanks.
In the meantime I found a simple solution by rewriting the function object as below: FOfreeSurface Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2112 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ freeSurface { type surfaces; libs ("libsampling.so"); interpolationScheme cellPoint; surfaceFormat vtk; // stl; fields (alpha.water); executeControl writeTime; executeInterval 1; writeControl writeTime; writeInterval 1; surfaces ( topFreeSurface09 { type isoSurface; isoField alpha.water; isoValue 0.9; interpolate true; } topFreeSurface10 { type isoSurface; isoField alpha.water; isoValue 1.0; interpolate true; } ); } |
|
September 6, 2022, 02:14 |
|
#4 |
Member
Al
Join Date: May 2019
Posts: 37
Rep Power: 6 |
That's great, The thread I addressed on this issue also included a similar approach and was using outputControl and outputInterval.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[DesignModeler] Cannot modify lines and surfaces in Ansys DesignModeler | iancmlositano | ANSYS Meshing & Geometry | 0 | March 16, 2017 23:32 |
run time error | umar959 | FLUENT | 0 | November 23, 2011 00:47 |
[Netgen] CalculiX can write now a ployMesh | klaus | OpenFOAM Meshing & Mesh Conversion | 6 | December 12, 2007 05:02 |