LoginSignup
0
0

More than 5 years have passed since last update.

学習日誌 第一項

Last updated at Posted at 2018-09-25

簡単なレイノルズ数の計算プログラムを作ってみました。
なお検算は一回しかされていない模様。
非常に計算結果は怪しい。

Reynolds_if.f90
program RCS
implicit double precision (a-h,l-z)

write(*,*) "This program is Reynolds Calculation System."
write(*,*) "Please answer diameter[mm]."
read(*,*) d
write(*,*) "Please answer flow rate[m^3/h]."
read(*,*) Fr
write(*,*) "Please answer density of the fluid[kg/m^3]."
read(*,*) mu
write(*,*) "Please answer viscosity of the fluid[Pa*s]."
read(*,*) low
pi=4.0*atan(1.0)
dm=d/(10**3)
D=(dm/2)**2*pi
Fr=Fr/3600
v=Fr/D
Reynolds = (dm*v*mu)/low
write(*,*) 'Cross-sectional area is',D,'[m^2]'
write(*,*) 'Flow velocity is',v,'[m/s]'
write(*,*) 'Reynolds is',Reynolds,'[-]'

  if (2100.lt.Reynolds .and. 4000.gt.Reynolds)then
          write(*,*)"Flow is layer basin."
  else if (2100.gt.Reynolds) then
          write(*,*)"Flow is laminar."
  else 
          write(*,*)"Flow is turbulence."
  end if

end program RCS

迫真Fortran君によるselectの罠。select文は()内に式かつ、その答えが整数でしか使えないというね…

今回の場合なら最初の方に"Integer R"とか入れればいいんですかね。

Reynolds_if.f90
read(*,*) low
pi=4.0*atan(1.0)
d=d*(10**(-3))

最初はこんな感じで書いていたんですが、Reynoldsの計算結果がめちゃくちゃになっていたんですよね…

最初は10の‐3乗が上手く計算ができていなかったようで、d/(10**3)に直しても変わらない。

多分、何度も定数dを利用していたんでエラーになったんですかね?よくわからないです。

結果的に別の定数を用意して事なきを得ました。

以上!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0