giano |
March 22, 2022 04:54 |
Get access to the coordinates of a cell for post-processing of rising bubble
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:
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:
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!!
|