how to do calculation for a variable when solver runs in parallel
Hello Foamers,
I wanted to get the volume integral of y-component of vorticity and print it on the terminal at run time. The code for the same is as follows; Code:
//vorticity calculation ---------------------------------------------------- So, my question is, how to reassemble vorticity-volume-integral data from all the processors and add it up to print in the terminal. Thanks |
Hi,
You should add a code that collects the variable calculated by every single processor and sum it. In fact, Quote:
There are many snippets that you can find in your OpenFOAM directory regarding coding for simulations in parallel, for example in v2112 you can find them in "applications/test", just look for parallel, parallel communicators etc. In order to collect the overall vorticity, you should add something like: Code:
reduce(vort_volume_integral, sumOp<scalar>()); Hope this helps. Regards, Lorenzo |
All times are GMT -4. The time now is 06:36. |