CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

source term of energy equation in non-equilibrium thermal model of porous media

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 28, 2024, 21:24
Default source term of energy equation in non-equilibrium thermal model of porous media
  #1
New Member
 
Fany
Join Date: Jan 2022
Posts: 2
Rep Power: 0
yf70512 is on a distinguished road
Hello everyone,

I am trying to modify the source term of energy equation in non-equilibrium thermal model by UDS and UDF (DEFINE_SOURCE macro).
But the Fluent crashed when the code runned with the error "999999:mpt_accept:error: accept failed: No error". My code is as following:

DEFINE_SOURCE(Fluid_source,c,t,dS,eqn)
{

real Tf, Ts;
real hfs = HFS_CONSTANT; // Placeholder value for heat transfer coefficient
real Afs = AFS_CONSTANT; // Placeholder value for interfacial area density
real source;

// Obtain fluid and solid temperatures
Tf = C_T(c, t); // Fluid temperature
Ts = C_STORAGE_R(c, t, SV_T_S); // Solid temperature

// Calculate the source term based on the modified expression
source = hfs * Afs * (pow(Ts, 4.0) - pow(Tf, 4.0));

// Set the derivative of the source term with respect to Tf
dS[eqn] = 4.0 * hfs * Afs * pow(Ts, 3.0) - 4.0 * hfs * Afs * pow(Tf, 3.0);

return source;

}


DEFINE_SOURCE(Solid_source,c,t,dS,eqn)
{

real Tf, Ts;
real hfs = HFS_CONSTANT; // Placeholder value for heat transfer coefficient
real Afs = AFS_CONSTANT; // Placeholder value for interfacial area density
real source;

// Obtain fluid and solid temperatures
Ts = C_STORAGE_R(c, t, SV_T_S); // Solid temperature
Tf = C_T(c, t); // Fluid temperature

// Calculate the source term based on the modified expression
source = hfs * Afs * (pow(Tf, 4.0) - pow(Ts, 4.0));

// Set the derivative of the source term with respect to Tf
dS[eqn] = 4.0 * hfs * Afs * pow(Tf, 3.0) - 4.0 * hfs * Afs * pow(Ts, 3.0);

return source;

}

I am not sure if it was caused by the wrong expreesion of reading the solid temperature. Could someone please give me some suggestions? Many thanks.

Best regards,

Fan
yf70512 is offline   Reply With Quote

Reply

Tags
non-thermal equilibrium, porous media, source terms, uds


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using PengRobinsonGas EoS with sprayFoam Jabo OpenFOAM Running, Solving & CFD 36 July 16, 2024 04:52
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 ordinary OpenFOAM Installation 19 September 3, 2019 19:13
polynomial BC srv537 OpenFOAM Pre-Processing 4 December 3, 2016 10:07
[Other] Adding solvers from DensityBasedTurbo to foam-extend 3.0 Seroga OpenFOAM Community Contributions 9 June 12, 2015 18:18
Source term energy equation for reactive flows DaIN Main CFD Forum 0 October 6, 2011 16:11


All times are GMT -4. The time now is 14:40.