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

iteration of loop in FORTRAN language

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 15, 2014, 06:30
Default iteration of loop in FORTRAN language
  #1
New Member
 
saida chatti
Join Date: Mar 2014
Posts: 6
Rep Power: 12
saida29 is on a distinguished road
Hello

how I can write in FORTRAN an iterative loop that stops when the convergence condition is satisfied. The convergence condition is: the difference between the two values ​​obtained by two successive iteration (X (iter2)-X (iter1)) is low in the order of [10] [-3].
thank you very much
saida29 is offline   Reply With Quote

Old   March 15, 2014, 11:48
Default
  #2
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
http://en.wikibooks.org/wiki/Fortran/Fortran_control

This should answer your question!

Last edited by cfdnewbie; March 15, 2014 at 13:27.
cfdnewbie is offline   Reply With Quote

Old   March 15, 2014, 13:22
Default
  #3
New Member
 
saida chatti
Join Date: Mar 2014
Posts: 6
Rep Power: 12
saida29 is on a distinguished road
hello
thank you very much for the reply.
i calculate the velocity. I want to express the difference between two values ​​for two successive iteration if the difference is we stopped the iteration if not the calculated repeats
saida29 is offline   Reply With Quote

Old   March 15, 2014, 13:28
Default
  #4
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
Well, you have already described the algorithm:
compute the difference, compare it to some threshold and abort the computation or continue...
I'm not sure what it is that confuses you...
cfdnewbie is offline   Reply With Quote

Old   March 15, 2014, 13:49
Default
  #5
New Member
 
saida chatti
Join Date: Mar 2014
Posts: 6
Rep Power: 12
saida29 is on a distinguished road
hello
yes that's what i want to calculate. i don't know how to write that the value of the velocity of the first iteration is the old one and the value of the second iteration is the new one and the convergence this the new - the old
thank you
saida29 is offline   Reply With Quote

Old   March 15, 2014, 14:44
Default
  #6
Senior Member
 
cfdnewbie
Join Date: Mar 2010
Posts: 557
Rep Power: 20
cfdnewbie is on a distinguished road
This is very basic stuff. I suggest you work through something like this: http://www.cs.mtu.edu/~shene/COURSES...S/fortran.html

This will enable you to do want you intend to do!
cfdnewbie is offline   Reply With Quote

Reply

Tags
convergence, fortran, iteration

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[Gmsh] Problem with Gmsh nishant_hull OpenFOAM Meshing & Mesh Conversion 23 August 5, 2015 03:09
How to do a counter to exit loop in scheme language? rayolau Fluent UDF and Scheme Programming 1 May 23, 2013 09:15
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 19:56
NACA0012 geometry/design software needed Franny Main CFD Forum 13 July 7, 2007 16:57
Creating, loop or iteration using expression edito Jan CFX 3 July 28, 2003 12:01


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