- **OpenFOAM Running, Solving & CFD**
(*http://www.cfd-online.com/Forums/openfoam-solving/*)

- - **Equation for scalar source**
(*http://www.cfd-online.com/Forums/openfoam-solving/60490-equation-scalar-source.html*)

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. However, your sv-term has (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 |

Dimension checking - does exacDimension 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 |

Hi guys,
Got that, and indeeHi 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, Radu |

something like this...
dimesomething like this...
dimensionedVector w1 ( "w1", dimensionSet(0,0,-0.5,0,0), vector(-1,1,-1) ); |

I've been trying to see how toI'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 |

Thanks Niklas,
So far so gooThanks 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. Radu |

Or use that... hope my math-skOr use that... hope my math-skills are all forgotten.
grad(a) dot V = div(aV) - a *div(V) and since V is constant... div(aV) = grad(a) dot V hence, fvc::grad(...) = div(...,scal) Henry or Hrv will correct me if im wrong http://www.cfd-online.com/OpenFOAM_D...part/happy.gif N |

Actually, V is not constant, sActually, 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 18:18. |