CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Dimensional issues with dimensionless scalar (http://www.cfd-online.com/Forums/openfoam-programming-development/107267-dimensional-issues-dimensionless-scalar.html)

c_dowd September 22, 2012 03:54

Dimensional issues with dimensionless scalar
 
Hi all
I have a feeling there is a very obvious solution to this, but I can't seem to find it for the life of me, i must not be searching for the right thing. I'm adding a new dimensionless scalar into the buoyantPimpleFoam solver, which uses a generic scalar transport equation. I've added it as a volScalarField just as shown in the examples here and here. In particular, the transport equation is:

{
fvScalarMatrix zfEqn
(
fvm::ddt(zf)
+ fvm::div(phi, zf)
- fvm::laplacian(alphaz, zf)
);
zfEqn.solve();
}

The issue is that every time I try to run the solver, I get an error saying that the dimensions don't agree (in particular the first section where [0 0 -1 0 0 0 0] + [1 -3 -1 0 0 0 0], i can change the dimensions of alphaz to make the second bit work no problems). I can clearly see that they don't, yet I can't work out how to make sure that they do. I can't just change the dimensions of zf as it is used in other equations where it is important that it is dimensionless. I tried adding another scalar variable to make phi dimensionless, but I kept having issues implementing it and thought there had to be a better way.

Horus September 22, 2012 07:02

You can turn off dimensions checking though it is not recommended. Set in your controlDict:

dimensionSet 0;

c_dowd September 23, 2012 01:03

Ah thanks a lot. In fact I ended up just putting a new constant in the ddt part to make the dimensions equal but that's good to know.

Bernhard September 23, 2012 13:52

Quote:

Originally Posted by c_dowd (Post 383146)
Ah thanks a lot. In fact I ended up just putting a new constant in the ddt part to make the dimensions equal but that's good to know.

The dimension of alphaz should be m^2/s, because it is a diffusion parameter.


All times are GMT -4. The time now is 21:29.