CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Get access to the coordinates of a cell for post-processing of rising bubble

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 22, 2022, 05:54
Default Get access to the coordinates of a cell for post-processing of rising bubble
  #1
New Member
 
Giancarlo Esposito
Join Date: Mar 2022
Posts: 7
Rep Power: 2
giano is on a distinguished road
Dear all, thank you very much in advance for your support.
I am trying to implement a function in my controlDict to calculate the center of mass of my bubble rising (solver interFOAM, version OF7). I managed to implement some functions for the computation of Volume integrals and weighted volume integrals, but since the quantity of interest in my case is:


c_{x}=\frac{\int \alpha x dV}{\int \alpha dV}
c_{y}=\frac{\int \alpha y dV}{\int \alpha dV}


I would like to get access to the x and y coordinates of the cells in order to obtain this quantity directly in my postProcessing folder.
So far, the changes I made are the implementation of these functions in my controlDict case:


Code:
functions
{
    volumeAverage
    {
        type            volFieldValue;
        libs            ("libfieldFunctionObjects.so");

        log             true;
        writeControl    writeTime;
        writeFields     true;

        regionType      all;
        operation       volAverage;

        fields
        (
            p_rgh
            U
        );
    }

    weightedVolAverage
    {
        type            volFieldValue;
        libs            ("libfieldFunctionObjects.so");

        log             true;
        writeControl    writeTime;
        writeFields     true;

        regionType      all;
        operation       weightedVolAverage;

        weightField     alpha.air;

        fields
        (
            U
        );
    }

 }

Do you know how to do it? If I go in the createFields.H directory of my interFoam solver and introduce new volScalarField I cannot get compile it for several errors trying different expressions for the positions (pol.(), cellI[1], etc). Any advice?




An alternative approach for the computation of the rising velocity is to calculate directly:


u_{xb}=\frac{\int \alpha u_{x} dV}{\int \alpha dV}
u_{yb}=\frac{\int \alpha u_{y} dV}{\int \alpha dV}


But in this case the output of the routine are not save as ASCII-files. Any suggestion on how to modify the outputs in order to make them post-processable in matlab for instance?


Thanks!!
giano is offline   Reply With Quote

Old   August 18, 2022, 02:08
Default
  #2
New Member
 
Elizabeth Dauengauer
Join Date: Oct 2021
Posts: 1
Rep Power: 0
ElizabethDauenaguer is on a distinguished road
Hi! I have the same broblem. Did you find any solution?
ElizabethDauenaguer is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Calculating bubble volume in rising bubble simulation Venky_94 OpenFOAM Post-Processing 0 November 4, 2021 17:14
[OpenFOAM] plotting bubble shape from contour coordinates in matlab JM27 ParaView 0 May 15, 2020 16:30
Rising velocity - 3D single bubble thintn222 OpenFOAM Post-Processing 1 December 14, 2019 16:13
A rising bubble in a stagnant liquid with two-fluid-model fs82 OpenFOAM Running, Solving & CFD 30 August 18, 2016 13:27
Access cell coordinates and wall data in posdat.f Boban Siemens 5 July 22, 2005 05:25


All times are GMT -4. The time now is 21:53.