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

Question for CFD programmers

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 6, 2005, 19:39
Default Question for CFD programmers
  #1
Renato
Guest
 
Posts: n/a
Dear friends

Most of the CFD codes are based on efficient solution methods, or at least should be based on... . As the evolution of the programming languages the OOP (Object Oriented Programming) paradigm has been dragging several CFD researchers to develop your codes in OOP languages such as C++, so I would like to hear some opinions and experiences about the following questions:

- Could CFD codes be implemented efficiently; with parallelism, vectorization, pipelining, cache reuse, etc ; in a OOP based paradigm?

- How long Fortran language will survive among engineering researchers?

Thanks for your attention

Renato.

  Reply With Quote

Old   October 7, 2005, 05:44
Default Re: Question for CFD programmers
  #2
ganesh
Guest
 
Posts: n/a
Dear Renato,

I am a CFD programmer and I have been using Fortran 90 with a good amount of success. My opinion is that as far as scientific programming is concerned, Fortran is still the best. True, OOP is catching up and with some of its features has provided promising resources. However, what I have observed is that while C++ has the advantage of memory savings it loses on the time front, while in Fortran the memory requirements could be higher, but the time of computation is kept low. I therfore personally believe that Fortran does have a future among researchers, although I am sure that OOP does have its own advantages and is gaining popularity in engineering community.

Regards,

Ganesh
  Reply With Quote

Old   October 7, 2005, 06:40
Default Re: Question for CFD programmers
  #3
han
Guest
 
Posts: n/a
Hi I am also CFD programmer,

my opinion is , Fortan will be always there in the research commnity but it may not be given much importance in the commercial codes. but each having its owen merits and demerits.

no doubt with memory point of view OOP is far better and if the programmer is quiete efficient, OOPS time point of view also it will be very good

but with OOPS there will be little bit complex for the fresher

  Reply With Quote

Old   October 7, 2005, 07:12
Default Re: Question for CFD programmers
  #4
Dingxi Wang
Guest
 
Posts: n/a
why can't Fortran take the features of OPP?It seems that Fortran09 has many features of OOP,hasn't it?
  Reply With Quote

Old   October 7, 2005, 07:24
Default Re: Question for CFD programmers
  #5
andy
Guest
 
Posts: n/a
The latest version of Fortran has statements to support OOP but you can do OOP in any language if you wish. The OO programming model is well suited to the preprocessor and the postprocessor but not really the solver. Here the nature of the problem tends to favour the traditional procedural based approach.

> - Could CFD codes be implemented efficiently; with parallelism, vectorization, pipelining, cache reuse, etc ; in a OOP based paradigm?

OOP in itself has little impact on efficiency. What impacts efficiency is how different languages work. For example, languages like C++ that allow array aliasing will cripple the optimization available to the compiler. Curiously, many C++ have hand coding these "compiler" optimizations into their low level matrix functions and consider this to be a really neat feature. There is a discussion along these lines in the archives somewhere.

If one works hard it is possible to write a large amount of complex C++ code that approachs the speed of execution of straightforward Fortran code. However, is this a sensible use of time for research engineers and scientists?

> - How long Fortran language will survive among engineering researchers?

The evoluton of Fortran has been a disappointment : - Fortran 77 was only a mild revision of Fortran 66 but given the evolution of languages at the time this was a big mistake. - Fortran 90 was late and half-implemented too many features. This made the language big but without the ability to do things properly. - Fortran 95 was a bug fix for Fortran 90 without really addressing the half-implemented features. - Fortran 2003 appears to address many of the half-implemented issues but I have no direct experience. If a reasonable job has been done then in 2010 when the compilers are stable I suspect it will be one of the 2 or 3 languages widely used by research engineers and scientists.

  Reply With Quote

Old   October 7, 2005, 07:34
Default Re: Question for CFD programmers
  #6
Alexey
Guest
 
Posts: n/a
OOP is based on certain vision of the processeses to be modelled by means of programming. OOP is convenient when you can model the reality by means of pogramming objects and you can map real objects to programming objects. In OOP you define methods for this objects which imitate the features, properties, behavior of real objects. Unlike physical (objective) reality for OOP programs CFD models are based on formulas. Variables of these formulas are rather PROPERTIES of the physical objects than the objects themselves. FORTRAN was invented for treating these formulas that is why it exactly fits the formula based model of the fluid. Computational efficiency of C++ seems to be due to flexibility of C coding (not C++) at the expense of more work with coding (and debugging) itself. Maybe somebody will succeed with robust fluid models based on behavior of single molecules, but seems like such models (e.g.Boltzmann equation for gases) are so far solved by formulaistic models...
  Reply With Quote

Old   October 7, 2005, 09:23
Default Re: Question for CFD programmers
  #7
Márcio Ricardo
Guest
 
Posts: n/a
It's true that OOP is more complex, but FORTRAN is moving toward OOP too (F90, F95 ...), so this is not an advantage it will have for a long time. On the other hand, C++ has been evolving towards speed performance, and for us, cientific programmers, the most appealing features of this language are those of generic programming, not the traditional object-oriented programming, which realy slows down the code, although it is very usefull when there are many people working in the project. Futurely, both languages could converge to the same paradigm, aiming at usage flexibility and speed performance at the same time, and using one or another would be a matter of which syntax you prefer.
  Reply With Quote

Old   October 7, 2005, 09:45
Default Re: Question for CFD programmers
  #8
Renato
Guest
 
Posts: n/a
Yeah Andy, I agree with you. OOP languages, including the features that Fortran 9X-03 have to support OOP, are pretty suitable for pre and post processing fases but not for the solution process. I think that for the solution fase the simplest code and data structure is the best to achieve the desired high performance computing.

Furthermore, I think that Fortran has the advantage of being the easiest, simplest and powerful language for engineerings and researchers develop your own programs in a short time but I'm feeling that there has been some pressure to discourage the use of Fortran language in the next generation of engineerings and other related sciences. It's easy to prove that Fortran's popularity has been diminishing if you try to find a good IDE (Interface Development Enviroment) to develop programs in Fortran. Thanks God that have people interested in keeping Fortran language alive like Andy that have been developing a free Fortran compiler [see http://www.g95.org]. I can't forget to mention Intel, that has been supporting and developing the Ifort compiler too.

(...Andy are you the same Andy of the G95!?...)

I've been programming in Fortran language since I began my MSc (it was in 2000) and I'm considered a dinosaur for many new C++ programmers for being using Fortran yet, but Why should I use other language if Fortran has been doing everything I want easily?

Regards

Renato

  Reply With Quote

Old   October 7, 2005, 10:22
Default Re: Question for CFD programmers
  #9
Arunvel
Guest
 
Posts: n/a
OOPS brings in more readymadeness into the code - For example it is always userfriendly to work with Icepak than to solve the same problem in Ideas Electronics Cooling. Defining entities as entities (PCB as PCB and not a plate with XYZ thickness and properties) is much helpful I would say. Object oriented approach is always the best from user's front - dont have much idea on the computation time sclaes though.
  Reply With Quote

Old   October 7, 2005, 10:25
Default Re: Question for CFD programmers
  #10
Márcio Ricardo
Guest
 
Posts: n/a
FORTRAN will never be discontinued because of the huge amount of legacy code written in that language.

Now, concearning the "easy of use", I don't think that learning another computer language could be harder than studying turbulence, fluid mechanics, solid mechanics or any other scientific area.
  Reply With Quote

Old   October 7, 2005, 10:37
Default Re: Question for CFD programmers
  #11
Renato
Guest
 
Posts: n/a
Yes Marcio, I agree that to learn another computer language couldn't be harder than to study CFD topics, but I think that by learning an easier and more focused programming language you have more time left to spend with your CFD, or any other science, studies.

By the way, which one do you prefer: to study programming language or CFD? I'd rather the latter... ;o)

Renato.
  Reply With Quote

Old   October 7, 2005, 11:13
Default Re: Question for CFD programmers
  #12
andy
Guest
 
Posts: n/a
>> (...Andy are you the same Andy of the G95!?...)

No.

Fortran has not been well suited for many of the tasks performed by computer scientists and they, quite rightly, have prefered other more expressive languages. Unfortunately, it is usually computer scientists that provide computer courses for scientists and engineers. Also the PC and much of the web has grown up around C and derivatives and young researchers pick up on this.

I am not sure there is pressure against Fortran in the scientific field but more that young scientists are first taught to program in some other language and have an understandable tendency to stick with it given a choice.

>> I've been programming in Fortran language since I began my MSc (it was in 2000) and I'm considered a dinosaur for many new C++ programmers for being using Fortran yet, but Why should I use other language if Fortran has been doing everything I want easily?

When it comes to programming within a group I would often suggest going along with the group language whatever it is (within reason). Computer languages are rarely important compared to communicating/sharing code effectively within a group. However, if you are working independently then sticking with the language you know and investing time in what you are programming would seem reasonable.
  Reply With Quote

Old   October 7, 2005, 11:22
Default Re: Question for CFD programmers
  #13
Márcio Ricardo
Guest
 
Posts: n/a
>>which one do you prefer: to study programming language or CFD? I'd rather the latter... ;o)

Well, studying a programming language without aiming at any application is worthless, of course, but since you've chosen your research field and your computer language, it would be wise to study that language in order to get any advantages it could offer to solve your problem. :>
  Reply With Quote

Old   October 8, 2005, 11:20
Default Re: Question for CFD programmers
  #14
dingxiwang
Guest
 
Posts: n/a
That is exactly what I want to say
  Reply With Quote

Old   October 8, 2005, 21:24
Default Received error
  #15
Issy
Guest
 
Posts: n/a
Hi i'd modelled out a nozzle volume structure and meshed it together in gambit but when I upload it in fluent it prompted me this message "Error Object: phase-domain?". What does this means and how do i rectify it?
  Reply With Quote

Old   October 17, 2005, 07:07
Default Re: Question for CFD programmers
  #16
Vinod Dhiman
Guest
 
Posts: n/a
Hi

With the advent of Fortran 200x you can ask how long C++ will survive among Scientific Researchers, as it is more efficient and more effective than C++. You can write not just the code, but whole of the software, without using any other language. And it is High Perfomance, too.

However, it is a matter of experience, which language you prefer.

Vinod Dhiman
  Reply With Quote

Reply

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
question about uds tanven FLUENT 2 July 5, 2015 12:22
Unanswered question niklas OpenFOAM 2 July 31, 2013 17:03
Poisson Solver question Suresh Main CFD Forum 3 August 12, 2005 05:37
CHANNEL FLOW: a question and a request Carlos Main CFD Forum 4 August 23, 2002 06:55
question K.L.Huang Siemens 1 March 29, 2000 05:57


All times are GMT -4. The time now is 06:33.