为了方便,写了这个代码就能计算不同case的进口放入多少parcel了。这只针对MPPIC的粗粒化。
%Calculate parcel number to insert
%Remember manually change location and method(column or others)
%input
caseinput ='Input which case of MIP (120 or 350):';
casename = input(caseinput);
graininginput ='Input how many particles in one parcel(8000000 or others):';
grainingnumber = input(graininginput);
timestepinput = 'Input time step of calculation in openFOAM(units:s):';
timestep = input(timestepinput);
%constants
rhos = 1500; %kg/m3
dp = 65e-6; %m
Vp = 4/3*pi*(dp/2)^3; %m3
mp = Vp*rhos; %kg per particle
if casename == 120
Fc = (803+20)*1000/3600; %kg/s
%catalyst mass flow rate, including two inlets, From Lu et al,2013
Fc_step = Fc*timestep; %mass flow per time step
Num = Fc_step/(mp*grainingnumber);
fprintf('case is %d\n',casename)
fprintf('Number of parcels to insert per time step is %d\n',floor(Num))
elseif casename == 350
Fc = (2000)*1000/3600; %kg/s
%catalyst mass flow rate, according to factory, 2000-2400ton/h
Fc_step = Fc*timestep; %mass flow per time step
Num = Fc_step/(mp*grainingnumber);
fprintf('case is %d\n',casename)
fprintf('Number of parcels to insert per time step is %d\n',floor(Num))
else
fprintf('case ERROR, it should be 120 or 350\n')
end