|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
mihamina keisha
Join Date: May 2009
Location: india
Posts: 19
Rep Power: 15 ![]() |
hi there,
I'm implementing a source term in my model and I'm stuck,here it is: volScalarField rpyro = kncell*wncell*rho*exp(Encell/(R*Ts)); and here what it says when I run it: "Argument of transcendental function not dimensionless" I don't know but it clearly says in the guide that to implement exponantial function we need to type exp(term),I defined the dimension for each term but I don't know what' wrong with it. I've checked out the trans() function and I know it but the point is that I didn't even use it. Can somebody out there tell me how to work this out please? Thanks in advance. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 16 ![]() |
Hi keishawillstone
(sorry could not find your real name) I am not sure if this will help but just try this way: volScalarField rpyro = kncell*wncell*rho*Foam::exp(Encell/(R*Ts)); If that does not help then please try a more descriptive post as in this case it is not clear what are Encell, R and T. Are they volScalarFields or just scalars . BR Jaswi |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
mihamina keisha
Join Date: May 2009
Location: india
Posts: 19
Rep Power: 15 ![]() |
Hi Jaswi,
I want to thank you first for answering me.By the way,about the precision, kncell is a scalar wncell is a scalar Encell is also a scalar R is constant used in the perfect gas law(scalar) Ts is the temperature(volScalarField) But I will try it and keep you aware of the result BR, Keisha |
|
![]() |
![]() |
![]() |
![]() |
#4 | |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 694
Rep Power: 27 ![]() ![]() |
Quote:
make the scalars dimensionedScalars instead and make sure the argument to exp is dimensionless. |
||
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
mihamina keisha
Join Date: May 2009
Location: india
Posts: 19
Rep Power: 15 ![]() |
Hi there,
What really puzzles me is that I landed on the analytical cylinder code in potentielFoam and it uses cos() and sin() though these laters are considered as transcendental function and the code didn't even included any specific header but just 'fvCFD.H'. Thank you for the information I will try it and keep you inform BR Keisha |
|
![]() |
![]() |
![]() |
![]() |
#6 |
Senior Member
Join Date: Mar 2009
Posts: 248
Rep Power: 16 ![]() |
Hi There
Yes you are right but please look into the fvCFD.H and you will realize that it is the mother of all headers. take a look ![]() 00001 #ifndef fvCFD_H 00002 #define fvCFD_H 00003 00004 #include "parRun.H" 00005 00006 #include "Time.H" 00007 #include "fvMesh.H" 00008 #include "fvc.H" 00009 #include "fvMatrices.H" 00010 #include "fvm.H" 00011 #include "linear.H" 00012 #include "calculatedFvPatchFields.H" 00013 #include "fixedValueFvPatchFields.H" 00014 #include "adjustPhi.H" 00015 #include "findRefCell.H" 00016 #include "mathematicalConstants.H" 00017 00018 #include "OSspecific.H" 00019 #include "argList.H" 00020 #include "timeSelector.H" 00021 00022 #ifndef namespaceFoam 00023 #define namespaceFoam 00024 using namespace Foam; 00025 #endif 00026 00027 #endif it lives at src/finiteVolume/cfdTools/general/include/fvCFD.H BR Jaswi |
|
![]() |
![]() |
![]() |
![]() |
#7 |
New Member
mihamina keisha
Join Date: May 2009
Location: india
Posts: 19
Rep Power: 15 ![]() |
Hi there,
Thank you so much it works well,the argument should be dimensionless!!!! |
|
![]() |
![]() |
![]() |
![]() |
#8 |
Senior Member
isabel
Join Date: Apr 2009
Location: Spain
Posts: 171
Rep Power: 15 ![]() |
Sorry for disturb you. Do you know how to correct my error?
My code is: forAll(levelSet,gI) { if (levelSet[gI] > 0.0002 ) H[gI] = 1; else { if (levelSet[gI] < 0.0002 ) H[gI] = 0; else H[gI] = sin(levelSet[gI]); } } And when I compile, I have this error in the line " H[gI] = sin(levelSet[gI]) " : levelSetEqn.H:91: error: call of overloaded ‘sin(double&)’ is ambiguous |
|
![]() |
![]() |
![]() |
![]() |
#9 |
Senior Member
Henrik Rusche
Join Date: Mar 2009
Location: Göttingen, Niedersachsen, Germany
Posts: 280
Rep Power: 16 ![]() |
Isabel,
Please do not post the same question all over the place. Henrik |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 02:24 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 18:51 |
UDF Scalar Code: HT 1 | Greg Perkins | FLUENT | 8 | October 20, 2000 13:40 |
UDFs for Scalar Eqn - Fluid/Solid HT | Greg Perkins | FLUENT | 0 | October 14, 2000 00:03 |
UDFs for Scalar Eqn - Fluid/Solid HT | Greg Perkins | FLUENT | 0 | October 11, 2000 04:43 |