CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   constant variables in all processors , parallel simulation (https://www.cfd-online.com/Forums/openfoam-programming-development/120935-constant-variables-all-processors-parallel-simulation.html)

saba_saeb July 17, 2013 13:07

constant variables in all processors , parallel simulation
 
Hi Foamers,

Here is the modification that I've applied into a solver.

Code:

volScalarField Boeing::dots() const
{
    scalar temp;
    temp = 0.03 * HS_.value();
    volScalarField dots=mesh_.C().component(1);
    forAll(dots,cel)
    {
        if(dots[cel]>0.05)
      dots[cel]=0.1-dots[cel];
    }

    forAll(dots,cel)
    {
      dots[cel] = dots[cel] + temp;
    }

    return dots;
}

I would like to run the simulation in parallel. As in parallel simulation, every block of the mesh would be solved in a different processor, my implementation breaks! How can I make this volScalarField constant for all of the processors? Any idea?

Cheers,
Saba


All times are GMT -4. The time now is 04:45.