CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   c++ and cfd (https://www.cfd-online.com/Forums/main/97185-c-cfd.html)

doorna February 10, 2012 17:35

c++ and cfd
 
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

arjun February 10, 2012 22:46

Read Prof. Peric's book, it contain ALL the information that you would need to write a working navier stokes code for incompressible flow.

doorna February 11, 2012 04:50

Quote:

Originally Posted by arjun (Post 343882)
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?

hadian February 12, 2012 14:46



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

link to amazon: http://www.amazon.com/Computational-.../dp/3540594345

arjun February 13, 2012 00:29

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 (Post 344031)

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

link to amazon: http://www.amazon.com/Computational-.../dp/3540594345


rob_85 February 13, 2012 06:05

UDF solver_par
 
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.

2phase August 9, 2017 13:42

--- deleted by author himself ---

ztdep August 26, 2017 07:50

Quote:

Originally Posted by doorna (Post 343867)
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

Simbelmynė August 29, 2017 03:09

Quote:

Originally Posted by arjun (Post 343882)
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. ;)

arjun August 29, 2017 03:12

Quote:

Originally Posted by Simbelmynė (Post 662215)
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++??

Simbelmynė August 29, 2017 08:35

Quote:

Originally Posted by arjun (Post 662216)
These books teach you how to write code in C++??

Not really, although the book by Sukop and Thorne give some brief insight.

arjun August 29, 2017 08:39

Quote:

Originally Posted by Simbelmynė (Post 662276)
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.

Simbelmynė August 29, 2017 09:06

Quote:

Originally Posted by arjun (Post 662277)
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.


All times are GMT -4. The time now is 11:44.