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

Progressing to write my own simple code

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 14, 2009, 16:58
Default Progressing to write my own simple code
  #1
Member
 
Jonny
Join Date: Aug 2009
Posts: 62
Rep Power: 9
Jonny6001 is on a distinguished road
Hello, I posted on here recently about wanting to write my own cfd code, a very simple one initially then see how it goes from there.

I didnt really know anything about Navier-Stokes equations nor much about continuity and other such equations.I have been looking at the equations and how they are governed. Slowly it is coming together, I have also been looking at how the equations relate to a grid through discretization of the problem and what is solved.

I am trying to take in a huge ammount of information relating to completely different topics in a short time so i find it quite easy to get mixed up. At the moment i'm just picking up little bits everynow and then and slowly they are coming together to what will hopefully be something useful.

I am going to start thinking about writing a very simple code in MATLAB to solve the simplest of problems, but I will also need to learn MATLAB.

What type of problem do you think I should start with?

Also, how is the easiest way of splitting the domain up in to a grid without the use of ANSA, Gambit or equivalent?

Im sorry if it seems very basic but I dont have anyone to teach me about anything so I have to try and pick it up myself.

This is not my field of expertize at present but I really hope to work in CFD when I am older. Perhaps do a PhD on the subject.

Thanks a lot for any help, very much appreciated.
Jonny6001 is offline   Reply With Quote

Old   October 14, 2009, 18:16
Default
  #2
Member
 
Newton KF
Join Date: Mar 2009
Posts: 36
Rep Power: 9
NewtonKF is on a distinguished road
Hi Jonny... You see, I built my own code from scratch for my masters, with the help of the Versteg and Malalasekera's book... It is very easy for beginners, presenting all the discretization factors for the finite volume method... Other good book is from Fertziger... In these and many other books, they present how to discretize your geometry in single cells, allowing you to build a code without the need for a mesh generator... Also, you will need some program to visualize the scalar and vector fields. I suggest to you to start directly with a programing language such as C++ or fortran... it will save you some time later when using really big meshes with really complex models... A good initial problem is the Lid Driven Cavity... There are lots of papers about this problem, and when analyzing laminar flows, there are some analytical results....

Good luck...
NewtonKF is offline   Reply With Quote

Old   October 14, 2009, 18:38
Default
  #3
Member
 
Jonny
Join Date: Aug 2009
Posts: 62
Rep Power: 9
Jonny6001 is on a distinguished road
Thanks a lot for your reply and advice.

Are you refering to this book?

http://www.amazon.co.uk/Introduction...5559533&sr=1-1

I have the book but loaned it to a friend a while ago, will have to get it back asap then.

How do I go about starting to write Fortran code? I have had a look previously but I'm not too sure how it would work. Would I write my code using a text editor such as Notepad then compile it? Or it there another way to do it?

I am currently running Windows XP, Linux seems to be the OS of choice for Fortran. I might switch over to Linux at a later stage but I dont think its necessary for the simple cases I hope to solve initially. What do people think?

I have another more powerful machine that I use for complex design work but switching this to Linux would mean software such as UGS and CATIA wouldn't run.

Regards
Jonny6001 is offline   Reply With Quote

Old   October 14, 2009, 18:49
Default
  #4
Member
 
Newton KF
Join Date: Mar 2009
Posts: 36
Rep Power: 9
NewtonKF is on a distinguished road
Yes, this is the book I've used... About the language, I use C++ not fortran... you see, for C++, in Windows XP, there are lots of environments like Visual Studio, Dev-C++, etc... I think there is a free version of Visual Studio from Microsoft... And yes, you can use initially your Machine with Windows, but for large projects, I suggest the linux OS... it works better when you need lots of memory...

Good luck...
NewtonKF is offline   Reply With Quote

Old   October 16, 2009, 17:25
Default
  #5
Member
 
Jonny
Join Date: Aug 2009
Posts: 62
Rep Power: 9
Jonny6001 is on a distinguished road
Thanks for taking the time to reply.

I have downloaded Visual Studio 2010, will start getting my head around it asap.
Which language would people here suggest I start writing code in, would you recommend C# or C++?

Thanks a lot.
Jonny6001 is offline   Reply With Quote

Old   October 19, 2009, 15:09
Default
  #6
Member
 
Join Date: Mar 2009
Posts: 62
Rep Power: 9
RenardP is on a distinguished road
Hello,

if you want to be able to later port your code on different operating systems (like Linux and Mac) I will suggest C++. Try to avoid the C++.CLI which is a Microsoft extension, stick with the ANSI C++ description if you want a portable code.
RenardP is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a simple way to make refineMesh write the cellLevel chtrapp OpenFOAM Pre-Processing 0 February 16, 2009 11:25
An example code for SIMPLE George Pek Main CFD Forum 6 July 6, 2003 16:54
I want a simple method code mehdi Main CFD Forum 5 April 28, 2003 09:09
Open source CFD code development, possible? Dr. Yazid Bindar Main CFD Forum 27 July 18, 2000 00:18
State of the art in CFD technology Juan Carlos GARCIA SALAS Main CFD Forum 39 November 1, 1999 15:34


All times are GMT -4. The time now is 19:50.