natural logarithm function
Dear all,
We know that for log function: dimentionedScalar log (const dimentionedScalar & ds) I try to get the log value of (r/R), where r is the distance between the point and cylinder center, R is the cylinder radius. When I take a look at "analyticalCylinder" in programmers' guide, we see that r = volScalarField magCentres; R = dimensionedScalar radius However, magCentres/radius (or magCentres/radius.value()) is not dimentionedScalar, so my question is: do we have log function for this case? Or how could I convert volScalarField into dimentionedScalar, which is required by log function? Thank you for your attention. Bin 
solved
This is solved.
Thank you for your attention. Bin 
Hi, dear Zhoubin, do you know how to convert dimentionedScalar into volScalarField? thanks. chiven

If you solve something, then state how you have solved it. There is NOTHING worse (in my opinion) on message boards than searching through threads such as this!

Hello friends,
I need to define the following variable; it is the natural logarithm of the time and a constant value: volScalarField miso = ln(runTime+0.001); But when I try to compile my solver I have the following error: pdEqn.H:83: error: invalid initialization of reference of type ‘const Foam::fileName&’ from expression of type ‘Foam::dimensionedScalar’ Does anybody know what I have to do? 
'ln' is not what you think it is. 'ln' is defined in openfoam as:
Code:
bool ln ( const fileName & src, 
ln is the natural logarithm. I have successfully compiled my solver by introducing a surfaceScalarField unit variable:
miso = ln(unit*(runTime + 0.001*scalar(1)))); I am not sure if this is the best option.Does anyone have any better solution, or any comment? 
I can't see how that works. Use 'Foam::log' which returns a dimensionedScalar and computes the natural logarithm.

Thank you very much. I prefer your suggestion.

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