|
[Sponsors] |
February 29, 2020, 09:11 |
|
#21 | |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
Quote:
DEFINE_ADJUST(gradient, domain) { Thread *t; Thread **pt; cell_t c; Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,P_PHASE); real voidx, voidy, voidz=0.0; { Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_N ULL); Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL); Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG,Vof_Deriv_Accumulate); } { Alloc_Storage_Vars(domain, SV_Y_RG, SV_Y_G, SV_NULL); //Y_derivatives(domain); Free_Storage_Vars(domain, SV_Y_RG, SV_NULL); } mp_thread_loop_c (t,domain,pt) if (FLUID_THREAD_P(t)) { Thread *tp = pt[P_PHASE]; begin_c_loop (c,t) { // (C_VOF_G(c,tp)[0]*C_T_G(c,t)[0]+C_VOF_G(c,tp)[1]*C_T_G(c,t)[1]+C_VOF_G(c,tp)[2]*C_T_G(c,t)[2]); C_UDMI(c,t,0) = (C_VOF_G(c,tp)[0]*C_YI_G(c,tp,0)[0] + C_VOF_G(c,tp)[1]*C_YI_G(c,tp,0)[1] + C_VOF_G(c,tp)[2]*C_YI_G(c,tp,0)[2]); } end_c_loop (c,t) } Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NU LL); Free_Storage_Vars(domain, SV_Y_G, SV_NULL); //Message("C_UDMI(cell,mix_air,0) = %g\n",C_UDMI(c,t,0)); } without error and successful initializing but when i running, appear this message 'the f1 process could not be started' and automatically FLUENT closed. |
||
February 29, 2020, 09:17 |
|
#22 | |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
Quote:
DEFINE_ADJUST(gradient, domain) { Thread *t; Thread **pt; cell_t c; Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,P_PHASE); real voidx, voidy, voidz=0.0; { Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_N ULL); Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL); Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG,Vof_Deriv_Accumulate); } { Alloc_Storage_Vars(domain, SV_Y_RG, SV_Y_G, SV_NULL); //Y_derivatives(domain); Free_Storage_Vars(domain, SV_Y_RG, SV_NULL); } mp_thread_loop_c (t,domain,pt) if (FLUID_THREAD_P(t)) { Thread *tp = pt[P_PHASE]; begin_c_loop (c,t) { // (C_VOF_G(c,tp)[0]*C_T_G(c,t)[0]+C_VOF_G(c,tp)[1]*C_T_G(c,t)[1]+C_VOF_G(c,tp)[2]*C_T_G(c,t)[2]); C_UDMI(c,t,0) = (C_VOF_G(c,tp)[0]*C_YI_G(c,tp,0)[0] + C_VOF_G(c,tp)[1]*C_YI_G(c,tp,0)[1] + C_VOF_G(c,tp)[2]*C_YI_G(c,tp,0)[2]); } end_c_loop (c,t) } Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NU LL); Free_Storage_Vars(domain, SV_Y_G, SV_NULL); //Message("C_UDMI(cell,mix_air,0) = %g\n",C_UDMI(c,t,0)); } without error and successful initializing but when i running appear this message 'the f1 process could not be started ' and automatically fluent closed |
||
February 29, 2020, 10:13 |
|
#23 | |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
Quote:
DEFINE_ADJUST(gradient, domain) { Thread *t; Thread **pt; cell_t c; Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,P_PHASE); real voidx, voidy, voidz=0.0; { Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_N ULL); Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL); Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG,Vof_Deriv_Accumulate); } { Alloc_Storage_Vars(domain, SV_Y_RG, SV_Y_G, SV_NULL); //Y_derivatives(domain); Free_Storage_Vars(domain, SV_Y_RG, SV_NULL); } mp_thread_loop_c (t,domain,pt) if (FLUID_THREAD_P(t)) { Thread *tp = pt[P_PHASE]; begin_c_loop (c,t) { // (C_VOF_G(c,tp)[0]*C_T_G(c,t)[0]+C_VOF_G(c,tp)[1]*C_T_G(c,t)[1]+C_VOF_G(c,tp)[2]*C_T_G(c,t)[2]); C_UDMI(c,t,0) = (C_VOF_G(c,tp)[0]*C_YI_G(c,tp,0)[0] + C_VOF_G(c,tp)[1]*C_YI_G(c,tp,0)[1] + C_VOF_G(c,tp)[2]*C_YI_G(c,tp,0)[2]); } end_c_loop (c,t) } Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NU LL); Free_Storage_Vars(domain, SV_Y_G, SV_NULL); //Message("C_UDMI(cell,mix_air,0) = %g\n",C_UDMI(c,t,0)); } without error and successful initializing but when i running, appear this message 'the f1 process could not be started' and automatically FLUENT closed. |
||
February 29, 2020, 10:20 |
Solver
|
#24 |
Senior Member
|
Are you using pressure based solver or density based? If it is pressure based, then you need to tell Fluent to specifically save gradients using the following command
(rpsetvar 'species/save-gradients? #t) before using the UDF.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
February 29, 2020, 10:35 |
|
#25 | |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
Quote:
what is the answer for question 'species/save-gradients?'? |
||
February 29, 2020, 10:49 |
true
|
#26 |
Senior Member
|
It's not a question, rather a boolean. And the Vale is already given in my post as #t.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
February 29, 2020, 10:59 |
|
#27 |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
||
February 29, 2020, 11:44 |
|
#28 | |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
Quote:
appear message: Error: eval: unbound variable Error Object: args |
||
February 29, 2020, 12:10 |
rpvar
|
#29 |
Senior Member
|
Whole of this command need to be given in one go, along with the parentheses.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
February 29, 2020, 12:15 |
|
#30 |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
||
February 29, 2020, 12:20 |
|
#31 |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
||
February 29, 2020, 12:39 |
Issue
|
#32 |
Senior Member
|
Then possibly the issue is not with UDF. Does the case run without the UDF?
And are there still comments starting with // instead of contained in /* */? If yes, then you should either remove those comments or put those in /* */.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
February 29, 2020, 12:53 |
|
#33 | |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
Quote:
DEFINE_ADJUST(gradient, domain) { Thread *t; Thread **pt; cell_t c; Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,P_PHASE); real voidx, voidy, voidz=0.0; { Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_N ULL); Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL); Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG,Vof_Deriv_Accumulate); } { Alloc_Storage_Vars(domain, SV_Y_RG, SV_Y_G, SV_NULL); Free_Storage_Vars(domain, SV_Y_RG, SV_NULL); } mp_thread_loop_c (t,domain,pt) if (FLUID_THREAD_P(t)) { Thread *tp = pt[P_PHASE]; begin_c_loop (c,t) { C_UDMI(c,t,0) = (C_VOF_G(c,tp)[0]*C_YI_G(c,tp,0)[0] + C_VOF_G(c,tp)[1]*C_YI_G(c,tp,0)[1] + C_VOF_G(c,tp)[2]*C_YI_G(c,tp,0)[2]); } end_c_loop (c,t) } Free_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_NU LL); Free_Storage_Vars(domain, SV_Y_G, SV_NULL); } unfortunately still there is error i think error coming from line "T_derivatives" that should be reform to mass fraction command |
||
February 29, 2020, 13:08 |
T_derivatives
|
#34 |
Senior Member
|
Well, you have nothing to lose by trying T_derivatives in your code.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
March 6, 2020, 06:03 |
|
#35 |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
||
March 6, 2020, 06:15 |
|
#36 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
probably it is Index that identifies the user-defined scalar,
however, index must be > -1, so I could be wrong
__________________
best regards ****************************** press LIKE if this message was helpful |
|
March 6, 2020, 06:20 |
|
#37 | |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
Quote:
how to change this section : Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_N ULL); Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL); Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG,Vof_Deriv_Accumulate); for accessing the mass fraction gradients? |
||
March 6, 2020, 06:24 |
|
#38 |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
||
March 6, 2020, 08:10 |
Explanation
|
#39 |
Senior Member
|
-1 is actually SV_NULL and is a variable attribute defined in Fluent's variable structure. Anything more than that would be a goose chase.
For mass fractions, use Y in place of VOF. Vof_Deriv_Accumulate is to be replaced with NULL. Yes, Vector_Derivatives, Vector_Reconstructionn, as well as Vector_Gradient_Reconstruction exist. This is when user wants a gradient but not spatial.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
March 6, 2020, 08:57 |
|
#40 | |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
Quote:
do i should write the commands : "Alloc_Storage_Vars(pDomain,SV_VOF_RG,SV_VOF_G,SV_ N ULL); Scalar_Reconstruction(pDomain, SV_VOF,-1,SV_VOF_RG,NULL); Scalar_Derivatives(pDomain,SV_VOF,-1,SV_VOF_G,SV_VOF_RG,Vof_Deriv_Accumulate);" for mass fraction gradients?(modify ocde by replacing VOF with Y and etc) |
||
Tags |
macros, segmentation error, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mass fraction of species | Lilly | FLUENT | 5 | March 13, 2022 18:52 |
CFD by anderson, chp 10.... supersonic flow over flat plate | varunjain89 | Main CFD Forum | 18 | May 11, 2018 08:31 |
Accessing the species mass fraction for particles data in UDF | mac_09 | FLUENT | 17 | August 9, 2017 21:15 |
Define mass flow profile with regards to species mass fraction | danS | Fluent UDF and Scheme Programming | 0 | June 20, 2017 07:21 |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 04:32 |