CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   free-cfd (

Ray-zoo May 20, 2001 22:09

- Apologises for mistaken references. This message will avoid this in a near future: it provides none.

Dear CFD-online forum reader,

You might have been looking for a free CFD code without finding required one. So we were, had no ability to buy a code, and then decided to post.

- We do need a custom finite volumes k-epsilon turbulence model. There should be a commercial code for any custom budgets equations, but this does not obey open source policy founding current best software development practice.

There are links to, even finite elements CFD at NSenet, whose adress has been provided on this forum. Website for Mouse libraries may also provide you with relevants links, but does not seem to embed any turbulence model.

We even had contact from here with R.Skoda, who implemented a multigrid SIMPLE algorithm, and was looking after informations about boundary conditions. It looks like his job is a replication of Martin Schmidt's contribution to Pr. Peric's caffa.f, what to be told about NaSt2D ?

This deserves many questions, herein owned leading couple :

i) Wouldn't it be worth the effort building one above e.g. Mouse libs,

and what about all those data formats ?

ii) Can anyone tell us what RANSE stands for:

Rationales Are No Solvables Equations ?

Looking forward to read from people interested in any such projects.

Best Regards,


John C. Chien May 21, 2001 01:10

Re: free-cfd
(1). Over the years, I have developed many many CFD codes for different applications. (laminar, turbulent, incompressible, hypersonic.) (2). If one is willing to recognize the author of the code, then it is much easier to release the code to other users. But in this non-perfect world, it can be used against the author. (3). So, I don't think the code is an issue. and from my point of view, all the information needed to write a code is already available twenty years ago. This include the turbulence models. (4). It is recognized that it takes time to write a code, including code debuging. So, my question is: who is going to pay for the time when the author is writing the code? (5). It is possible to reduce the cost of a working code, by making the problem smaller. I have been thinking about this approach for a long time. But still, if the author can't even survive in this way, then the project has no meaning at all. (6). In other words, the value of the "respect" currently is handled by the price of the code. (or the license to use it) There is no limit, I think, it should be the higher the better. (7). The other solution to this is: to have someelse to pay for the license fee, and get paid to use the code. And I had experience in this approach. (8). So, everything is possible. But it is wrong to distribute a code free of charge, because currently in CFD, the author is not going to derive any befinit from it. And using someone's code without good documentations is not going to be user-friendly at all. (and it wouldn't be a good idea to let the users to publish their results ahead of the author of the free code.) (9). So, some kind of rules (or respect) must be developed first. You don't want to spend the rest of your life reading someone's source code and trying to guess at the author's intention in the code.

Pei-Ying Hsieh May 21, 2001 12:29

Re: free-cfd

It is difficult to use (or modify) a code without documentation (even if you have the souce code) - point 9 in John's message. How about people paying the author for code documentations? Will it work for code developer?

John C. Chien May 21, 2001 12:47

Re: free-cfd
(1). Yes, that has been done in the past. (2). But for today's commercial cfd codes, most are collections of codes from different third party companies. So, it is impossible for them to sell you the codes and documents. Even if they know exactly what is in the codes. (I am almost 100% sure that no single person knows all the source codes in the commercial cfd codes package. without that, there is no good documents) (3). Most likely, numerical scheme is written by engineer-A, the turbulence model is written by engineer-B, or by someone's code, the pre-processor is developed by company-C, and the post-processor is created by sub-contractor to government and is free for distribution and modification. (4). It is like trying to write a good document of a car junk yard. (5). And even for an individual author, it is hard for him to remember what he did three months ago in his code when he was modifying the code in front of his monitor. (6). So, it is a good idea to document it right from the begining. It can be done easily. Otherwise, "EVERYBODY WILL BE SHARING THE COMPUTER BUGS IN THE CODES FROM VARIOUS ENGINEERS AND THIRD PARTY VENDORS". (7). Well, computer bugs are free anyway.

Ray-zoo May 22, 2001 21:15

Re: free-cfd
Dear John C.

It seems that open source may reduce bug propagation instead. This could not be true for any free software, but it seems to be for (e.g.) BSD kernels.

What do you guess internet is running above ?


John C. Chien May 22, 2001 23:13

Re: free-cfd
(1). For the utility type of program, such as to save a file, to open a file, to send e-mail, it is true that open sources will make it easier to eliminate the error. (2). For analysis type of program, unless the program is fully documented, it is difficult to find the error. Sometimes, the common space is used for one variable at the begining of the code, then used for other variables later on, and so forth. This is mainly use to save the momory space and is often done by some programmers. For such programming style, it is very hard to read the code, unless you actually execute it and follow through the program logic. (3). My point is, for simple program, one can read it line by line. But in most cases, it will take a professional six months to one year to read someone's source code, with some document. (4). And sometimes, these codes are not written clean, that is it contains a lot of history in it. (for example, it was used to solve problem-A, then modified to solve problem-B, so when you got the source code, it has a lot of left over parts from the problem-A and problem-B for your problem-C. (5). Anyway, writing CFD code is not difficult (unless you are trying to write a very general cfd code to handle all types of possible problems). My suggestion is: define the specific problem to be solved clearly, then write the most efficient code for it. It is easy and rather straight forward.

Ray-zoo May 24, 2001 13:59

Re: free-cfd
Dear CFD-online forum reader,

I disagree on almost any of John C. Chien's arguments. I intended to contradict his opinions on a point by point basis, but this could have bore some others.

Last message from him about analysis software beeing relevant of a particular case (2) appeared to be one of the meaningless thoughts, I ever went told about from elders:

- One point relevant to open source development shall be the definition of common design guidelines. This step may prevent one from spending years to try to understand a code with arcane features proper to commercial codes builded under nearly unachieavables constraints, such as linking C and fortran components.

Thousand thanks to him for consideration to my posts, anyway.

Best regards,


John C. Chien May 24, 2001 18:19

Re: free-cfd
(1). CFD is more than just to solve a set of equations by calling a standard solver routines. That part can be written as call SOR(), or call ADI(), or call TRIDIA(). (2). That part requires very little document for experienced CFD researchers to understand. As a matter of fact, there is no need to write the function at all. These can be implemented by the user in their own way. (3). Beyond that point, there are many program logics related issues, pre-processing, post-processing issues, dynamic itertion issues which are always implemented by the authors in their own ways. Even the solution approach to a standard k-epsilon formulation will be individual oriented, and as a function of the problem to be solved. (4). If we develop some kind of standard approach, then the solution would be highly in-efficient. (5). As a matter of fact there are numerous ways and tricks to speed up the convergence of a solution. That's the fun part of CFD. (6). The need to have the source code is to learn the actual thinking process of the author. But for experienced cfd expert, the formulation in equations is good enough for him to re-create the approach. (7). I do think that there is a need for the new comers of CFD to read the CFD codes, so that they can get some overall idea of how a code is being put together. (but this part requires the mutual trust, something like a teacher-student relationship, or some kind of contract.) (8).Free-cfd code will continue to be an important issue. But like anything else, if there is a systematic approach to protect the authors and the users, then it can be done at any time. I think the time will come, to have the access to the author's source codes. But it will be here only when such action can support the health of the CFD industry as a whole. So, there are opportunities in this area, to find out how to reach the CFD users more effectively. (not just as a black box user)

Dr Strangelove May 25, 2001 09:40

Re: free-cfd

Just a few thoughts on the topic of open source codes in CFD.

I think that releasing codes under the GPL with the source visible is an excellent and magnanimous thing to do. The source code provides learning material for new practitioners in the field so that they can get some idea of the practical implementation of CFD. Also, it sets a baseline in capability that can be gotten without having to overcome barriers that the analyst may not be prepared to deal with. Either, they must
  1. write their own code.
  2. buy a commercial code.
For those with plenty of expertise and plenty of time, option (1) is acceptable, while for those with some expertise and plenty of money, option (2) is a good route.
But for the many who do not fall under those qualifications, access to open source CFD code is an invaluable opportunity.

Also, freely available source code sets a baseline level of capability that helps improve not just itself, but the various commercial offerings, which have to demonstrate true value added above and beyond what is freely available.

Authors of well-written CFD source code will be honored by more people downloading it, using it, and publishing problems solved by running the code, or by publishing algorithms that make some variation on the original source (the GPL insures those modifications are also public).

None of us has a monopoly on good ideas or innovation: you may be pleasantly surprised when someone modifies your code in a way that represents a genuine improvement, be it in the range of problems that can be solved, its use of computational resources, or other changes in algorithms.

Plus, when people use your code to solve their problems, your reputation is enhanced in more ways than you can know.

Yes, there are risks with releasing your code publicly this way.

Inevitably, there will be an incompetent user who will say they ran your code and it didn't work, gave the wrong answer, took forever, dumped core, etc.

In some cases, they may actually have discovered a real problem, in which case you should be glad for the improvement to the code: certainly all other users will be glad for any and all genuine bug fixes.

In other cases the user may be incompetent. But they cannot malign the code with any credibility unless they provide input decks, description of the problem, etc. Under such scrutiny, errors come to light quickly. And, the user is more likely to be grateful to someone for helping him overcome the error in his formulation. Some users may still like to grumble, but that has more to do with personality than reality.

I contend the risks are worth the benefit to the community in the same way that releasing scientific information generally in journal articles is worthwhile.

If I publish a new algorithm in a journal, it is there for anyone to criticize or to improve upon. As far as CFD is concerned, the power of expression in computer programming languages is comparable to prose in human languages. Should not the former expressions enjoy the same marketplace of ideas and peer review that has worked well for science in general?

John C. Chien May 26, 2001 14:13

Re: free-cfd
(1). The CFD Journal paper publication normally takes a different form and processes. (2). First of all, "to publish" is in the interest of the author's institution, the author himself, and the sponsor of the project. (3). Normally, the author in a research institution is encouraged to publish. And it is used to measure the performance of the researcher (or engineer). It is also used to measure the performance of the institution (a school or a laboratory). The governmnet also use it to measure its strength. (4). And there is a long list of review processes involved in publishing a technical paper. (5).It is going to be quite involved if CFD codes publication is to follow the same review process. (6). The best we can do right now is: the method description about how the cfd problem is (or can be) solved. The exact implementation of that method in programming language is not important. This will eliminate the intrepretation of "CFD" as "CFD codes" issue. And Thus eliminate the need to distribute the codes. (because the review of the code is not going to be easy. if a code is not reviewed and got distributed freely, then it is worse than the current situation. At least, in the current situation, the high license fee will confine the bugs and virus to a limited region.) (7). For "CFD" to become a "CFD code-like" will not happen soon. This is becuase "CFD code" is not a common language. It requires heavy documentation to describe the actual program logic in the code. (8). Perhaps, it is time to look at the original intent of doing CFD, that is "to do numerical analysis and mathematical modeling in fluid mechanics". The goal is the solution of the fluid mechanics problem itself. And the physics of the problem and the physics of the solution. One really should not be concerned about the computer used (whether it is 1.3GHZ or 1.7GHZ), or the code used (it's nothing but the description of the process used under that particular environment. There is no need to repeat the same process using the same code.) (9). It would look funny to ask: Can we make the wind tunnel free? The data reduction program free? Can we have the person who did the data reduction for free? Because these are elements in the process to obtain the test data, and these elements are not the goal of study. One should be able to use another wind tunnel, data reduction program and engineers to obtain the same solution. (10). So, it is clear that, by making the comparison between "CFD code" and "wind tunnel data reduction code", the central issue of free-cfd code can be easily resolved. In other words, "free data reduction code" and "free cfd code" will not give you the needed solution of the fluid mechanics problem. (11). And by the way, if you can't get the engineer who did the wind tunnel data reduction for free to work on your problem, then it is likely that you are not going to get the right answer using his data reduction code in your own wind tunnel testing.

Dr Strangelove May 29, 2001 13:26

Re: free-cfd
>(2). First of all, "to publish" is in the interest of the author's institution, the author himself, and the sponsor of the project. (3). Normally, the author in a research institution is encouraged to publish. And it is used to measure the performance of the researcher (or engineer). It is also used to measure the performance of the institution (a school or a laboratory). The governmnet also use it to measure its strength.
I posit that the primary reason for publishing is to advance the state of the science of CFD.

While the other objectives that you mention are certainly present, I think that, sadly, they have come to detract from that primary objective. Many of us are familiar with symptoms of overvaluing the secondary objectives: promoting "salami" publishing, political peer-review, etc. and a slavish adherence to achieving metrics over the selfless promotion of science.
>(6). The best we can do right now is: the method description about how the cfd problem is (or can be) solved. The exact implementation of that method in programming language is not important.
The method description is an essential starting point. But I would say the implementation is important. Writing a general purpose CFD code from scratch is not a trivial undertaking and the ability to build upon someone else's work rather than re-implement all of the same infrastructure each time saves a great deal of time.
At least, in the current situation, the high license fee will confine the bugs and virus to a limited region.)
Yes, the bugs and viri will be confined to some small subset of people that can afford the code. (Maybe they deserve such bugs!) And, those users will be less able to get to the root of any bugs with only a node-locked binary to diagnose the problem.

But I think such an approach is a cure that is worse than the disease! Following the same argument, I should publish my results exclusively in limited-distribution internal memoranda that would, similarly, confine the effects of my errors to a more select audience compared to a wider public dissemination! But you can see that the wider audience misses out on the benefits more than they miss out on the bugs!

At least with open source code, someone can post to a newsgroup or mailing list with a comment like: <blockquote> Hey! I think this loop ends at the wrong index for some cases. <tt>do 100 i=1,nn+2,2 . . </tt> </blockquote> > It would look funny to ask: Can we make the wind tunnel free? The data reduction program free? Can we have the person who did the data reduction for free?
Those are good questions. They should be asked without any fear. They have good answers, too.

Operation of the wind tunnel costs money, in addition to its initial construction cost. So, it is impossible to bring the operation costs of the wind tunnel below a certain threshhold depending on the cost of maintenance, personnel, electricity, etc.

Once it has been written, the source code for the data reduction program can be distributed over the web for almost zero cost. It can provide some valuable benefit to others needing to do similar data reduction. So distribute it!

You can always ask for someone's time for free, but you cannot be guaranteed to get it. It costs less to download the source code for data reduction than to get large amounts of time from an expert to run it for you. Likewise, I would not expect such a person to work indefinitely for zero cost on my problem.

But, I would be grateful to such a person for taking 5 or 10 minutes of his valuable time to answer a question about the source code operation. And, if I were publishing my results, I would gladly acknowledge the author whose source code I downloaded and used, especially if that author provided helpful suggestions to me. I have done so in the past and will do so in the future.

John C. Chien May 29, 2001 19:35

Re: free-cfd
(1). In early days, the source codes were usually published in the report or in the dissertation (my 3-D Navier-Stokes code was included in the dissertation, like others who had done so in those days) (2). As the time went on, I think, more researchers were using (or modifying) someone's codes, thus it made the publishing of codes more difficult. (3). My thinking right now is: publish the result which is repeatable, and is as accurate as possible. And make the executable code affordable, so that the same result can be repeated and used. There is no sense for everybody to work on the same problem all the time.(and getting different results) (4). At least, in this way, CFD will have some impact, step-by-step. (5). Currently, it looks like that people are inventing CFD instead of looking for CFD solutions.

Ray-zoo June 3, 2001 22:00

Re: free-cfd
Dear Doctor,

Thanks for link. may also enhance anyone's thoughts.

Best regards,


Ray-zoo June 4, 2001 01:44

Re: free-cfd
Dear Pei-ying,

Some authors managed to publish books, but there is no guarantee over it to be a best-seller. First benefit shall be any leading expertise (code copyrighted by you) over widespreaded software product. Check (Open For Business) for documentation software practice (thread available from freshmeat "What's wrong with... done").

Best regards,


All times are GMT -4. The time now is 22:17.