# natural logarithm function

 Register Blogs Members List Search Today's Posts Mark Forums Read

 July 8, 2009, 09:38 natural logarithm function #1 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Shanghai/Torino, Nanjing/Shanghai/Piemente, China/Italy Posts: 164 Rep Power: 8 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

 July 9, 2009, 02:20 solved #2 Senior Member   ZHOU Bin Join Date: Mar 2009 Location: Nanjing/Shanghai/Torino, Nanjing/Shanghai/Piemente, China/Italy Posts: 164 Rep Power: 8 This is solved. Thank you for your attention. Bin

 October 21, 2009, 02:27 #3 Senior Member   J. Cai Join Date: Apr 2009 Posts: 180 Rep Power: 8 Hi, dear Zhoubin, do you know how to convert dimentionedScalar into volScalarField? thanks. chiven

 October 21, 2009, 05:51 #4 Senior Member   Laurence R. McGlashan Join Date: Mar 2009 Posts: 370 Rep Power: 14 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! __________________ Laurence R. McGlashan :: Website

 July 2, 2010, 05:20 #5 Senior Member   isabel Join Date: Apr 2009 Location: Spain Posts: 171 Rep Power: 8 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?

 July 4, 2010, 06:30 #6 Senior Member   Laurence R. McGlashan Join Date: Mar 2009 Posts: 370 Rep Power: 14 'ln' is not what you think it is. 'ln' is defined in openfoam as: Code: ```bool ln ( const fileName & src, const fileName & dst )``` __________________ Laurence R. McGlashan :: Website

 July 5, 2010, 04:30 #7 Senior Member   isabel Join Date: Apr 2009 Location: Spain Posts: 171 Rep Power: 8 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?

 July 5, 2010, 04:42 #8 Senior Member   Laurence R. McGlashan Join Date: Mar 2009 Posts: 370 Rep Power: 14 I can't see how that works. Use 'Foam::log' which returns a dimensionedScalar and computes the natural logarithm. __________________ Laurence R. McGlashan :: Website

 July 5, 2010, 06:13 #9 Senior Member   isabel Join Date: Apr 2009 Location: Spain Posts: 171 Rep Power: 8 Thank you very much. I prefer your suggestion.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post ivanyao OpenFOAM Running, Solving & CFD 1 October 12, 2012 09:31 gaottino OpenFOAM Native Meshers: blockMesh 7 July 19, 2010 14:11 skabilan OpenFOAM Installation 3 July 28, 2009 00:35 ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50 Rasmus Gjesing (Gjesing) OpenFOAM Native Meshers: blockMesh 10 April 2, 2007 14:00

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