CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   writing a cfd code (http://www.cfd-online.com/Forums/main/10065-writing-cfd-code.html)

kelvin October 11, 2005 18:52

writing a cfd code
 
dear all,

i was given a home take exam to write a cfd code based on FDM and FEM for the poisson equation. the due date is just end of this week.

i am told to use any solver (downloading from the net). so can u guys out there help me....what steps i should follow and if i can be done before the due (i don't even know how much it takes.)

i want to use C++. where can i get the solver from? please, any ideas and/or any code (which i can see as example)!

thanks.

zxaar October 11, 2005 19:54

Re: writing a cfd code
 
end of this week will be difficult to meet. (sorry i do not have much experience with FEM FDM, so could not suggest anything).

zxaar October 11, 2005 19:55

Re: writing a cfd code
 
end of this week will be difficult to meet. (sorry i do not have much experience with FEM FDM, so could not suggest anything). i probably will be able to help with the solver part though.

kelvin October 11, 2005 19:59

Re: writing a cfd code
 
thanks, zxaar:

but i have to do it anyway...i dont know how though. i will still appreciate if u can pass me the solver atleast. thank u so much!

Renato October 11, 2005 20:27

Re: writing a cfd code
 
Try this one:

http://www.csit.fsu.edu/~burkardt/cp...2d/nast2d.html

This program is written in C++ and is fully described in the following book (including common CFD benchmark problems):

Michael Griebel, Thomas Dornseifer and Tilman Neunhoeffer, "Numerical Simulation in Fluid Dynamics", SIAM, 1998

Cheers

Renato.

Peter October 11, 2005 21:16

Re: writing a cfd code
 
So your professor told you to write a code to solve the Poisson equation without any previous instruction on the FEM or FDM method? You have no text book? No class notes? There are about 1000 text books out there which you can borrow to get an idea of how to set up a solution. Stop being lazy.

Andrew Mettler Hayes October 11, 2005 21:23

Re: writing a cfd code
 
the first thing you need to do is write the equations down and descretize them. Then, write down the first few steps and see how the matrices are formed. Once you understand that, you wont have much of a problem.

zxaar October 12, 2005 05:09

Re: writing a cfd code
 
read about the descretisation, i will try to send you c++ files that you can add in your code and with minimal instructions you will be able to use it as solver. Since today i am very busy , think you will get them tommorrow.

Jonas Holdeman October 12, 2005 09:31

Re: writing a cfd code
 
If you get another assignment with a little more time, consider using Matlab. It takes a bit of time to learn the language, but you can write very compact code, and the solvers and graphics are part of the Matlab package.

Matlab is good for experimenting and exploring new ideas where you can keep the problem small. When you get a prototype program worked out, then implement it in C++ for more efficient operation on larger scale problems. But don't underestimate the work involved in integrating solvers and graphics.

kevin October 12, 2005 10:31

Re: writing a cfd code
 
thanks, jonas!

exactly, i will try to do the others in matlab. i have been working on matlab last year....and i hope i did not forget it completely.

kevin October 12, 2005 10:34

Re: writing a cfd code
 
ok, thanks zxaar!

tomorrow also will be fine. i will try to build the whole picture till then. i really appreciate your cooperation.

please use a.temperature@gmail.com

thanks once again.

kevin October 12, 2005 10:37

Re: writing a cfd code
 
thanks andrew,

now my problem is in the formation of the matrices. i have discretised the equation but i couldn't do it to matrices.

with regards

Andrew Hayes October 12, 2005 15:38

Re: writing a cfd code
 
you have to march through a few steps in order to see how the matrices are formed.

zxaar October 13, 2005 05:41

Re: writing a cfd code
 
i sent the mail.


All times are GMT -4. The time now is 15:20.