CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Equation for scalar source (https://www.cfd-online.com/Forums/openfoam-solving/60490-equation-scalar-source.html)

 niklas September 15, 2005 04:43

Halleluja! Another one saved

Halleluja!
Another one saved by the dimensionality check http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

As you can see from your error message you have incompatible dimensions.
fvm::ddt(scal) has 1/s, which means that all the other terms must have the same dimension.
(1/m)*(m^2/s)^(.5) = s^-0.5, so you should check your terms, they are obviously incompatible,
or there is a dimension in w1.

N

 grtabor September 15, 2005 04:47

Dimension checking - does exac

Dimension checking - does exactly what it says on the tin!

If your scal is dimensionless then when you take a time derivative you get something with dimensions
[0 0 -1 0 0 0 0]. On the rhs you took a square root. This is either wrong, or you need a prefactor to this term with the dimensions [0 0 -0.5 0 0 0 0] to be physically correct.

Gavin

 r2d2 September 15, 2005 06:04

Hi guys, Got that, and indee

Hi guys,
Got that, and indeed the w1 should have dimension of s^-0.5. Then how do I define w1 with the right dimension?
Thanks,

 niklas September 15, 2005 06:17

something like this... dime

something like this...

dimensionedVector w1
(
"w1", dimensionSet(0,0,-0.5,0,0), vector(-1,1,-1)
);

 grtabor September 15, 2005 06:25

I've been trying to see how to

I've been trying to see how to do this implicitly. The easiest way would be to do this:

solve
(
fvm::ddt(scal)
+ fvm::div(phi,scal)
- fvm::laplacian(sgsModel->nuEff(),scal)
== fvm::Sp(sv1/scal,scal)
);

A more elegant way would be to expand your term to get at least one involving (thing)*scal, and discretise that implicitly.

Gavin

 r2d2 September 15, 2005 06:27

Thanks Niklas, So far so goo

Thanks Niklas,
So far so good. Seems to work fine now. Of course this is just a small part of what I want to do. Will get back later, hopefuly with no so easy questions.

 niklas September 15, 2005 06:31

Or use that... hope my math-sk

Or use that... hope my math-skills are all forgotten.
grad(a) dot V = div(aV) - a *div(V)

and since V is constant...

hence,

Henry or Hrv will correct me if im wrong http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

N

 niklas September 15, 2005 07:13

Actually, V is not constant, s

Actually, V is not constant, since nuEff is in there, V=nuEff*w1, so you cant drop that term.

It'll be something like
fvc::grad(...) & w1 = fvm::div(..., scal) -fvm::Sp(div(V), scal)

Anyway, im leaving the details to you.
You do the math. (hehe, I love to say that)

N

 All times are GMT -4. The time now is 03:27.