adding a C code to OpenFOAM
I have a code which I want to use in OpenFOAM. The idea is that at first there is given an initial value of "caurl" and then this loop goes trough all cells of my mesh and recalculates value of "caurl" which is afterwards written out and used again.
How it is possible to make this work with OpenFOAM? I have problems understanding all this class/object thing.
Lastly, b0, r0 and r2 are values taken from graph points and B2 is volScalarField.
The additional questions are:
1) Can I ignore the fact that B2 is defined as volScalarField and I'm trying to compare it with a float data type?
2) How it is possible to make this code work in every cell? Is it something similar to forAll(mesh.V(), celli)?
1) scalar and float are related, you only might get troubles with dimensions
2) Yes, it's exactly like that. forAll(B2, celli) will iterate through the volScalarField. If you use B2[celli], I think you will get a scalar value without dimensions.
|All times are GMT -4. The time now is 11:20.|