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

c++ and cfd

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

Like Tree1Likes
  • 1 Post By doorna

Reply
 
LinkBack Thread Tools Display Modes
Old   February 10, 2012, 17:35
Default c++ and cfd
  #1
New Member
 
crane
Join Date: Jul 2011
Posts: 7
Rep Power: 8
doorna is on a distinguished road
Dear all;
I am a super beginner in programming but i am super enthusiastic to know how to write codes.I know fundamental concepts of CFD.I wonder if any one knows of some books or sites which includes writing codes with c++ using CFD concepts.The only experience I had was writing code for lid driven cavity and it hasn't converged yet.It is like a dream for me to write codes for different problems!!!!!!!!!I am ready to do whatever it costs!
your answers are immensely appreciated in advance
best,
Doorna
wangmianzhi likes this.

Last edited by doorna; February 11, 2012 at 04:55.
doorna is offline   Reply With Quote

Old   February 10, 2012, 22:46
Default
  #2
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 713
Rep Power: 19
arjun will become famous soon enough
Read Prof. Peric's book, it contain ALL the information that you would need to write a working navier stokes code for incompressible flow.
arjun is offline   Reply With Quote

Old   February 11, 2012, 04:50
Default
  #3
New Member
 
crane
Join Date: Jul 2011
Posts: 7
Rep Power: 8
doorna is on a distinguished road
Quote:
Originally Posted by arjun View Post
Read Prof. Peric's book, it contain ALL the information that you would need to write a working navier stokes code for incompressible flow.
Dear arjun
Thanks a lot for your advice.Can you plz tell me full name of the book you mentioned?
doorna is offline   Reply With Quote

Old   February 12, 2012, 14:46
Default
  #4
Member
 
Mohammad Reza Hadian
Join Date: Mar 2009
Location: Yazd, Iran
Posts: 52
Rep Power: 10
hadian is on a distinguished road


Computational Methods for Fluid Dynamics by: Joel H. Ferziger and Milovan Peric, .

link to amazon: http://www.amazon.com/Computational-.../dp/3540594345
hadian is offline   Reply With Quote

Old   February 13, 2012, 00:29
Default
  #5
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 713
Rep Power: 19
arjun will become famous soon enough
thank you for putting the link. I sent him a pm I guess it would be better to post here.

Thanks

Quote:
Originally Posted by hadian View Post

Computational Methods for Fluid Dynamics by: Joel H. Ferziger and Milovan Peric, .

link to amazon: http://www.amazon.com/Computational-.../dp/3540594345
arjun is offline   Reply With Quote

Old   February 13, 2012, 06:05
Default UDF solver_par
  #6
New Member
 
Join Date: Feb 2012
Posts: 1
Rep Power: 0
rob_85 is on a distinguished road
Hi everyone,

I'm modifying a UDF for my final career project and I'm having trouble with some stuff, I hope you guys can help me!!

In the DPM_HEAT_MASS udf I'm having trouble understanding the definition of the bulk concentration and its units and I don't quite get the meaning of one of its terms... Please help!!

real cvap_bulk = c->pressure / UNIVERSAL_GAS_CONSTANT / c->temp * c->yi[gas_index] / molwt_bulk / solver_par.molWeight[gas_index];

It seems this definition comes from the ideal gas law, but if you look carefully it looks as if the definition becomes: cvap_bulk = P·T·Yi·M/R·Mbulk

As for the solver_par.molWeight[gas_index] I don't quite understand its meaning..

Thanks in advance!!

Rob.
rob_85 is offline   Reply With Quote

Old   August 9, 2017, 13:42
Default
  #7
New Member
 
Martin
Join Date: Apr 2017
Location: Germany
Posts: 15
Rep Power: 2
2phase is on a distinguished road
--- deleted by author himself ---

Last edited by 2phase; August 9, 2017 at 13:45. Reason: not related to inital question... sorry
2phase is offline   Reply With Quote

Old   August 26, 2017, 07:50
Default
  #8
Senior Member
 
ztdep's Avatar
 
p ding
Join Date: Mar 2009
Posts: 324
Rep Power: 11
ztdep is on a distinguished road
Send a message via Yahoo to ztdep Send a message via Skype™ to ztdep
Quote:
Originally Posted by doorna View Post
Dear all;
I am a super beginner in programming but i am super enthusiastic to know how to write codes.I know fundamental concepts of CFD.I wonder if any one knows of some books or sites which includes writing codes with c++ using CFD concepts.The only experience I had was writing code for lid driven cavity and it hasn't converged yet.It is like a dream for me to write codes for different problems!!!!!!!!!I am ready to do whatever it costs!
your answers are immensely appreciated in advance
best,
Doorna
I strongly suggest you to read:

Solving PDEs in C++
Numerical Methods in a
Unified Object-Oriented Approach
Yair Shapira
Technion–Israel Institute of Technology
Haifa, Israel
ztdep is offline   Reply With Quote

Old   August 29, 2017, 03:09
Default
  #9
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 171
Rep Power: 7
Simbelmynė is on a distinguished road
Quote:
Originally Posted by arjun View Post
Read Prof. Peric's book, it contain ALL the information that you would need to write a working navier stokes code for incompressible flow.
Isn't the code related to this book written in fortran? Also, while it is certainly a very good book, it may not be the best one for a beginner.

If we ignore the C++ requirement then:

I think the book by John. D. Andersson may be better for a beginner (although mostly FDM rather than FVM).

The book by Versteeg and Malalasekhera is also somewhat better for a beginner (with worked examples, which Peric's book lacks).

If you wish to delve into Lattice Boltzmann Methods then the book by Sukop and Thorne has explained code snippets based on C/C++ (also a working code online)

Just my oppinion of course.
Simbelmynė is offline   Reply With Quote

Old   August 29, 2017, 03:12
Default
  #10
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 713
Rep Power: 19
arjun will become famous soon enough
Quote:
Originally Posted by Simbelmynė View Post
Isn't the code related to this book written in fortran? Also, while it is certainly a very good book, it may not be the best one for a beginner.

If we ignore the C++ requirement then:

I think the book by John. D. Andersson may be better for a beginner (although mostly FDM rather than FVM).

The book by Versteeg and Malalasekhera is also somewhat better for a beginner (with worked examples, which Peric's book lacks).

If you wish to delve into Lattice Boltzmann Methods then the book by Sukop and Thorne has explained code snippets based on C/C++ (also a working code online)

Just my oppinion of course.

These books teach you how to write code in C++??
arjun is offline   Reply With Quote

Old   August 29, 2017, 08:35
Default
  #11
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 171
Rep Power: 7
Simbelmynė is on a distinguished road
Quote:
Originally Posted by arjun View Post
These books teach you how to write code in C++??
Not really, although the book by Sukop and Thorne give some brief insight.
Simbelmynė is offline   Reply With Quote

Old   August 29, 2017, 08:39
Default
  #12
Senior Member
 
Arjun
Join Date: Mar 2009
Location: Nurenberg, Germany
Posts: 713
Rep Power: 19
arjun will become famous soon enough
Quote:
Originally Posted by Simbelmynė View Post
Not really, although the book by Sukop and Thorne give some brief insight.

Yes, as far as I know there is no CFD book who teaches how to program in C++ along with CFD.

The peric's book has all the ingredients that are needed to write fully working unstructured grid navier stokes solver. Other books are good too but I do not believe that they tackle the issue of unstructured grid in so much of detail as Mr. Peric's book.
arjun is offline   Reply With Quote

Old   August 29, 2017, 09:06
Default
  #13
Senior Member
 
Simbelmynė's Avatar
 
Join Date: May 2012
Posts: 171
Rep Power: 7
Simbelmynė is on a distinguished road
Quote:
Originally Posted by arjun View Post
Yes, as far as I know there is no CFD book who teaches how to program in C++ along with CFD.

The peric's book has all the ingredients that are needed to write fully working unstructured grid navier stokes solver. Other books are good too but I do not believe that they tackle the issue of unstructured grid in so much of detail as Mr. Peric's book.
If writing in C/C++ is the biggest concern, then "Numerical Recipes in C" is a fine starting point I guess.

I don't disagree that the book by Peric is a good one. However, my personal experience is that it is usually better for the more advanced student. That is, you will have more benefit of the material if you have already written some solvers.
Simbelmynė 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
STAR-Works : Mainstream CAD with CFD CD adapco Group Marketing Siemens 0 February 13, 2002 13:23
Where do we go from here? CFD in 2001 John C. Chien Main CFD Forum 36 January 24, 2001 22:10
ASME CFD Symposium, Atlanta, July 2001 Chris R. Kleijn Main CFD Forum 0 August 21, 2000 04:49
Which is better to develop in-house CFD code or to buy a available CFD package. Tareq Al-shaalan Main CFD Forum 10 June 12, 1999 23:27
public CFD Code development Heinz Wilkening Main CFD Forum 38 March 5, 1999 12:44


All times are GMT -4. The time now is 07:14.