|
[Sponsors] |
February 8, 2016, 01:35 |
Compiling udf:header file content?
|
#1 |
Member
Join Date: Oct 2015
Posts: 34
Rep Power: 11 |
I want to compile the udf for mass transfer source. I am not sure what is meant by source and header files separately.What should be the content of these two files, should I split the code into this.
Also I have another query, if source term not specified through udf then how will fluent compute the transfer process |
|
February 8, 2016, 23:48 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
The UDFs for Fluent are written in ANSI C and include header files at the top of the source files using the compiler directive (#include), for example:
Code:
#include "udf.h" // the header file required for UDFs DEFINE_SOURCE(a_custom_source,c,t,dS,eqn) { return 0.; // this example returns a zero source term } The UDF source term is for additional source terms, more information can be found in the relevant section of the UDF manual. Fluent recommends that you should define a momentum source if you've defined a mass source for a cell zone. |
|
February 9, 2016, 00:54 |
|
#3 |
Member
Join Date: Oct 2015
Posts: 34
Rep Power: 11 |
Thank you for the help. So I should save only the header i.e. #include "udf.h" in a .c file and load it for header files during compilation.
|
|
February 9, 2016, 01:01 |
|
#4 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
No, simply type the following line at the top of your UDF file (as shown in my example above):
Code:
#include "udf.h" |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] funkyDoCalc with OF2.3 massflow | NiFl | OpenFOAM Community Contributions | 14 | November 25, 2020 04:30 |
[Other] Adding solvers from DensityBasedTurbo to foam-extend 3.0 | Seroga | OpenFOAM Community Contributions | 9 | June 12, 2015 18:18 |
[swak4Foam] Swak4FOAM 0.2.3 / OF2.2.x installation error | FerdiFuchs | OpenFOAM Community Contributions | 27 | April 16, 2014 16:14 |
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 | keepfit | ParaView | 60 | September 18, 2013 04:23 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |