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/)
-   -   Internal mesh (https://www.cfd-online.com/Forums/openfoam-programming-development/173382-internal-mesh.html)

cute June 18, 2016 13:13

Internal mesh
 
Hi,

I would like to perform some operations on the internal mesh only. I used the following code, but it also changes my boundary condition. How can I get access to internal mesh only. Need help please.

Code:

forAll(FC, cellI)
 {
        FC[cellI] = k1.value() * C[cellI] / (k2.value() + C[cellI]);
  }

Thanks.

cute June 20, 2016 17:55

Anyone has any comment or idea.

guin June 21, 2016 01:20

What about
FC.internalField()=k1.value()*C.internalField()/(k2.value()+C.internalFied()) ? If this compiles it shall do what you want

cute June 21, 2016 02:34

Thanks, it compiled. But it did not solve my problem.

I am solving for a concentration in a box with dimension 1 x 1 x 0.5 mm^3. I set all sides and bottom with zeroGradient B.C. and top with uniform value of 1. Initially I set the initial internal field as ZERO. When I run my case it also changes the values in all sides, it supposed to be zero. I thought that may be it is changing due to my operation on every cell as mentioned above, therefore I wanted to try updating internal mesh only. But it did not work out.

Need help. Any suggestion. Thanks.

akidess June 21, 2016 02:43

Reread your post carefully. Especially the parts "it's supposed to be zero" and "I set it to zeroGRADIENT".

cute June 21, 2016 02:51

Internal field is zero and all side walls has zeroGradient.
What I don't understand is that, why the values at walls are changing?


All times are GMT -4. The time now is 01:26.