|
[Sponsors] |
February 25, 2015, 17:58 |
How to get conditional minima and maxima?
|
#1 |
Member
Raunak Bardia
Join Date: Jan 2015
Posts: 32
Rep Power: 11 |
Hi everyone,
I am a beginner in OpenFoam and I am having troubles with a simple problem of droplet collision. I am trying to find the minimum x coordinate where phase 1 exists and maximum x coordinate where phase 1 exists in the entire domain for my two phase interfoam simulation. Here is that code: volVectorField centres = alpha1.mesh().C(); volScalarField xcomp = centres.component(0); xl = 100; xr = -100; forAll (alpha1.internalField(), nCells) { if(alpha1.internalField()[nCells] > 0.5) { if(xcomp[nCells] < xl.value()) xl.value() = xcomp[nCells]; if(xcomp[nCells] > xr.value()) xr.value() = xcomp[nCells]; } } I am logging it separately in a file but I am not getting the correct results. Moreover, for 4000 time steps I am getting 4195 values which is weird because I am logging Kinetic Energy for the entire domain as well and I am getting exactly 4000 values for 4000 time steps. I am running the simulation on 12 processors. I am not sure if that is the issue because Kinetic Energy seems to be in order. Any help is appreciated. Thanks! |
|
Tags |
conditional if statement, coordinates, logfile, maximum, minimum |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
TVD | student | Main CFD Forum | 6 | September 9, 2002 10:19 |
finite volume | mehdi | Main CFD Forum | 12 | June 2, 2000 21:32 |