|
[Sponsors] |
July 22, 2016, 20:32 |
Foam::pow function in parallel
|
#1 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 16 |
Hi Foamer,
I have the following code that uses a Foam:ow function. The solution is working fine on one processor, but the solution is not correct (distorted) if i do run the code in parallel, any ideas ? Code:
----------------------------------------------------------------------------- Epow = DF; forAll(mesh.C(),i) { Sens[i] = Foam::pow(Epow[i], 0.5); } alpha = Foam::max(a,Foam::max(alpha-half,Foam::min(b,Foam::min(alpha+half,alpha*Sens*lambda)))); ----------------------------------------------------------------------------- Note : The types of the different variables above are either a volScalarField or a dimensionedScalar regards, T.D. |
|
July 23, 2016, 08:56 |
|
#2 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 17 |
I don't think the problem comes from ``pow`` function. It is probably due to using ``max`` and ``min`` which are working locally on each processor. You can try ``gMin`` and ``gMax`` which work globally.
|
|
July 23, 2016, 10:12 |
|
#3 |
Senior Member
Join Date: Sep 2010
Posts: 226
Rep Power: 16 |
Hi Hassan,
Thanks. It tried, but the problem seems to be due to looping on mesh.C(). For example, i tried to update a "volScalarField alpha" in the following simple code: Code:
scalar k=0.; scalar gg=mesh.C().size(); forAll(mesh.C(),i) { alpha[i]=k/gg; k++; } alpha.write(); return 0; Foamers, any ideas, help ? Thanks T.D. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 17:22 |
foamToTecplot360 | thomasduerr | OpenFOAM Post-Processing | 121 | June 11, 2021 10:05 |
[snappyHexMesh] How to define to right point for locationInMesh | Mirage12 | OpenFOAM Meshing & Mesh Conversion | 7 | March 13, 2016 14:07 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 14:11 |
Version 15 on Mac OS X | gschaider | OpenFOAM Installation | 113 | December 2, 2009 10:23 |