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

UDS convection

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   July 9, 2012, 04:16
Default UDS convection
  #1
New Member
 
Jun Li
Join Date: Jul 2012
Posts: 9
Rep Power: 4
sunbird04 is on a distinguished road
Hey all,
Recently I want to use Fluent's user define scalars(uds) to solve the nucleation of equiax grain in a ingot cast problem with Fluent Eulerian Mutiphase Model. The control equation for the nucleation of equiaxed grain as follow:

\partialN/\partialt+\nabla\cdot(uN)=source

Therefor, for both the Unsteady Function and Flux Function should be defined by udf. My code is shown:

DEFINE_UDS_UNSTEADY(unsteady_terms,cell_index,cell _thread,i,apu,su)
{
real cell_volume, physical_dt, RHO_cell, vof, vof_new, phi_old;

cell_volume = C_VOLUME(cell_index,cell_thread);
physical_dt = RP_Get_Real("physical-time-step");

RHO_cell = C_R(cell_index,cell_thread);
vof = C_VOF_M1(cell_index,cell_thread);
vof_new = C_VOF(cell_index,cell_thread);

/* IMPLICIT PART OF THE TIME DERIVATIVE DISCRETIZATION */
*apu = -(cell_volume)/physical_dt;

/* EXPLICIT PART OF THE TIME DERIVATIVE DISCRETIZATION */
phi_old = C_STORAGE_R(cell_index,cell_thread,SV_UDSI_M1(i));
*su = (cell_volume*phi_old)/physical_dt;
}

/*-------------------------*/
/* CONVECTIVE (FLUX) TERMS */
/*-------------------------*/

DEFINE_UDS_FLUX(convective_flux_terms,face_index,f ace_thread,i)
{
Thread *t0, *t1 = NULL;
cell_t c0, c1 = -1;
real NV_VEC(psi_vec), NV_VEC(A), vof, flux = 0.0, rho = 2;

c0 = F_C0(face_index,face_thread);
t0 = F_C0_THREAD(face_index,face_thread);
vof = C_VOF(c0, t0);

c0 = F_C0(face_index,face_thread);
t0 = F_C0_THREAD(face_index,face_thread);

/* if(PRINCIPAL_FACE_P(face_index,face_thread)) */
{
F_AREA(A,face_index,face_thread); /* NORMAL VECTOR OF THE FACE */

if(BOUNDARY_FACE_THREAD_P(face_thread))
{
NV_DS(psi_vec,=,F_U(face_index,face_thread),F_V(fa ce_index,face_thread),F_W(face_index,face_thread), *,1.0);
flux = NV_DOT(psi_vec,A); /* FLUX THROUGH THE FACE */
}
else
{
c1 = F_C1(face_index,face_thread);
t1 = F_C1_THREAD(face_index,face_thread);

NV_DS(psi_vec, =,C_U(c0,t0),C_V(c0,t0),C_W(c0,t0),*,1.0);
NV_DS(psi_vec,+=,C_U(c1,t1),C_V(c1,t1),C_W(c1,t1), *,1.0);

flux = NV_DOT(psi_vec,A)/2.0; /* AVERAGE FLUX THROUGH THE FACE */
}
return (flux);
}
}


Only momentum equation is solved. For these code I done two different cases:

Case I, only the melt (liquid) region is considered. For this case the simulation result is reasonable;

Case II, both the melt (liquid) and model (solid) are considered which means this is a liquid solid couple problem. For this case, the simulation cannot running. The error message emerged even at the first iteration:

Error:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object: ()



I'd appreciate your help. Thanks in advance.
sunbird04 is offline   Reply With Quote

Old   July 9, 2012, 12:23
Default
  #2
New Member
 
Jun Li
Join Date: Jul 2012
Posts: 9
Rep Power: 4
sunbird04 is on a distinguished road
Still waiting for your reply...Thx.
sunbird04 is offline   Reply With Quote

Old   July 10, 2012, 11:41
Default
  #3
New Member
 
Jun Li
Join Date: Jul 2012
Posts: 9
Rep Power: 4
sunbird04 is on a distinguished road
Anyone who can help me?
sunbird04 is offline   Reply With Quote

Old   February 13, 2013, 04:33
Default
  #4
mkj
New Member
 
Mrinal Jagirdar
Join Date: Sep 2011
Posts: 4
Rep Power: 5
mkj is on a distinguished road
I am not very sure, but according to FLUENT UDF manual Pg. 205, _M1 doesn't seem to be usable with C_VOF. Its probably only with cell variable in the table. I think I am facing a problem because of using C_VOF_M1.

I am using "Variable Time Step". Does anyone know if UDS is compulsory to use so that "_M1" can be used? Because, according to the user manual, if you use adaptive time step, there is no need to use UDS to utilize "_M1". I am unsure whether "Variable Time Step" (for 2 phase) qualifies as "Adaptive Time Step"
mkj is offline   Reply With Quote

Old   February 13, 2013, 04:37
Default
  #5
mkj
New Member
 
Mrinal Jagirdar
Join Date: Sep 2011
Posts: 4
Rep Power: 5
mkj is on a distinguished road
@sunbird04: Did you manage to solve your problem? Please let me know.

Thanks!
mkj is offline   Reply With Quote

Old   February 15, 2013, 06:46
Default
  #6
vig
New Member
 
anonymous
Join Date: Jan 2011
Posts: 23
Rep Power: 6
vig is on a distinguished road
If UDS is defined at the mixture level, you might require to access the volume fraction from the phase level.

If that is the case,
then define the phase thread as following

For phase-index = n , n = 0 for primary phase, 1 for 1st secondary phase

Thread *pt = THREAD_SUB_THREAD(cell_thread, n)

Then access
vof = C_VOF(cell_index, pt)
and
vof_m1 = C_VOF_M1(cell_index, pt)
vig is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDS convection sunbird04 FLUENT 0 July 9, 2012 03:53
Modeling both radiation and convection on surfaces - Ansys Transient Thermal R13 s.mishra ANSYS 0 March 31, 2012 04:12
natural convection problem with radiation jorien CFX 0 October 14, 2011 09:26
[Q] Convection term treatment in UDS Ryan, Lee FLUENT 4 October 18, 2004 10:20
Porous media convection UDS equations cp FLUENT 1 September 19, 2003 19:53


All times are GMT -4. The time now is 11:35.