CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   fields + dimensions (

santiagomarquezd February 28, 2011 22:29

fields + dimensions
Hi all, I'm working in a solver and facing some problems at the time of deciding in how to implement the continuum formulation. Until I've read all important field in solver like, U, p, alpha, etc. are read from disk with dimensions and are used this way. Constants read from dictionaries have dimensions too.
My problems arise when I have to do some temporal calculus because I want to keep the dimensions in scalar and vectorFields. I'm using vol*Field to do so, but this kind of object have boundaries, which often are not necessary, because I'm doing calculus only with the internalField. When I use this fields as denominators the problem is that generates an error because the zero values of boundaries.

1. Is there a way to circumvent this issue?
2. Is normal to use vol*Fields to do this temporal calculus or is better to use non-dimensional objects or another kind of class?

Thanks in advance.

nimasam March 1, 2011 07:52

ur question is not clear at least for me
however for example if alpha is vol scalar field then
scalarField alphaInternal= alpha.internalField();

santiagomarquezd March 1, 2011 12:57

Yes this is an option, but it does not preserve the units, so you have to do all calculations without units.


cliffoi March 7, 2011 13:47

You can use DimensionedFields to preserve the dimension checking, i.e.

DimensionedField<scalar, fvMesh>& alphai = alpha;

All times are GMT -4. The time now is 20:31.