|
[Sponsors] |
March 17, 2020, 17:02 |
|
#21 |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
So do you run the case??
Before 1st iteration fluent crashes |
|
March 17, 2020, 17:03 |
|
#22 |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
||
March 18, 2020, 05:51 |
|
#23 | |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
Quote:
it's amazing there are many projects of fluent in my computer include multiphase and dpm models but in the none of multiphase projects by typing the command (rpsetvar ...) species mass fraction gradients doesn't store!!! but in dpm projects gradients does store!! why?? |
||
March 18, 2020, 05:58 |
The problem
|
#24 |
Senior Member
|
I suppose the problem is not with Fluent or with the cases; it's with what you are doing. In a multiphase-multicomponent phase, gradients of species do not belong to mixture but to the phase. So, while displaying the mass fraction gradient contour, you have to select particular phase in the menu below it. Default selection is mixture representing mixture of phases.
__________________
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 18, 2020, 08:35 |
|
#25 | |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
Quote:
do i use the eulerian model to solve this problem? is there anyway to storing gradients in vof model? |
||
March 18, 2020, 10:20 |
Setup
|
#26 |
Senior Member
|
The problem is not with Multiphase model but the way you have setup the phases. Primary phase is a multicomponent mixture but the secondary phase is not. There are no species. You need to have at least two components. Once you have two components, simulation runs alright even after issuing command to save gradients.
Furthermore, you have mesh interface in your case. For such a simple model, interface should not be used. Change it to interior by using Fuse. Go to Mesh > Combine > Fuse and then select both boundaries that you have specified as interfaces. This will convert the interfaces into interior. Interface should only be used if you have a moving mesh in the system. Otherwise, it should not be used.
__________________
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 18, 2020, 10:54 |
|
#27 | |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
Quote:
amazing data i have changed secondary phase from mix-water with one component to water phase without any component and run fine without crashing the fluent and calculation done complete and dmass fraction/dx and etc appear i am so excited now (((: now i want to apply this variations with adding udf hope to solve it too thank you so much |
||
March 18, 2020, 11:25 |
|
#28 | |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
Quote:
this is code : DEFINE_ADJUST(mfgradient, domain) { Thread *t; Thread **pt; cell_t c; Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,P_PHASE); real voidx, voidy, voidz=0.0; mp_thread_loop_c (t,domain,pt) { if (FLUID_THREAD_P(t) && n_udm > 0) { begin_c_loop (c,t) { C_UDMI(c,t,0) = C_YI_G(c,pt[P_PHASE],0)[0]; } end_c_loop (c,t) } } } |
||
March 18, 2020, 12:07 |
Command and UDM
|
#29 |
Senior Member
|
There are at least two reasons because of which this could happen. One, you forgot to issue the command to save gradients. Second, you forgot to assign a UDM and initialize it to some value.
__________________
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 18, 2020, 12:10 |
|
#30 | |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
Quote:
this is complete code: #include "udf.h" #include "mem.h" #include"sg_mem.h" #include "sg.h" #include "sg_vof.h" #include "flow.h" #include "materials.h" static real K_q; static real Y_WV; static real Y_A; static real Y_W; static real RO_A; static real RO_W; static real VOF_W; static real RO_qi; static real L; static real m_lg; /************************************************** ********* UDF to apply mass transfer rate from water to air at the interface ************************************************** **********/ #define MW_W 18.0 #define MW_A 29.0 #define R 8.314 #define pi 3.14159 #define noo_water 1.45e-5 /*kinematic viscosity of water*/ #define noo_air 1e-6 /*kinematic viscosity of air*/ DEFINE_ADJUST(mfgradient, domain) { Thread *t; Thread **pt; cell_t c; Domain *pDomain = DOMAIN_SUB_DOMAIN(domain,P_PHASE); real voidx, voidy, voidz=0.0; mp_thread_loop_c (t,domain,pt) { if (FLUID_THREAD_P(t) && n_udm > 0) { begin_c_loop (c,t) { C_UDMI(c,t,0) = C_YI_G(c,pt[P_PHASE],0)[0]; } end_c_loop (c,t) } } } DEFINE_MASS_TRANSFER(mass_transfer_rate, cell, thread,from_phase_index, from_species_index, to_phase_index, to_species_index) { /************ Declare variables *********/ float T_cell, P_cell, P_sat, T_cell_air,T_cell_water; float u,v,w,Re,D,n_mix,n_vap; float NV_VEC(G),pos[ND_ND],Z; float X_WV, Y_A,A; float NV_MAG ; Thread *w_liq, *gas_mix, *w_gas,*mix_air,*mix_water,*ft; int i; int t_id = 7; /******** Define variables *********/ m_lg = C_UDMI(cell,thread,0); //Message("m_lg = %g\n",m_lg); return (m_lg); /* return value of mass transfer rate */ } |
||
March 18, 2020, 14:27 |
The code
|
#31 |
Senior Member
|
I remember the first part because I wrote it. You do not need voidx, voidy, and voidz because those are not being used. However, for the rest of the code, I am not sure where you picked it from. First of all, m_lg is defined as static and global. This should be a local variable. However badly the code is written it still does not have anything that could cause segmentation violation except one thing; declaration of NV_MAG as float. NV_MAG is a function defined in Fluent that determines magnitude of a vector. You are redefining it as a real variable in your code. This is invalid. Remove that line and do share the output of compilation of the library if the code still does not work.
__________________
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 19, 2020, 18:21 |
|
#32 | |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
Quote:
thanks for your helping this message appear when build the udf ************************************************** ************************** ************************************************** ************************** ** WARNING: Automatically switched to run in parallel -t1 mode. ** ** Detected non-parallelized UDF usage, enabling parallel usage. ** ** If you encounter any issues, please re-run with -t0 flag. ** ************************************************** ************************** ************************************************** **************************udf_names.c and user_nt.udf files in 3ddp_node are upto date. (system "copy "D:\ANSYS Inc\v195\fluent"\fluent19.5.0\src\udf\makefile_nt. udf "libudf\win64\3ddp_node\makefile" ") 1 file(s) copied. (chdir "libudf")(chdir "win64\3ddp_node") Done. and another point is that after running the value of species gradients is irrational and incorrect! why?? |
||
March 20, 2020, 05:59 |
Gradient
|
#33 |
Senior Member
|
The values for the gradient depend on the field. Until and unless the solution is converged, the gradient would also not be correct.
__________________
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 20, 2020, 12:28 |
|
#34 |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
||
March 20, 2020, 12:35 |
Not important
|
#35 |
Senior Member
|
All it says is that Fluent has started in parallel and though the UDF source is not parallelized, Fluent will try to use it in a parallel simulation. New versions of Fluent start in parallel even when Serial is selected. To really start Fluent in serial, it needs to be started from command prompt with -t0 argument.
__________________
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 20, 2020, 12:41 |
|
#36 | |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
Quote:
|
||
March 20, 2020, 12:50 |
Error
|
#37 |
Senior Member
|
Yes, it would cause problem if the UDF is not parallelized and you run it in parallel. Try it in Serial.
__________________
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 20, 2020, 12:58 |
|
#38 |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
||
March 20, 2020, 12:59 |
Serial
|
#39 |
Senior Member
|
Please read my previous post carefully. Selecting the Serial on the launcher does NOT start Fluent in serial. To start in serial, you have to start using the command. it is not possible to start Fluent in serial using Fluent launcher.
__________________
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 21, 2020, 14:39 |
|
#40 | |
Senior Member
mahdi rostami
Join Date: Jan 2020
Posts: 155
Rep Power: 6 |
Quote:
this is modified code and parallelized it #include "udf.h" #include "mem.h" #include"sg_mem.h" #include "sg_vof.h" #include "flow.h" #include "materials.h" /************************************************** ********* UDF to apply mass transfer rate from water to air at the interface ************************************************** **********/ DEFINE_ADJUST(adjust_gradient, domain) { #if !RP_HOST Thread *t; cell_t c; face_t f; domain = Get_Domain(2); thread_loop_c (t,domain) { begin_c_loop (c,t) { C_UDSI(c,t,0) = C_YI_G(c,t,0)[0]; } end_c_loop (c,t) } #endif } DEFINE_MASS_TRANSFER(mass_transfer_rate, cell, thread,from_phase_index, from_species_index, to_phase_index, to_species_index) { /************ Declare variables *********/ #if !RP_HOST Thread *mix_air; real m_lg; mix_air = THREAD_SUB_THREAD(thread, to_phase_index); m_lg = C_UDSI(cell,thread,0); Message("m_lg = %g\n",m_lg); return (m_lg); /* return value of mass transfer rate */ #endif } values of gradients is irrational some values: m_lg = -15.3372 m_lg = 13.3316 m_lg = 5.45169 m_lg = 1.16965 m_lg = 0.105699 m_lg = 0.00610973 m_lg = -0.000382168 m_lg = -0.000179512 m_lg = -3.14533e-05 m_lg = 3.46569 m_lg = -15.3372 m_lg = 11.6576 m_lg = -0.275925 m_lg = -0.0847251 m_lg = -0.0133855 m_lg = -0.00144255 m_lg = -0.000119092 m_lg = -7.79091e-06 m_lg = -3.25596e-07 m_lg = 3.46569 m_lg = -15.3372 |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
mass fraction of species | Lilly | FLUENT | 5 | March 13, 2022 18:52 |
gradient of species mass fraction | zhou | FLUENT | 1 | March 14, 2020 08:55 |
Water subcooled boiling | Attesz | CFX | 7 | January 5, 2013 04:32 |
UDF for Species Mass Fraction Gradient *IN SPECIFIC ZONE * -- e.g. along axis of sym. | ksiegs2 | Fluent UDF and Scheme Programming | 0 | February 27, 2011 13:55 |
On the damBreak4phaseFine cases | paean | OpenFOAM Running, Solving & CFD | 0 | November 14, 2008 22:14 |