-
-
June 16, 2021 at 7:18 pm
jkhalesi
SubscriberI am looking for a UDF used in a tutorial titled "Modeling Flow and Heat Transfer in Packed Bed Reactor" in 2011 named " thermal-non-equ.c." I searched for this file many days online and in the Ansys help files but no chance to find it.
I am trying to simulate a packed bed thermal storage using a porous media model. I could define [1/alpha] and [C2] in the Fluent porous media tab for pressure drop and it works good. But, I am willing to write a UDF for the non-thermal equilibrium approach.
I need to report temperature distribution in axial direction ( the geometry is a cylindrical model) and values of Qstorage in kJ and MWh. Please help me.
June 17, 2021 at 10:51 amRob
Forum ModeratorMaybe read this? /forum/discussion/28855/need-a-udf-file-used-in-a-fluent-tutorial#latest And don't post in multiple locations.
June 17, 2021 at 3:28 pmjkhalesi
SubscriberHi Rob
Thank you for your reply. How can my supervisor contact you for the file? This UDF file helps me to write the UDF for simulating thermal non-equilibrium model for a porous media packed bed.
Generally, I want to understand how I can simulate the thermal non-equilibrium in porous media. I used Fluent non-equilibrium for treatment of heat transfer but the energy equation is diverged. Fluent creates a solid zone when I activate non-equilibrium module in porous media tab and I do not change boundary conditions for solid zone. As you can see the picture in the previous post, I use axis for 2D axisymmetric model and all other walls are adiabatic walls. In this transient analysis, I assume timestep size 0.01 s and the number of time is changed for instance 10000. I also tried time step 0.001 s but energy equation is still diverged.
This equation is used for HTC:
Any help is greatly appreciated. Any tutorial to hep me simulate this problem or write the UDF will be very helpful.
Javad
June 17, 2021 at 3:43 pmRob
Forum ModeratorYour site should have a coordinator who can get in touch.
Looking at the problem, the solid zone is to give you something to heat up/cool down in the fluid region. The model is stable, so review your settings, including resistance coefficients and porosity.
June 17, 2021 at 4:12 pmjkhalesi
SubscriberThe resistance coefficients and porosity are correct because the pressure drop result is validated against Erugn's equation for specific Re number. That's why I need help. I do not think Interfacial Area Density is an issue. I use the below equation for it: I hope this equation is correct.
Source: https://ntrs.nasa.gov/citations/20060051853
June 18, 2021 at 4:40 pmjkhalesi
SubscriberDo you have any tutorial covering thermal non-equilibrium approach in Fluent? I still change parameters and energy equation is not converged. I use different fixed time step, no chance to get results. I used CFL based in which time step is 10^-6, the simulation would take many days for just 10 s in the problem.
Thank you
June 22, 2021 at 11:12 amRob
Forum ModeratorI don't think there is a tutorial for the model, only the older one you've identified.
Transient models aren't quick, that's why we tend to use steady solutions where possible or use engineering judgement to re-pose the problem.
June 28, 2021 at 2:51 amjkhalesi
SubscriberHello I have changed the UDF used in the tutorial for my simulation. I am using Fluent 19.1 now. By default, when energy equation is on, in porous media tab, the equilibrium approach is on. This approach uses the porosity value and both fluid and solid thermal conductivity to calculate the effective thermal conductivity, keff=eps*kf+(1-eps)ks. I interpret UDF and keep the default approach fix. I expect to get the temperature distribution in the fluid domain based on keff. and I expect to get the solid temperature using UDS I define in UDF. but there is no temperature results in UDS. The temperature contours shows the initial temperature when I plot UDS contours.
The UDF is interpreted in fluent with no error and warning, but no results in the UDS when I plot temperature contours. Would please check The UDF to see if something is wrong and should be modified?
As you mentioned earlier, a function might not work in the current fluent version.
I had to define eps_b= 0.7 because I was not sure what the porosity in fluent is. eps_b =1-porosity (Is it C_POR(c,t)??). The porosity used in this simulation is 0.3. I use time step between 1s and 5s.
any help is appreciated.
Javad
#include "udf.h"
real delta_t;
#define d_b 0.009525/* mean diameter of bulk material */
#define eps_b 0.7
real rho_b = 2560.;/* particle density */
real cp_b= 2458.;/* specific heat capacity */
real A_V_sphere = 6.0/d_b;/* area-to-volume ratio of a sphere*/
real A_b_V;/* area-to-volume ratio */
enum
{
T_B N_REQUIRED_UDS
};
DEFINE_ADJUST(pm_adjust, domain)
{
delta_t = RP_Get_Real("physical-time-step");
}
DEFINE_UDS_UNSTEADY(pm_first_order, c, t, i, apu, su)
{
real vol;/* cell volume */
real vol_m1; /* cell volume time step minus 1 */
real fac;/* factor in time derivative */
real fac_m1; /* factor at time step minus 1 */
vol= C_VOLUME(c,t);
vol_m1 = vol;
fac= rho_b*cp_b*eps_b;
fac_m1 = fac;
*apu= -fac*vol / delta_t;
*su= fac_m1*vol_m1*C_UDSI_M1(c,t,i)/delta_t;
}
/* heat transfer coefficient in porous media, see Wakao and Kaguei, 1982 */
real htc(cell_t c, Thread *t)
{
real Nu, Re, Pr;
Re = ND_MAG(C_U(c,t),C_V(c,t),C_W(c,t))*d_b*C_R(c,t)/C_MU_L(c,t);
Pr = C_CP(c,t)*C_MU_L(c,t)/C_K_L(c,t);
Nu = 2.+ 1.1 * pow(Re,0.6) * pow(Pr,1./3.);
return Nu*C_K_L(c,t)/d_b;
}
DEFINE_SOURCE(energy_source, c, t, dS, eqn)
{
real pref;
real source;
A_b_V = eps_b*A_V_sphere;
pref = htc(c,t)*A_b_V;
source = -pref*(C_T(c, t) - C_UDSI(c, t, T_B));
dS[eqn] = -pref;
return source;
}
DEFINE_SOURCE(uds_source, c, t, dS, eqn)
{
real pref;
real source;
A_b_V = eps_b*A_V_sphere;
pref = htc(c,t)*A_b_V;
source = pref*(C_T(c, t) - C_UDSI(c, t, T_B));
dS[eqn] = -pref;
return source;
}
June 28, 2021 at 5:51 amAmine Ben Hadj Ali
Ansys EmployeeFor packed bed you can even rely on Eulerian Model: Packed Bed option and fixing the velocity of the packed bed to zero.
June 28, 2021 at 5:52 amAmine Ben Hadj Ali
Ansys EmployeeFor your approach you need to alter the interfacial area of the bed right?
June 28, 2021 at 5:56 amAmine Ben Hadj Ali
Ansys EmployeeI do not understand why you require such an old UDF if one can use the built-in model and just try to run it conservative.
June 29, 2021 at 4:23 pmjkhalesi
SubscriberHi DrAmine
What do you mean conservative? I know that this UDF works in older versions. What should I update on this UDF for current fluent version (Fluent 19.1)? I think the function is used for UDS source or time dependent function have changed.
I would like to use the built-in module but it does not work. I dont know why. I do not use the built-in model because for any time step I used in my simulation, energy equation is diverged. When non-equilibrium approach is activated in Fluent, another zone is created which belongs to solid zone. I do not change B boundary conditions for this zone, so adiabatic B.Cs are used to surrounding walls. I tried a range of time step from 0.001 to 5s , but it is still not working. temperature inside the domain goes to 6000 K.
At this time, I do not work on a two-phase model based on Eulerian model.
Thank you
Javad
June 30, 2021 at 6:14 amAmine Ben Hadj Ali
Ansys EmployeeFirst of all you are using an old Ansys Fluent version and I recommend starting using an actual version.
That another zone (shadow-zone) of fluid porous zone is created when using the non-eq approach is expected and required. For that reason please try first in actual release version if the problem still persists.
July 29, 2021 at 7:29 pmjkhalesi
SubscriberHi DrAmine
I have written a UDF to calculate heat transfer coefficient using the built-in non-eq approach in Fleunt. I have run this UDF in Fluent 2020R2 but It does not work. If I use a constant value for heat transfer coefficient, the module is working. I have also run the UDF in older version and it works. It means that something wrong is in UDF. Would please look at the UDF and see what's wrong with it.
Thank you
Javad
#include "udf.h"
DEFINE_PROFILE(htc,t,i)
{
cell_t c;
real Nu,Re,Pr;
real dens, visc; /*Fluid*/
real cond, cp; /* Fluid*/
real d_p;
real por;/*Porosity of the bed*/
d_p=0.02;
por=1.0;
begin_c_loop(c,t)
{
dens = C_R(c,t); /*Density of fluid*/
visc = C_MU_L(c,t); /*Viscosity fluid*/
cond = C_K_L(c,t); /*Conductivity fluid*/
cp = C_CP(c,t); /*Specific heat fluid*/
Re = ND_MAG(C_U(c,t),C_V(c,t),C_W(c,t))*d_p*dens*por/visc ;
/*Reynolds number has been calculated based on pore velocity*/
Pr = cp*visc/cond ;
Nu = 2.+ 1.1 * pow(Re,0.6) * pow(Pr,1./3.);
F_PROFILE(c,t,i) = Nu*cond/d_p ;
}
end_c_loop(c,t)
}
July 29, 2021 at 7:35 pmJuly 30, 2021 at 12:30 pmRob
Forum ModeratorDid you set the case up from scratch in 2021Rx or just open the old one? We check compatibility for a few versions into the new code but not that many back.
July 30, 2021 at 3:45 pmjkhalesi
SubscriberYes, I did.
Why does the UDF work in previous version but not in the current version? Have you look at my UDF to see if you have change any function and parameter on the source code?
July 30, 2021 at 7:11 pmjkhalesi
SubscriberHi Rob I have another question. How can I print Pr number defined in the UDF? I want to see what value of Pr is.
As I activate porous media in the cell condition, fluent report thermal conductivity =porosity*thermal conductivity. Is "C_K_L(c,t)" thermal conductivity of the cell or the thermal conductivity defined earlier in material properties?
If we report thermal conductivity using surface integral report> the area weighted avg thermal conductivity is reported as "porosity * thermal conductivity". For example, I define porosity 0.3 and thermal conductivity k=0.02; I report the area weighted avg thermal conductivity, the results is porosity*k=0.006. Is "C_K_L(c,t)" 0.006 or 0.02?
Please clarify this for me.
Thank you.
August 2, 2021 at 3:00 pmRob
Forum ModeratorI think you want the fprint command: search for that in the documentation and see if that's what you want. If you want a per-cell value stick the result of the Pr calculation into User Defined Memory.
August 2, 2021 at 6:23 pmjkhalesi
SubscriberWhat is the value of "C_K_L(c,t)"?
Is "C_K_L(c,t)" the thermal conductivity defined earlier in material properties?
If we report thermal conductivity using surface integral report> the area weighted avg, thermal conductivity is reported as "porosity * thermal conductivity". For example, I define porosity 0.3 and thermal conductivity k=0.02 W/mK; I report the area weighted avg thermal conductivity, the results is porosity*k=0.006. Is "C_K_L(c,t)" 0.006 or 0.02?
August 2, 2021 at 11:41 pmjkhalesi
SubscriberAnswer to my question for public use:
printf ("Pr, %g \n", C_CP(c,t)*C_MU_L(c,t)/C_K_L(c,t));
C_K_L(c,t) is the thermal conductivity we input in material properties.
August 3, 2021 at 1:37 pmRob
Forum ModeratorThanks.
October 26, 2021 at 7:10 amss_stardust
Subscriber
Did u receive the LTNE tutorial? I also need the same. Can you please share the tutorial file?
Thanks in advance.
Viewing 22 reply threads- The topic ‘UDF in Fluent for heat treatment in porous media, packed bed’ is closed to new replies.
Ansys Innovation SpaceTrending discussions- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Script error Code: 800a000d
- Cyclone (Stairmand) simulation using RSM
- Fluent fails with Intel MPI protocol on 2 nodes
- error udf
- Diesel with Ammonia/Hydrogen blend combustion
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
Top Contributors-
1216
-
543
-
523
-
225
-
209
Top Rated Tags© 2024 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-
The Ansys Learning Forum is a public forum. You are prohibited from providing (i) information that is confidential to You, your employer, or any third party, (ii) Personal Data or individually identifiable health information, (iii) any information that is U.S. Government Classified, Controlled Unclassified Information, International Traffic in Arms Regulators (ITAR) or Export Administration Regulators (EAR) controlled or otherwise have been determined by the United States Government or by a foreign government to require protection against unauthorized disclosure for reasons of national security, or (iv) topics or information restricted by the People's Republic of China data protection and privacy laws.