|
[Sponsors] |
October 22, 2015, 11:00 |
from UDF(fluent) to OpenFOAM code
|
#1 |
New Member
francesco
Join Date: Jun 2015
Posts: 3
Rep Power: 11 |
Hi everybody,
i've to use the following UDF in an OpenFOAM case. I know that OF doesn't use UDF but I don't know how implement the code in OF. The UDF is used to evaluate the source term of a heat exchange. Code:
#include "udf.h" #include "mem.h" #define TimeCoeff 50.0 #define WGTemp 600.0 DEFINE_SOURCE(sink,c,t,dS,eqn) { real con, source, rho, spheat, temp; int tstep; tstep = RP_Get_Integer("time-step"); rho = C_R(c,t); spheat = C_CP(c,t); temp = C_T(c,t); if (tstep > 1000) { source = TimeCoeff*rho*spheat*(WGTemp-temp); dS[eqn] = 0.; } else { source = dS[eqn] = 0.; } return source; } Regards Francesco |
|
October 23, 2015, 20:26 |
|
#2 |
Senior Member
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 242
Rep Power: 18 |
Hello Francesc,
In OpenFOAM terms, you can check fvOptions. It allows you to add a source term to the solver governing equations as a part of case setup. Search here in the forum for fvOptions. Check this [LINK] as an example but I believe it is not the only one. Best wishes, Hassan |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Memory protection in OpenFOAM / combinig with FORTRAN | botp | OpenFOAM Programming & Development | 2 | February 15, 2016 13:25 |
OpenFOAM Foundation releases OpenFOAM 2.2.2 | opencfd | OpenFOAM Announcements from ESI-OpenCFD | 0 | October 14, 2013 08:18 |
How to code integral of (DU/Dt - 2000 ) in openFoam | erncyc | OpenFOAM | 5 | September 13, 2012 07:33 |
OpenFOAM for subsurface flow, or coupling with a subsurface flow code? | chljl | OpenFOAM Running, Solving & CFD | 0 | February 14, 2012 20:38 |
New OpenFOAM Forum Structure | jola | OpenFOAM | 2 | October 19, 2011 07:55 |