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

Specific OpenFOAM Code

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 28, 2012, 12:47
Default Specific OpenFOAM Code
  #1
New Member
 
Paul B. Huter
Join Date: Jun 2012
Posts: 8
Rep Power: 5
pbhuter is on a distinguished road
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 is offline   Reply With Quote

Old   June 28, 2012, 13:13
Default Update
  #2
New Member
 
Paul B. Huter
Join Date: Jun 2012
Posts: 8
Rep Power: 5
pbhuter is on a distinguished road
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.
pbhuter is offline   Reply With Quote

Old   June 28, 2012, 13:23
Default
  #3
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,123
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
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
nimasam is offline   Reply With Quote

Old   June 28, 2012, 13:26
Default
  #4
New Member
 
Paul B. Huter
Join Date: Jun 2012
Posts: 8
Rep Power: 5
pbhuter is on a distinguished road
Do you know if I can just calculate the forces/moments (see my above "update")?
pbhuter is offline   Reply With Quote

Old   June 28, 2012, 17:21
Default
  #5
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Yes you can. Have you looked at the motorbike tutorial?
lovecraft22 is offline   Reply With Quote

Old   June 28, 2012, 17:24
Default
  #6
New Member
 
Paul B. Huter
Join Date: Jun 2012
Posts: 8
Rep Power: 5
pbhuter is on a distinguished road
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.
pbhuter is offline   Reply With Quote

Old   June 28, 2012, 17:27
Default
  #7
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 463
Rep Power: 9
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
It is within the tutorial folder. WHat do you mean with extracting the code? What would you use it for?
lovecraft22 is offline   Reply With Quote

Old   June 28, 2012, 17:35
Default
  #8
New Member
 
Paul B. Huter
Join Date: Jun 2012
Posts: 8
Rep Power: 5
pbhuter is on a distinguished road
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.
pbhuter is offline   Reply With Quote

Old   June 29, 2012, 02:57
Default
  #9
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
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?
Bernhard is offline   Reply With Quote

Old   June 29, 2012, 07:23
Default
  #10
New Member
 
Paul B. Huter
Join Date: Jun 2012
Posts: 8
Rep Power: 5
pbhuter is on a distinguished road
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.
pbhuter is offline   Reply With Quote

Old   June 29, 2012, 08:40
Default
  #11
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
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'.
Bernhard is offline   Reply With Quote

Old   June 29, 2012, 08:57
Default
  #12
New Member
 
Paul B. Huter
Join Date: Jun 2012
Posts: 8
Rep Power: 5
pbhuter is on a distinguished road
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.
pbhuter is offline   Reply With Quote

Old   June 30, 2012, 07:27
Default
  #13
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,301
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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
wyldckat is offline   Reply With Quote

Old   June 30, 2012, 19:06
Default
  #14
New Member
 
Paul B. Huter
Join Date: Jun 2012
Posts: 8
Rep Power: 5
pbhuter is on a distinguished road
I appreciate all the help. I have a book on order from Amazon that I hope will help me solve my problems.
pbhuter is offline   Reply With Quote

Reply

Tags
code selection, coefficients

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
OpenFOAM Foundation Releases OpenFOAMŪ Version 2.1.1 opencfd OpenFOAM Announcements from ESI-OpenCFD 0 May 31, 2012 09:07
OpenFOAM for subsurface flow, or coupling with a subsurface flow code? chljl OpenFOAM Running, Solving & CFD 0 February 14, 2012 20:38
get OpenFOAM source code Ahmed Khattab OpenFOAM 2 February 9, 2012 05:48
Design Integration with CFD? John C. Chien Main CFD Forum 19 May 17, 2001 15:56
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 08:10


All times are GMT -4. The time now is 06:21.