CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Write cloudFunction fields as VTK during the runtime (https://www.cfd-online.com/Forums/openfoam-post-processing/253820-write-cloudfunction-fields-vtk-during-runtime.html)

egebat7 January 2, 2024 09:55

Write cloudFunction fields as VTK during the runtime
 
Dear Foamers,

I am using vtkCloud function to write lagrangian cloud field data into the postProcessing/ folder during the runtime. I am additionally calculating few more fields using the CloudFunctions class in my cloud properties file: Nusselt Number, Particle Reynolds Number and Heat Transfer Coefficient. However, vtkCloud doesn't write those additionally calculated fields (Nu, Re_p, ...) to the postProcessing/ folder even I am selecting to write all fields. Is there a way to write those additionally calculated fields as a postProcessing/VTK format during the runtime?


controlDict:
Code:

    cloudWrite1
    {
        type            vtkCloud;
        libs            (lagrangianFunctionObjects);
        writeControl    runTime;
        writeInterval  0.01;
        format          binary;

        cloud          reactingCloud1;
        fields          (".*");

    }

reactingCloud1Properties:
Code:

cloudFunctions
{
    NusseltNumber1
    {
        type NusseltNumber;
    }
   
    ReynoldsNumber1
    {
        type ReynoldsNumber;
    }
   
    HeatTransferCoeff1
    {
        type HeatTransferCoeff;
    }
 }

Best regards,


Ege

olesen January 3, 2024 12:26

I took a look and I think you could have a try at just copying in data from the cloud itself.
Take a look at the writeCloud() in the vtkCloud.C code and you'll see that it uses a local temporary registry (obrTmp) where all of the normal particle output is written.
Next if you examine (for example) the KinematicReynoldsNumber.C code, you'll see that the postEvolve method calculates the Reynolds number and dumps it onto the cloud itself.
So based on this knowledge, it should be possible to just add in a sub-selection back into the obrTmp or even just write the additional registry for label/scalar/vector types (similar to around Line 290 of the vtkCloud.C file).


Although still some snags to be expected with the filtering mechanism, it is probably a good place for you to start.


EDIT: added as https://develop.openfoam.com/Develop.../-/issues/3094


All times are GMT -4. The time now is 18:20.