Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - william

Pages: 1 2 [3] 4 5 ... 11
31
Fluent / Re: Standard Collision Macro
« on: July 11, 2012, 06:38:53 PM »
Here is the link for usage and example of DEFINE_DPM_SPRAY_COLLIDE macro:

http://hpce.iitm.ac.in/website/Manuals/Fluent_6.3/fluent6.3/help/html/udf/node71.htm


32
The inside wall temperature is calculated by Fluent. You can use that temperature to calculate the overall heat transfer coefficient that would allow you to specify the heat conduction through the wall using DEFINE_PROFILE macro.

33
Fluent / Re: DPM Injections
« on: July 11, 2012, 06:32:25 PM »
Please see Fluent manual for instructions on how to use the DPM model. Link below:

https://www.sharcnet.ca/Software/Fluent12/html/ug/node666.htm


34
When reading in a large mesh or case file on 2 or more computers this error may appear:

999999 (..\..\src\mpsystem.c@1210): mpt_read: failed: errno = 10054

999999: mpt_read: error: read failed trying to read 4 bytes: No such file or directory

The problem is usually because you ran out of memory.

By default, the partitioner in FLUENT is "principal axis" which uses up a lot of memory. You can set a different partitioning method before reading the mesh or case file. If you are using MPICH as the communicator we recommend using the Metis partitioner.

Start FLUENT in network parallel with 4 or more processors and plenty of memory.

1.In FLUENT select the "Parallel" menu
2.Choose "Auto Partition"
3.Unselect "Case File"
4.Select "Metis" as the partition method
5.Choose OK
You should now be able to load the mesh or case file without memory problems.

35
Fluent / Re: How to mark two different region in complex geometry
« on: June 21, 2012, 05:57:02 PM »
What is in the black region?

36
Fluent / Re: How to mark two different region in complex geometry
« on: June 21, 2012, 12:11:07 PM »
Can you explain what you mean by marking of the geometry?
If you mean different volumes, then you can make the geometry in such a way that you don't unite all the volumes. You just have to stitch the joint faces of different volumes.

37
Fluent / Re: Body Force UDF problem
« on: June 19, 2012, 08:40:24 AM »
You should use the following to get the cell in which the particle is in:

cell_t c  = RP_CELL(&(tp->cCell));
Thread *t = RP_THREAD(&(tp->cCell));

38
Fluent / Re: Particle injection in DPM
« on: June 19, 2012, 08:38:40 AM »
Here is an example of how you can implement begin_particle_cell_loop:


/***********************************************************
   DPM Spray Collide Example UDF
************************************************************/
#include "udf.h"
#include "dpm.h"
#include "surf.h"
DEFINE_DPM_SPRAY_COLLIDE(man_spray_collide,tp,p)
{
  /* non-physical collision UDF that relaxes the particle */
  /* velocity and diameter in a cell to the mean over the */
  /* specified time scale t_relax */

  const real t_relax = 0.001; /* seconds */

  /* get the cell and Thread that the particle is currently in */
  cell_t c  = RP_CELL(&(tp->cCell));
  Thread *t = RP_THREAD(&(tp->cCell));

  /* Particle index for looping over all particles in the cell */
  Particle *pi;

  /* loop over all particles in the cell to find their mass */
  /* weighted mean velocity and diameter */
  int i;
  real u_mean[3]={0.}, mass_mean=0.;
  real d_orig = tp->state.diam;
  real decay = 1. - exp(-t_relax);
  begin_particle_cell_loop(pi,c,t)
    {
      mass_mean += pi->state.mass;
      for(i=0;i<3;i++)
        u_mean += pi->state.V*pi->state.mass;
    }
  end_particle_cell_loop(pi,c,t)

  /* relax particle velocity to the mean and diameter to the */
  /* initial diameter over the relaxation time scale t_relax */
  if( mass_mean > 0. )
    {
      for(i=0;i<3;i++)
        u_mean /= mass_mean;
      for(i=0;i<3;i++)
        tp->state.V += decay*( u_mean - tp->state.V );
      tp->state.diam += decay*( P_INIT_DIAM(tp) - tp->state.diam );
      /* adjust the number in the droplet parcel to conserve mass */
      tp->number_in_parcel *= CUB( d_orig/tp->state.diam );
    }
}

39
Fluent / Re: Solution here to UDF compiling Error - nmake
« on: June 16, 2012, 08:03:27 PM »
Make sure that in the set environment, you have path added to both Fluent as well as the system32.
%systemroot%\system32;


40
Fluent / Re: Outlet Boundary condition
« on: June 08, 2012, 08:21:28 AM »
You can specify multiple outflow boundaries in Fluent. In the Outflow dialog box, set the Flow Rate Weighting to indicate what portion of the outflow is through the boundary. The Flow Rate Weighting is a weighting factor. See below for details on how to split the flow according to mass flow %:

https://www.sharcnet.ca/Software/Fluent12/html/ug/node247.htm

41
Fluent / Re: Particle injection in DPM
« on: May 30, 2012, 10:50:19 AM »
You can use following UDF to track unsteady particles using user-specified time-interval. At the time of the next injection, the accumulated particles mass will be injected
There will be fewer particles but the particle mass will be preserved.

#include "udf.h"
#define RELEASE_STEP 5e-3
static real sum_inj = 0.0;
DEFINE_ADJUST  (update,  domain)
{
real  pflow;
if ( first_iteration )
{
pflow        =  get_mdot_prt(tm);
sum_inj += mdot*tmspsz;
}
}
DEFINE_DPM_INJECTION_INIT  (init_prt_tm,  I)
{
Particle *p;
real      tm, tmspsz, flowrate;
tm           =  RP_Get_Real("flow-time");
tmspsz   =  RP_Get_Real("physical-time-step");
flowrate  =  sum_inj/tmspsz;
loop(p,I->p_init)
{
p->flow_rate  = flowrate;
}
if ((tm+tmspsz) >= I->unsteady_start)
I->unsteady_start  +=  RELEASE_STEP;
sum_inj =  0.0;
}

42
Please start Fluent using double precision option.

43
Fluent / Re: UDF to count number of droplets in VOF simulation
« on: May 13, 2012, 11:45:50 AM »
This udf will allow you to count the number of droplets in a VOF simulation, you can also get droplets' statistics if you want.

NOTE:
(1) It can be used in 2D or 3D.
(2) It is recommended to run in serial, but it can be run in parallel as well. However, any droplet straddling the
partition interface will be counted as two separate droplets.
(3) User provides "PHASE_INDEX" and "INTERFACE_VOF" as inputs.
(4) Set one UDM to use this udf, the droplet # is saved in the UDM0.
(5) Any continuous liquid region will be counted as a droplet. Users may want to filter out the liquid pool
either in the udf or remove from the output.
(6) Procedures to run the udf:
a: Read in your case and data file.
b: Define one udm.
c: Run the simulation for 1 time step. THAT WILL ALLOCATE THE NEEDED MEMORY FOR THE UDM.
d: Compile this udf, hook it up and execute it.

*/


#include "udf.h"

#define PHASE_INDEX 1 /* droplet phase index 0 if it is the primary phase */
#define INTERFACE_VOF 0.5 /* threashold of VOF of the droplet phase at the interface */
#define NMAX 10000 /* Maximum number of out-layer cells within a droplet. increase this # if needed */
#define MAX_DROPLET 1000000 /* Maximum number of droplets, increase this # if needed */

DEFINE_ON_DEMAND(on_demand_size_distribution_vof)
{
Domain *d;
Thread *t, *t0;
cell_t c, c0;
face_t f;
Thread *tf;
int i,n,n_child,N_search;
int N_droplet=0;

cell_t cell_id1[NMAX], cell_id2[NMAX];
Thread *thread_id1[NMAX], *thread_id2[NMAX];
real Vol_droplet[MAX_DROPLET], Dia_droplet[MAX_DROPLET];
Thread **pt,**pt2;

d = Get_Domain(1);

/* initialization */

thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
C_UDMI(c,t,0)=0;
}
end_c_loop(c,t)
}

/* droplet counting */

thread_loop_c(t,d)
{
pt = THREAD_SUB_THREADS(t);

begin_c_loop(c,t)
{
Vol_droplet[N_droplet]=0.0;
if(C_VOF(c,pt[PHASE_INDEX])>INTERFACE_VOF && C_UDMI(c,t,0)==0)
{

C_UDMI(c,t,0)=N_droplet+1;
Vol_droplet[N_droplet] += C_VOLUME(c,t)*C_VOF(c,pt[PHASE_INDEX]);

N_search=1;
cell_id1[0]=c;
thread_id1[0]=t;

do
{
n_child= 0;
for(i=0; i<N_search; i++)
{
c_face_loop(cell_id1, thread_id1, n)
{
f = C_FACE(cell_id1, thread_id1, n);
tf = C_FACE_THREAD(cell_id1, thread_id1, n);

c0=F_C0(f,tf);
t0=THREAD_T0(tf);
if (c0==cell_id1 && THREAD_T1(tf) != NULL)
{
c0=F_C1(f,tf);
t0=THREAD_T1(tf);
}

pt2 = THREAD_SUB_THREADS(t0);
if(C_VOF(c0,pt2[PHASE_INDEX])>INTERFACE_VOF && C_UDMI(c0,t0,0)==0)
{
C_UDMI(c0,t0,0)=N_droplet+1;
cell_id2[n_child]=c0;
thread_id2[n_child]=t0;
Vol_droplet[N_droplet] += C_VOLUME(c0,t0)*C_VOF(c0,pt2[PHASE_INDEX]);
n_child += 1;
if((n_child-1)==NMAX)
{
Message("Please increase NMAX!! \n");
exit(0);
}
}
}
}

N_search=n_child;
for(i=0; i<NMAX; i++)
{
cell_id1=cell_id2;
thread_id1=thread_id2;
cell_id2=0;
thread_id2=NULL;
}
} while(N_search>0);


N_droplet += 1;
if((N_droplet-1)==MAX_DROPLET)
{
Message("Please increase MAX_DROPLET in the udf!! \n");
exit(0);
}
}
}
end_c_loop(c,t)
}

Message("\n\n-------------------------------------\n");
Message("Total number of droplets: %d\n",N_droplet );
Message("-------------------------------------\n\n");
if(N_droplet!=0)Message(" ID DIAMETER(m) \n");

for(i=0; i<N_droplet; i++)
{
if(ND_ND==3)Dia_droplet=2.0*pow(0.75*Vol_droplet/M_PI,0.333333333) ;
if(ND_ND==2)Dia_droplet=2.0*pow(Vol_droplet/M_PI,0.5) ;
Message(" %d %g\n",i+1,Dia_droplet);
}
}




/*

This udf will allow user to count the number of droplets in a VOF simulation,
you can also get droplets' statistics if you want.

This UDF is written by Genong Li @ FLUENT
please report any bug to gnl@fluent.com

Feb. 9, 2007

NOTE:
(1) it can be used in 2D or 3D.
(2) it is recommended to run in serial, but it can be run in parallel as well. Any droplet straddles the
partition interface will be counted as two separate droplets though.
(3) user provide "PHASE_INDEX" and "INTERFACE_VOF" as inputs.
(4) set one UDM to use this udf, the droplet # is saved in the UDM0.
(5) Any continuous liquid region will be counted as a droplet. User may want to filter out the liquid pool
either in the udf or remove from the output.
(6) procedures to run the udf.
a: read in your case and data file.
b: define one udm.
c: run the simulation for 1 time step. THAT WILL ALLOCTE THE NEEDED MEMORY FOR THE UDM.
d: comiple this udf, hook it up and execute it.

*/


#include "udf.h"

#define PHASE_INDEX 1 /* droplet phase index 0 if it is the primary phase */
#define INTERFACE_VOF 0.5 /* threashold of VOF of the droplet phase at the interface */
#define NMAX 10000 /* Maximum number of out-layer cells within a droplet. increase this # if needed */
#define MAX_DROPLET 1000000 /* Maximum number of droplets, increase this # if needed */

DEFINE_ON_DEMAND(on_demand_size_distribution_vof)
{
Domain *d;
Thread *t, *t0;
cell_t c, c0;
face_t f;
Thread *tf;
int i,n,n_child,N_search;
int N_droplet=0;

cell_t cell_id1[NMAX], cell_id2[NMAX];
Thread *thread_id1[NMAX], *thread_id2[NMAX];
real Vol_droplet[MAX_DROPLET], Dia_droplet[MAX_DROPLET];
Thread **pt,**pt2;

d = Get_Domain(1);

/* initialization */

thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
C_UDMI(c,t,0)=0;
}
end_c_loop(c,t)
}

/* droplet counting */

thread_loop_c(t,d)
{
pt = THREAD_SUB_THREADS(t);

begin_c_loop(c,t)
{
Vol_droplet[N_droplet]=0.0;
if(C_VOF(c,pt[PHASE_INDEX])>INTERFACE_VOF && C_UDMI(c,t,0)==0)
{

C_UDMI(c,t,0)=N_droplet+1;
Vol_droplet[N_droplet] += C_VOLUME(c,t)*C_VOF(c,pt[PHASE_INDEX]);

N_search=1;
cell_id1[0]=c;
thread_id1[0]=t;

do
{
n_child= 0;
for(i=0; i<N_search; i++)
{
c_face_loop(cell_id1, thread_id1, n)
{
f = C_FACE(cell_id1, thread_id1, n);
tf = C_FACE_THREAD(cell_id1, thread_id1, n);

c0=F_C0(f,tf);
t0=THREAD_T0(tf);
if (c0==cell_id1 && THREAD_T1(tf) != NULL)
{
c0=F_C1(f,tf);
t0=THREAD_T1(tf);
}

pt2 = THREAD_SUB_THREADS(t0);
if(C_VOF(c0,pt2[PHASE_INDEX])>INTERFACE_VOF && C_UDMI(c0,t0,0)==0)
{
C_UDMI(c0,t0,0)=N_droplet+1;
cell_id2[n_child]=c0;
thread_id2[n_child]=t0;
Vol_droplet[N_droplet] += C_VOLUME(c0,t0)*C_VOF(c0,pt2[PHASE_INDEX]);
n_child += 1;
if((n_child-1)==NMAX)
{
Message("Please increase NMAX!! \n");
exit(0);
}
}
}
}

N_search=n_child;
for(i=0; i<NMAX; i++)
{
cell_id1=cell_id2;
thread_id1=thread_id2;
cell_id2=0;
thread_id2=NULL;
}
} while(N_search>0);


N_droplet += 1;
if((N_droplet-1)==MAX_DROPLET)
{
Message("Please increase MAX_DROPLET in the udf!! \n");
exit(0);
}
}
}
end_c_loop(c,t)
}

Message("\n\n-------------------------------------\n");
Message("Total number of droplets: %d\n",N_droplet );
Message("-------------------------------------\n\n");
if(N_droplet!=0)Message(" ID DIAMETER(m) \n");

for(i=0; i<N_droplet; i++)
{
if(ND_ND==3)Dia_droplet=2.0*pow(0.75*Vol_droplet/M_PI,0.333333333) ;
if(ND_ND==2)Dia_droplet=2.0*pow(Vol_droplet/M_PI,0.5) ;
Message(" %d %g\n",i+1,Dia_droplet);
}
}

44
This solution contains a suggested procedure to converge highly compressible flow cases with the segregated solver.
-use incompressible (consant density)
-use default limits (Solver-> Controls->Limits)
-use default discretization and underrelaxations (Solve->Controls->Solution)
-use default Multigrid Solver settings (Solve ->Controls->Multigrid)
-initialize at average pressure
-iterate to converge (may change URF)

-change to ideal-gas law
-Report->Volume Integrals
Take volume-avage of static pressure
-Solve->Initialize->Patch
Patch pressure ONLY to the average value.
-iterate
It should converge nicely.
-you may continue with 2nd-order flow

45
Up to what Reynolds number can the flow over a sphere be modeled as axisymmetric?
Studies have shown that for Re < 20 (Re based on sphere diameter), there is no separation and the flow is referred to as creeping flow. Taneda's paper determined that separation from the rear of the sphere occurs at Re ~ 24 and results in the generation of an axisymmetric vortex ring. At Reynolds numbers between 24 and approximately 210, the flow is separated, steady, axisymmetric and topologically similar. In the range of 210 < Re <270, the flow becomes non-axisymmetric as the ring-vortex shifts, however this wake was observed to remain steady. For Re > 280, hairpin-shaped vortices are periodically shed from the sphere to form a completely laminar wake. Hence, up to Re=210, one can model the flow over sphere as axisymmetric.

Ref: S. Taneda, Experimental Investigations of the Wake Behind a Sphere at Low Reynolds Numbers, Journal of Physics, Japan, Vol. 11, No. 10, 1956, pp. 1104-1108.

Pages: 1 2 [3] 4 5 ... 11