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

Export a C code

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 19, 2009, 16:25
Default Export a C code
  #1
New Member
 
Vitor Braga
Join Date: Oct 2009
Posts: 28
Rep Power: 16
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, 03:10
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,677
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
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 Search this Thread
Search this Thread:

Advanced Search
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 Off
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 10: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 11:11
CFD Code with Fortran murat Main CFD Forum 0 October 11, 2009 18:05
Importing I-DEAS unv file hbetb FLUENT 1 August 10, 2001 14:22


All times are GMT -4. The time now is 22:20.