CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

I faced difficulty in a fortran error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 19, 2002, 06:35
Default I faced difficulty in a fortran error
  #1
J. Kim
Guest
 
Posts: n/a
Dear all,

I faced an error in fortran compiler: Divide by zero I found out the casue of that. However, I did not know a way to solve it. Here is a error.

---------------- KmT=475.0e-6 KmD=155.0e-3 CDT=2.36e-10 CDD=2.57e-10

C RENEW ATP CONCENTRATION AT BOTTOM WALL

DO 510 I=1,L1

F_ATP=F(I,1,5)*VmaxT/(KmT*CDT)-S/(CDT)

F(I,1,5)=F(I,2,5)+F_ATP*YDIF(2) 510 CONTINUE C RENEW ADP CONCENTRATION AT BOTTOM WALL

DO 520 I=1,L1

F_ADP=F(I,1,6)*VmaxD/(KmD*CDD)-F(I,1,5)*VmaxT/(KmT*CDD)

F(I,1,6)=F(I,2,6)+F_ADP*YDIF(2) 520 CONTINUE

---------------- As you can see, the values of KmT*CDT, CDT, KmD*CDD, and KmT*CDD is very small like the unit.

How can I change them? I would be appreciated for this if you would help me.
  Reply With Quote

Old   March 19, 2002, 06:59
Default Re: I faced difficulty in a fortran error
  #2
STN
Guest
 
Posts: n/a
Hi Kim....

Could you tell which, exactly, line is error ?

Is it this line " F_ATP=F(I,1,5)*VmaxT/(KmT*CDT)-S/(CDT)" or "F_ADP=F(I,1,6)*VmaxD/(KmD*CDD)-F(I,1,5)*VmaxT/(KmT*CDD)"?

If yes, It may because KmT or KmD is not define as REAL or DOUBLEPRECISION parameter. Normaly, FORTRAN define all parameter which has I,J,K,L,M,N in the first letter is INTEGER.So your KmT or KmD is ZERO.

Hope this help.. STN
  Reply With Quote

Old   March 19, 2002, 09:36
Default Re: I faced difficulty in a fortran error
  #3
Seb Perron
Guest
 
Posts: n/a
1) First to make sure that all you variables are declared with the appropriate type, add

implicit none

at the first line of your routine.

2) Compute both

dtmp0=KmT*CDT

and

dtmp1=KmT*CDD

and before making the division, do a simple check on their value.

Good luck.
  Reply With Quote

Old   March 19, 2002, 10:21
Default Re: I faced difficulty in a fortran error
  #4
J. Kim
Guest
 
Posts: n/a
Thanks really for your warm answer.

Like you gave me comment, I already did so. There is still error: Divied by zero.... Are there any solution? I will post the problem again. --------------------- ..... KmT=475.0e-6 KmD=155.0e-3 CDT=2.36e-10 CDD=2.57e-10 ..... DO 510 I=1,L1

F_ATP=F(I,1,5)*VmaxT/(KmT*CDT)-S/(CDT)

F(I,1,5)=F(I,2,5)+F_ATP*YDIF(2) 510 CONTINUE

DO 520 I=1,L1

F_ADP=F(I,1,6)*VmaxD/(KmD*CDD)-F(I,1,5)*VmaxT/KmT*CDD)

F(I,1,6)=F(I,2,6)+F_ADP*YDIF(2) 520 CONTINUE

----------------

----------------------
  Reply With Quote

Old   March 19, 2002, 11:20
Default Re: I faced difficulty in a fortran error
  #5
Wen Long
Guest
 
Posts: n/a
Hi, Kim:

Maybe your KmT, KmD and CDT are too small, and divition by a small number is apt to make errors. Can you normalize it first?

Say, KmT_1=Kmt/1.0e-6, KmD=KmD/1.0e-3 ...

Then you devide by (KmT_1*KmD) and times the result with 1.0e+9,

hope this helps,

wen
  Reply With Quote

Old   March 19, 2002, 13:19
Default Re: I faced difficulty in a fortran error
  #6
Francisco
Guest
 
Posts: n/a
Dear J.Kim,

I´ve pasted your piece of code into my Fortran compiler (F90 for Windows) and with slight modifications (which I hope did not change the divison operation), it seemed to work (no divison by zero). Here is the small code I used:

program kim

implicit none

real*8 KmT, KmD,CDT,CDD,F_ATP,F_ADP,S,VmaxD,VmaxT

KmT=475.0e-6

KmD=155.0e-3

CDT=2.36e-10

CDD=2.57e-10

F_ATP=VmaxT/(KmT*CDT)-S/(CDT)

F_ADP=VmaxD/(KmD*CDD)-F_ATP*VmaxT/(KmT*CDD)

write(*,*) F_ATP,F_ADP,CDT

pause

end

Obviously, I might have removed the source of error, but try it yourself.

Best regards,

Francisco.

  Reply With Quote

Old   March 19, 2002, 18:36
Default Re: Thanks for your good comment.
  #7
J. Kim
Guest
 
Posts: n/a
  Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
polynomial thermophysical properties II sebastian OpenFOAM Running, Solving & CFD 54 November 21, 2019 08:12
OpenFOAM install on Ubuntu Natty 11.04 bkubicek OpenFOAM 13 May 26, 2011 06:48
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42
POSDAT problem piotka STAR-CD 4 June 12, 2009 09:43
user subroutine error CFDUSER CFX 2 December 9, 2006 07:31


All times are GMT -4. The time now is 23:20.