CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Monitoring Volume Average of Liquid Velocity Magnitude in a Bubble Column / Airlift (http://www.cfd-online.com/Forums/openfoam-post-processing/113779-monitoring-volume-average-liquid-velocity-magnitude-bubble-column-airlift.html)

kevinlipps February 26, 2013 11:52

Monitoring Volume Average of Liquid Velocity Magnitude in a Bubble Column / Airlift
 
Hi there,

Im fairly new to openFoam, but I know that there is a swak4foam utility that helps solving some minor problems.

What I want to do is to monitor the Volume Average of a defined region of an airlift reactor over the flow time so I can see when the system reaches quasi steady state.
In Fluent there are the "Monitors" which allow that feature - a textfile containing the flowtime and the volumeaverage of the water velocity magnitude of a defined region/volume is written and appended after each timestep of that transient simulation.

The head region of the airlift reactor is not needed, because here the water velocity changes to much because of bubbles bursting at the water/air interface. Instead it would be enough to patch a region from the bottom/sparger until maybe 10 mm underneath the water level. Then a volume average of the water velocity magnitude of that patch shall be written into a text file along with the current flow time. This allows to be plotted XY. Finally this shows how long a simulation need until a quasi steady state is reached.

I guess its very simple code using swak4foam... I just never haved used it and are also very new to openfoam, so I would be very glad if somebody could give those 10? lines of code along a short tutorial what to do else to the openfoam case to make this work.

Thx in advance
Kevin

gschaider February 26, 2013 19:01

Quote:

Originally Posted by kevinlipps (Post 410222)
Hi there,

Im fairly new to openFoam, but I know that there is a swak4foam utility that helps solving some minor problems.

What I want to do is to monitor the Volume Average of a defined region of an airlift reactor over the flow time so I can see when the system reaches quasi steady state.
In Fluent there are the "Monitors" which allow that feature - a textfile containing the flowtime and the volumeaverage of the water velocity magnitude of a defined region/volume is written and appended after each timestep of that transient simulation.

The head region of the airlift reactor is not needed, because here the water velocity changes to much because of bubbles bursting at the water/air interface. Instead it would be enough to patch a region from the bottom/sparger until maybe 10 mm underneath the water level. Then a volume average of the water velocity magnitude of that patch shall be written into a text file along with the current flow time. This allows to be plotted XY. Finally this shows how long a simulation need until a quasi steady state is reached.

I guess its very simple code using swak4foam... I just never haved used it and are also very new to openfoam, so I would be very glad if somebody could give those 10? lines of code along a short tutorial what to do else to the openfoam case to make this work.

Thx in advance
Kevin

It's a bit confusing to me as you're not in the OpenFOAM nomenclature. Especially about "patch" which in OF is a boundary patch.

The general mechanism for such "monitors" in OpenFOAM are functionObjects: small plugin-programs that are executed at the end of each timestep. swak4foam happens to implement some.

So what you want is monitor the velocity magnitude in a subvolume of the mesh. How you do that depends on whether the sub-volume is defined in the mesh by a cellSet or a cellZone. In that case a swak-functionObject like (I'm doing this off the top of my head. There my be typos or involuntary omissions) this could do it:
Code:

waterVel {
  type swakExpression;
  valueType cellSet;
  setName kevinsSet;
  expression "mag(U)*alpha1*vol()/(alpha1*vol())";
  accumulations (
    sum
  );
  verbose true;
}

(I'm not quite sure about your definition of "volume average" in a multiphase problem). If there is no such set, then the trick would be to pick all cells that satisfy a certain criteria an sum those
Code:

waterVel {
  type swakExpression;
  valueType internalField;
  variables (
      "validVol=pos().z<-0.01 ? vol() : 0;"
  );
  expression "mag(U)*alpha1*validVol/(alpha1*validVol)";
  accumulations (
    sum
  );
  verbose true;
}

This assumes that you're only interested in the region with z< -10mm

kevinlipps February 27, 2013 11:26

Hey there Gschaider. Thx for your swift answer. :)

By Volume Average I mean the value of the Water Velocity Magnitude of each cell divided by the number of cells in the region of interest which brings me to the expression "patch" I used but what I meant is a defined reagion which is somewhat smaller than the whole computational domain/airlift reactor. (There is a function in Fluent "adapt -> region..." and then you can for example patch air to the headspace for initial condition - thats kinda what I meant. ;) )

gschaider March 1, 2013 06:57

Quote:

Originally Posted by kevinlipps (Post 410451)
Hey there Gschaider. Thx for your swift answer. :)

By Volume Average I mean the value of the Water Velocity Magnitude of each cell divided by the number of cells in the region of interest which brings me to the expression "patch" I used but what I meant is a defined reagion which is somewhat smaller than the whole computational domain/airlift reactor. (There is a function in Fluent "adapt -> region..." and then you can for example patch air to the headspace for initial condition - thats kinda what I meant. ;) )

OK. The thing I was refering to was whether you also use the volume fraction of water (you never said which solver you used but I assumed interFoam). So you can remove the alpha1 from the terms I posted


All times are GMT -4. The time now is 17:07.