|
[Sponsors] |
October 29, 2019, 09:02 |
host_to_node global variable
|
#1 |
New Member
Paweł
Join Date: Nov 2015
Posts: 9
Rep Power: 11 |
Dear all,
This is the part of UDF manual for Fluent: Note that these host_to_node communication macros do not need to be "protected'' by compiler directives for parallel UDFs, because all of these macros automatically do the following:
I wonder if there is a possibility to set global variables for each compute node with this (or another) macro. I am using this macro for DPM calculations. In my UDF the host recognizes different injection types and I would like it to pass the number of each injection type to every node. This is done on UDF loading, yet the values are required in subsequent macro (I don't want to check number and types of injections on every single time step calculation). Here is the part of the code: Code:
int number_of_injections; int number_of_injections_DROP; int number_of_injections_DUST; DEFINE_EXECUTE_ON_LOADING(Check_Injections,libudf) { #if RP_HOST int i; Injection *I; /* Pointer to the injection structure */ Injection *Ilist; /* Pointer to the injection name type */ Ilist = Get_dpm_injections(); number_of_injections = 0; number_of_injections_DROP = 0; number_of_injections_DUST = 0; loop(I, Ilist) { number_of_injections++; if(strncmp(dust_injection_key, I->name, strlen(dust_injection_key)) == 0) { number_of_injections_DUST++; } if(strncmp(drop_injection_key, I->name, strlen(drop_injection_key)) == 0) { number_of_injections_DROP++; } } #endif host_to_node_int_3(number_of_injections,number_of_injections_DUST,number_of_injections_DROP); Message("There are %d injection(s) detected: %d dust injection(s) and %d drop injection(s)\n", number_of_injections, number_of_injections_DUST, number_of_injections_DROP); } Any suggestion would be highly appriciated. |
|
October 30, 2019, 01:13 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
show output.
make a message on nodes only problem could be in the way, how you define your variables (now you've defined them as global variables everywhere)
__________________
best regards ****************************** press LIKE if this message was helpful |
|
Tags |
dpm, global variable, parallel code |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[solidMechanics] Support thread for "Solid Mechanics Solvers added to OpenFOAM Extend" | bigphil | OpenFOAM CC Toolkits for Fluid-Structure Interaction | 686 | December 22, 2022 10:10 |
dynamic Mesh is faster than MRF???? | sharonyue | OpenFOAM Running, Solving & CFD | 14 | August 26, 2013 08:47 |
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 | bookie56 | OpenFOAM Installation | 8 | August 13, 2011 05:03 |
emag beta feature: charge density | charlotte | CFX | 4 | March 22, 2011 10:14 |
Env variable not set | gruber2 | OpenFOAM Installation | 5 | December 30, 2005 05:27 |