|
[Sponsors] |
July 12, 2015, 10:48 |
UDF Surface Reaction Basics
|
#1 |
Member
Matthew Rich
Join Date: Jul 2013
Posts: 33
Rep Power: 13 |
Hi all
I am attempting to create a UDF file to have product species produced at the surface of a tube wall. I have been reviewing the manual and I sort of have an but I need someone to help me connect the dots. My understanding is it requires two steps. 1) Identify the involved cells Code:
#define zone_id 7 /* REPLACE THIS WITH APPROPRIATE BOUNDARY ID */ DEFINE_ON_DEMAND(my_reaction_cells) { Domain *d = Get_Domain(1); /* POINTER FOR THE DOMAIN */ Thread *t, *t0; cell_t c0; face_t f; t = Lookup_Thread(d, zone_id); /* POINTER FOR THE SPECIFIED BOUNDARY */ t0 = THREAD_T0(t); /* POINTER FOR THE FLUID ADJACENT TO SPECIFIED BOUNDARY */ begin_f_loop(f,t) /* LOOP OVER FACES OF THE SPECIFIED BOUNDARY */ { c0 = F_C0(f,t); C_UDMI(c0,t0, 0) = 1; } end_f_loop(f,t); } 2) Implement the Source term on the species balance equations Code:
DEFINE_SOURCE(my_species_source,c,t,dS,eqn) { real k, source; k = 0.5; /* 1/s */ source = C_R(c,t)* k * C_YI(c,t,0); /* source is a function of k times mass fraction of first species times density */ dS[eqn] = 0.0; return source; /*Unit should be kg/(m3-s)*/ } iter scalar-0 1 1.000000e+00 2 2.503153e-04 3 3.350463e-05 4 1.917379e-05 5 3.410960e-06 6 9.846552e-07 7 2.790700e-07 8 9.536242e-08 9 3.064283e-08 10 1.126697e-08 hybrid initialization is done. ================================================== ============================ Node 0: Process 5300: Received signal SIGSEGV. ================================================== ============================ ================================================== ============================ Node 2: Process 8916: Received signal SIGSEGV. ================================================== ============================ ================================================== ============================ Node 3: Process 8584: Received signal SIGSEGV. ================================================== ============================ ================================================== ============================ Node 1: Process 3420: Received signal SIGSEGV. ================================================== ============================ MPI Application rank 0 exited before MPI_Finalize() with status 2 The fl process could not be started. ===============Message from the Cortex Process================================ Fatal error in one of the compute processes. ================================================== ============================ Error: Cortex received a fatal signal (unrecognized signal). Error Object: () Error: There is no active application. Error Object: (rp-var-value 'vof/oc/n-waves) Not sure what I need to do to resolve that. I have no errors implementing the DEFINE_SOURCE by itself but I get zero production of the species in question. Any assistance or recommendation of resources would be much appreciated in getting this working. Also I am not sure how the species function knows how to hook into the Cells identified to participate in the surface reaction. Thanks in advance. |
|
July 14, 2015, 20:24 |
|
#2 |
Member
Matthew Rich
Join Date: Jul 2013
Posts: 33
Rep Power: 13 |
Anyone have comments on this. I know there is a similar thread but the solution applied is not clear.
Any help is much much appreciated. |
|
January 15, 2019, 12:09 |
|
#3 |
Member
Emerson
Join Date: May 2018
Posts: 35
Rep Power: 8 |
I have the same error, but in my case, the macro DEFINE_SOURCE is doing the trouble. =/
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Defining reaction rate with multiple surface reaction | Fred Marias | FLUENT | 1 | September 12, 2013 05:56 |
Unit of rate in udf of a surface reaction | borhan_sd@yahoo.com | Fluent UDF and Scheme Programming | 0 | June 11, 2013 04:28 |
question about udf for "particle surface reaction rate" | lili | Fluent UDF and Scheme Programming | 0 | January 9, 2013 04:37 |
udf for partical surface reaction | blaid | FLUENT | 0 | April 25, 2011 08:24 |
UDF changing the rate exponent of a reaction | Stefan H | Fluent UDF and Scheme Programming | 0 | September 16, 2009 14:20 |