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

Export a C code

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 19, 2009, 15:25
Default Export a C code
  #1
New Member
 
Vitor Braga
Join Date: Oct 2009
Posts: 28
Rep Power: 7
vitor is on a distinguished road
Is it possible to export a C written code to OpenFOAM?
For example, if Im looking forward to expressing a variable boundary condition (let's assume a senoid), can I write it in C and use it as an input to OpenFOAM?
Like in Fluent there are the UDF's (user defined functions).

Thank you, very much.

Regards.


Vitor Braga
vitor is offline   Reply With Quote

Old   October 20, 2009, 02:10
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: http://olesenm.github.io/
Posts: 777
Rep Power: 18
olesen will become famous soon enough
Quote:
Originally Posted by vitor View Post
Is it possible to export a C written code to OpenFOAM?
For example, if Im looking forward to expressing a variable boundary condition (let's assume a senoid), can I write it in C and use it as an input to OpenFOAM?
There's two ways to do it:
It'll depend on what type of bc you have (fixed, gradient, mixed), but you could take one of the timeVaryingXXX boundary conditions from OpenFOAM as a starting point and define your things as 'extern C' binding (presuming they are in an external library.

The other possibility is just to compile your existing C code as C++ as part of your new OpenFOAM bc.
olesen 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
how to export every data w.r.t time to txt file jaho CFX 94 August 25, 2015 09:45
export data at nodes Meenu FLUENT 1 December 30, 2011 02:24
Small 3-D code Zdravko Stojanovic Main CFD Forum 2 July 19, 2010 10:11
CFD Code with Fortran murat Main CFD Forum 0 October 11, 2009 17:05
Importing I-DEAS unv file hbetb FLUENT 1 August 10, 2001 13:22


All times are GMT -4. The time now is 12:26.