CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Bizarre behavior of passing a scalarField to another scalarField (https://www.cfd-online.com/Forums/openfoam/231171-bizarre-behavior-passing-scalarfield-another-scalarfield.html)

randolph October 24, 2020 19:08

Bizarre behavior of passing a scalarField to another scalarField
 
Hi,

I run into some bizarre behavior of passing a scalarField to another scalarField and I can not explain.

I was try to simply pass a scalarField of Y_pre to scalarField of Y. Initially, I just use

Code:

Y = Y_pre
But this does not correctly pass the value to Y. I end up with this following solution.

Code:

forAll(Y,celli)
{
    Y[celli] = Y_pre[celli];
}

My question is what is the difference between these two method? For additional information, there is a YEqn following right after these two different operation.

Thank advance for any insight.

Rdf


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