CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Specific OpenFOAM Code (http://www.cfd-online.com/Forums/openfoam/103900-specific-openfoam-code.html)

pbhuter June 28, 2012 12:47

Specific OpenFOAM Code
 
I would like to extract some code from OpenFOAM, but I'm not quite sure which code I need. I have looked through OpenFOAM documentation, but it's not that helpful. I am trying to JUST calculate aerodynamic coefficients. I've seen one post in this forum, but it does not actually reach a conclusion, and it does not talk about pulling out specific code. I want lift and drag coefficients, as well as moment coefficients (if available). I'm sure I'll need more than just the code for calculating coefficients, so any help about just basic classes/functions that I need will be appreciated.

Thanks.

pbhuter June 28, 2012 13:13

Update
 
Ultimately, I want to be able to calculate the forces and moments (in all three axes), and as I'm looking through the OpenFOAM code, I'm seeing that it is calculating forces, then calculating coefficients. If someone who has looked deeper into the code takes a look at this, and is willing to help me out - what functions/classes do I need to pull out of OpenFOAM to be able to calculate the forces and moments (in all three axes)?

Thanks a bunch.

nimasam June 28, 2012 13:23

im afraid you can not find what you want, because OpenFOAM, is an integrated code, so usually calculation of a coefficient, may get possible by upper and different classes, so you need to have the whole package by it self

pbhuter June 28, 2012 13:26

Do you know if I can just calculate the forces/moments (see my above "update")?

lovecraft22 June 28, 2012 17:21

Yes you can. Have you looked at the motorbike tutorial?

pbhuter June 28, 2012 17:24

Do you have a link to the motorbike tutorial? Also, is it just using OpneFOAM, or will I be able to extract out code to use elsewhere?

Thanks.

lovecraft22 June 28, 2012 17:27

It is within the tutorial folder. WHat do you mean with extracting the code? What would you use it for?

pbhuter June 28, 2012 17:35

If I wanted to include OpenFOAM code (under GPL) in a program I am writing, but all I want to do is calculate the aerodynamic forces and moments on a body.

Bernhard June 29, 2012 02:57

It is a bit vague what you want. Are you writing your own CFD-code and do you just want to see how it is implemented in OpenFOAM, or do you want your program to interactively communicate with OpenFOAM?

pbhuter June 29, 2012 07:23

I am not writing a full-up CFD program (that is beyond the scope of my project), however I do want to have a standalone program that includes some of the functionality of OpenFOAM, so I do not want to communicate to OpenFOAM. Right now, I know that I need to calculate the aerodynamic forces and moments on a body, although later I may need something else.

Bernhard June 29, 2012 08:40

So what kind of data do you have? Is it OpenFOAM-data? What do you mean by stand-alone? You know that OpenFOAM provides a lot of seperate utilities and solvers? It is not just one 'program'.

pbhuter June 29, 2012 08:57

I did not know that there were separate utilities and solvers. I found a piece of code that calculates forces/moments (calcForcesMoments is the name of the function), but obviously there is a lot that goes into it, and a lot that it interacts with, which I don't quite understand. I realize that OpenFOAM is complicated and that some pieces rely on multiple other pieces to work, I was just hoping someone knew of a way to pull out the code necessary to calculate the aerodynamic forces and moments (i.e. what code within OpenFOAM I would use, including everything linked/required, to calculate). If not, that's fine.

wyldckat June 30, 2012 07:27

Greetings to all!

@pbhuter: whether you like it or not, OpenFOAM is a massive toolbox, not a recipe book ;)

Have you checked the cfd-online wiki? http://www.cfd-online.com/Wiki/Main_Page - there you might find the calculations you're looking for.

Otherwise, it's rather complicated to strip code from OpenFOAM, given its intricate system of templates and classes and in some cases, interlocking with the class fields and mesh themselves.
If your application already has its own CFD capabilities, then you probably will have to find the base equations from books or wikis and code things yourself.

Those equations might be present in OpenFOAM, but they will either be oversimplified like this:
Quote:

Originally Posted by http://en.wikipedia.org/wiki/OpenFOAM#Syntax
Code:

solve (
      fvm::ddt(rho,U)
    + fvm::div(phi,U)
    - fvm::laplacian(mu,U)
      ==
    - fvc::grad(p)
 );


Or spread out through the almost labyrinthical source code that is OpenFOAM.


So perhaps you should rethink what your question really is! ;)

Good luck!
Bruno

pbhuter June 30, 2012 19:06

I appreciate all the help. I have a book on order from Amazon that I hope will help me solve my problems.


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