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/)
-   -   Problems with dimension (https://www.cfd-online.com/Forums/openfoam-programming-development/116913-problems-dimension.html)

idefix April 28, 2013 03:34

Problems with dimension
 
Hello,

hopefully Ive got an easy question for you

I just want to calculate a absolut value of a gradient of a volScalarField (for example epsilon of the k-epsilon-turbulence model)

Could somebody help me with the name of the function?

Thanks a lot

nimasam April 29, 2013 04:06

Code:

mag(fvc::grad(epsilon))

idefix April 29, 2013 04:33

Thanks :)

but now I get an error because of the dimensions.
(--> FOAM FATAL ERROR:
LHS and RHS of - have different dimensions
dimensions : [0 -1 0 0 0 0 0] - [0 0 0 0 0 0 0] )


I want to calculate
( mag(fvc::grad(alpha1_)) - 1 ) / ( mag(fvc::grad(alpha1_)) - 1.1 )

alpha1_ is the phase volume fraction of the VOF-model

Has somebody an idea how I can do it?
I thought that this term has no dimension:
(metre - 1) / (metre -1 ) = 1

thanks again

nimasam April 29, 2013 06:06

its some how obvious :P, grad means in simple word d/dx , when you gradient a dimless value! it gets a dimension -1 for meter ;) so you can not add it with a constant number :) unless you use its value with value() function or give you constant a dimension ;)


All times are GMT -4. The time now is 02:59.