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

fortran Code for a boundary layer on a plate

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By CLF
  • 1 Post By ssh123
  • 1 Post By piu58

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 4, 2013, 17:16
Default fortran Code for a boundary layer on a plate
  #1
Member
 
shahrbanoo
Join Date: Mar 2013
Posts: 63
Rep Power: 13
shahrbanoo is on a distinguished road
Hi...
I'm trying to undersatnd this code that our teacher gave us... he said to change one of the boundary conditions and then see how the result changes. This code's title is "LAMINAR BOUNDARY LAYER FLOW OVER AN ISOTHERMAL FLAT PLATE" . I don't understand what H, G, FPIN,... and other parameters, are. cause It's the first time I'm using a fortran code. I would really appreciate it if someone help me... .
I put the Code in the next post...
shahrbanoo is offline   Reply With Quote

Old   April 4, 2013, 17:20
Default
  #2
Member
 
shahrbanoo
Join Date: Mar 2013
Posts: 63
Rep Power: 13
shahrbanoo is on a distinguished road
because it is too long,I have to split it into two parts:
!************************************************* ***********************
!***** *****
!***** SIMPLATE *****
!***** ________ *****
!***** *****
!************************************************* ***********************
!***** *****
!***** THIS PROGRAM GIVES SIMILARITY SOLUTION RESULTS FOR *****
!***** *****
!***** LAMINAR BOUNDARY LAYER FLOW OVER AN ISOTHERMAL FLAT PLATE *****
!***** *****
!************************************************* ***********************
!*
DIMENSION T(1500),F(1500),G(1500),H(1500),HGUESS(1500),FPIN(1500),P(1500)
!*
!************************************************* **********************
!*
OPEN(UNIT=1,FILE='SIMPLAPR.DAT',status='new')
OPEN(UNIT=2,FILE='SIMPLAPL.DAT',status='new')
!************************************************* **********************
WRITE(6,4250)
WRITE(6,4290)
WRITE(6,4260)
READ(5,*) PR
WRITE(6,4250)
DETA=0.01
N=1500
WRITE(1,4290)
WRITE(1,4270) PR
!************************************************* **********************
! N=NUMBER OF GRID POINTS
! PR=PRANDTL NUMBER
! DETA=ETA STEP SIZE
END
shahrbanoo is offline   Reply With Quote

Old   April 4, 2013, 17:21
Default
  #3
Member
 
shahrbanoo
Join Date: Mar 2013
Posts: 63
Rep Power: 13
shahrbanoo is on a distinguished road
!************************************************* **********************
INTR=1
HGUESS(INTR)=1.0
100 F(1)=0.0
G(1)=0.0
H(1)=HGUESS(INTR)
DO 1000 I=2,N
F(I)=F(I-1)+G(I-1)*DETA
G(I)=G(I-1)+H(I-1)*DETA
H(I)=H(I-1)-F(I-1)*H(I-1)*DETA/2.0
1000CONTINUE
FPIN(INTR)=G(N)
IF(INTR.EQ.1)THEN
INTR=2
HGUESS(INTR)=HGUESS(1)-0.000001
GO TO 100
ELSE
IF(INTR.GT.200)GO TO 200
IF(ABS(1.0-FPIN(INTR)).LT.0.0000005)GO TO 300
INTR=INTR+1
DGUESS=+(FPIN(INTR-1)-1.0)*(HGUESS(INTR-1)-HGUESS(INTR-2))/(FPIN(INTR-2)-FPIN(INTR-1))
HGUESS(INTR)=HGUESS(INTR-1)+DGUESS
GO TO 100
ENDIF
200WRITE(6,2000)
GO TO 7777
300WRITE(6,3000) INTR
7777CONTINUE
DO 5000 I=1,N
P(I)=H(I)**PR
5000CONTINUE
T(1)=0.0
DO 6000 I=2,N
T(I)=T(I-1)+DETA*(P(I)+P(I-1))/2.0
6000CONTINUE
WRITE(1,4500)
DO 7000 I=1,N
T(I)=T(I)/T(N)
ETA=(I-1)*DETA
WRITE(1,4000) ETA,F(I),G(I),H(I),T(I)
WRITE(2,5500) ETA,G(I),T(I)
7000CONTINUE
TGRAD=(T(2)-T(1))/DETA
WRITE(1,4280) TGRAD
STOP
CLOSE(1)
CLOSE(2)
2000FORMAT(' FAILURE TO CONVERGE')
3000FORMAT(' CONVERGENCE IN ',I5,' ITERATIONS')
4000FORMAT(5F10.6)
4250FORMAT(////)
4260FORMAT(' INPUT THE VALUE OF THE PRANDTL NUMBER THEN ')
4270FORMAT(//,' PRANDTL NUMBER = ',F12.3,//)
4280FORMAT(//,' THETA GRADIENT AT WALL = ',F12.5)
4290FORMAT(/,' SIMILARITY SOLUTION FOR FLOW OVER ISOTHERMAL PLATE',//,'Output written to files SIMPLAPR.DAT and SIMPLAPL.DAT',//)
4500FORMAT(' ETA F dF/DETA D2F/DETA2 THETA')
5500FORMAT(F10.6,',',F10.6,',',F10.6)
shahrbanoo is offline   Reply With Quote

Old   April 18, 2018, 16:53
Default
  #4
Senior Member
 
Have a nice time!
Join Date: Feb 2016
Location: mech.eng.ahmedmansour@gmail.com
Posts: 291
Rep Power: 11
Ahmed Saeed Mansour is on a distinguished road
Hello, have you run this code?
Thanks
Ahmed Saeed Mansour is offline   Reply With Quote

Old   April 19, 2018, 01:57
Default
  #5
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
Without analyzing the code en détail it looks like a realisation of the publication of Simon Ostrach "An analysis of laminar free-convection flow and heat transfer about a flat plate paralled to the direction of the generating body ".

All the variables look the the ones mentioned in the article. I wrote a smallish C++ program for it.

The most complicated point is to find the right boundary conditions, because one of the values are not known for t=0, but for t=infinity. You have to implement some kind of shooting method to find it form your material constants.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   April 20, 2018, 13:13
Default
  #6
Senior Member
 
Have a nice time!
Join Date: Feb 2016
Location: mech.eng.ahmedmansour@gmail.com
Posts: 291
Rep Power: 11
Ahmed Saeed Mansour is on a distinguished road
Thank you very much for the reply sir, is it okay to send me the code you typed by e-mail? I wanna learn how to write codes.
Could you help me?
Vielen Dank!
Ahmed Saeed Mansour is offline   Reply With Quote

Old   April 20, 2018, 15:02
Default
  #7
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
Quote:
Originally Posted by Ahmed Saeed Mansour View Post
Thank you very much for the reply sir, is it okay to send me the code you typed by e-mail? I wanna learn how to write codes.
Could you help me?
Vielen Dank!
My code is commented in German and contains some code for the shooting method. It may be that you don't understand everything, simply because it has some experimental part in it.

Nevertheless, I send it. Please don't give it away. If somebody needs it, they may drop me a line.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   April 20, 2018, 17:01
Default
  #8
CLF
New Member
 
CFlr
Join Date: Feb 2018
Location: FRG
Posts: 5
Rep Power: 8
CLF is on a distinguished road
You could check the Book of Cebeci and Bradshaw, which also discusses this topic.
CLF is offline   Reply With Quote

Old   April 20, 2018, 18:21
Default
  #9
Senior Member
 
Have a nice time!
Join Date: Feb 2016
Location: mech.eng.ahmedmansour@gmail.com
Posts: 291
Rep Power: 11
Ahmed Saeed Mansour is on a distinguished road
Quote:
Originally Posted by piu58 View Post
My code is commented in German and contains some code for the shooting method. It may be that you don't understand everything, simply because it has some experimental part in it.

Nevertheless, I send it. Please don't give it away. If somebody needs it, they may drop me a line.
Okay sir, I sent my e-mail to you,
Vielen Dank!
Ahmed Saeed Mansour is offline   Reply With Quote

Old   April 21, 2018, 00:51
Default
  #10
New Member
 
Truong Dang
Join Date: Oct 2016
Location: Vietnam
Posts: 21
Rep Power: 10
ssh123 is on a distinguished road
Hello,

Below is the Fortran source file for the code given by @shahrbanoo. I have to fix some typos in the code to make it work with gfortran.
Attached Files
File Type: zip Similarity_solution_laminar_flat_plate.zip (1.6 KB, 39 views)
ssh123 is offline   Reply With Quote

Old   April 21, 2018, 02:19
Default
  #11
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
I sent you the file. Much success!
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   April 21, 2018, 13:01
Default
  #12
Senior Member
 
Have a nice time!
Join Date: Feb 2016
Location: mech.eng.ahmedmansour@gmail.com
Posts: 291
Rep Power: 11
Ahmed Saeed Mansour is on a distinguished road
Quote:
Originally Posted by ssh123 View Post
Hello,

Below is the Fortran source file for the code given by @shahrbanoo. I have to fix some typos in the code to make it work with gfortran.
Thank you very much !!! I really appreciate that!
Ahmed Saeed Mansour is offline   Reply With Quote

Old   April 21, 2018, 13:03
Default
  #13
Senior Member
 
Have a nice time!
Join Date: Feb 2016
Location: mech.eng.ahmedmansour@gmail.com
Posts: 291
Rep Power: 11
Ahmed Saeed Mansour is on a distinguished road
Quote:
Originally Posted by piu58 View Post
I sent you the file. Much success!
Vielen Dank!
Ahmed Saeed Mansour is offline   Reply With Quote

Old   April 22, 2018, 00:06
Default
  #14
New Member
 
Truong Dang
Join Date: Oct 2016
Location: Vietnam
Posts: 21
Rep Power: 10
ssh123 is on a distinguished road
You are welcome.
ssh123 is offline   Reply With Quote

Old   April 22, 2018, 00:09
Default
  #15
New Member
 
Truong Dang
Join Date: Oct 2016
Location: Vietnam
Posts: 21
Rep Power: 10
ssh123 is on a distinguished road
Quote:
Originally Posted by Ahmed Saeed Mansour View Post
Thank you very much !!! I really appreciate that!
You are welcome. I think to understand the code, the best way is firstly read the paper mentioned by @piu58, after that you shall be able to understand the code.
ssh123 is offline   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
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 18:44
Turbulent Boundary Layer on flat plate samygero ANSYS 2 May 31, 2011 10:53
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 16:55
Boundary Layer code ellen Main CFD Forum 4 April 21, 2003 18:11


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