|
[Sponsors] |
March 29, 2018, 23:53 |
Undefined variable
|
#1 |
New Member
Zhu
Join Date: Mar 2018
Posts: 5
Rep Power: 8 |
Please help me! When I start my UDF program, there is an error "rpgetvar: part/charge-rate: undefined variable". What's wrong with it?
|
|
March 30, 2018, 00:19 |
|
#2 |
New Member
yanghai
Join Date: Mar 2018
Posts: 16
Rep Power: 8 |
||
March 30, 2018, 00:28 |
Undefined variable
|
#3 | |
New Member
Zhu
Join Date: Mar 2018
Posts: 5
Rep Power: 8 |
Quote:
I should know the charge rate of particles. I used "RP_Get_Real(part/charge-rate)" to get parameter. But when I start my udf program. An error appeared. "rpgetvar: part/charge-rate: undefined variable". So I wonder whether I should define the variable of "part/charge-rate" and how to define it. Following is my partial udf about "RP_Get_Real". #include "udf.h" #include "sg_udms.h" #include "charge_udf.h" Domain *fl_domain=NULL; real epsilon_0=8.854e-12; real d_charge=0.; real charge_max=0.; /* * Get charge parameters (set via Scheme) */ void get_charge_parameters(void) { d_charge=RP_Get_Real("part/charge-rate"); charge_max=RP_Get_Real("part/charge-max"); } |
||
March 30, 2018, 04:08 |
|
#4 | |
New Member
yanghai
Join Date: Mar 2018
Posts: 16
Rep Power: 8 |
Quote:
|
||
March 30, 2018, 04:37 |
|
#5 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
where did you get this code?
inside your "own" code there is a comment Code:
/* * Get charge parameters (set via Scheme) */ best regards |
|
March 30, 2018, 06:47 |
|
#6 |
New Member
Zhu
Join Date: Mar 2018
Posts: 5
Rep Power: 8 |
yes! I have defined macro. The udf I showed is just a partial udf. The error occurs due to this udf.
|
|
March 30, 2018, 06:53 |
|
#7 | |
New Member
Zhu
Join Date: Mar 2018
Posts: 5
Rep Power: 8 |
Quote:
And can you tell me how to define vars through scheme? Thank you very much ! |
||
March 31, 2018, 12:47 |
|
#8 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
And did you compile (do this!) or interpret (don't do this!)?
|
|
April 1, 2018, 22:36 |
|
#9 |
New Member
Zhu
Join Date: Mar 2018
Posts: 5
Rep Power: 8 |
||
Tags |
rp_get_real |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Second Derivative Zero - Boundary Condition | fu-ki-pa | OpenFOAM | 11 | March 27, 2021 05:28 |
LEMOS InflowGenerator | r_gordon | OpenFOAM Running, Solving & CFD | 103 | December 18, 2018 01:58 |
OpenFOAM 1.6-ext git installation on Ubuntu 11.10 x64 | Attesz | OpenFOAM Installation | 45 | January 13, 2012 13:38 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |
G95 + CGNS | Bruno | Main CFD Forum | 1 | January 30, 2007 01:34 |