// Parameters

// Reynolds number
Re 100;    

// solid fraction
sf        0.201;

// number of cells per sphere diameter (blockmesh)
ncell_D   6;

nu          1;  // kinematic viscosity
rhoFluid    1;  // fluid density

D           1; // sphere diameter

// snappy settings
nCellsBetweenLevels  4; 
surfLevel            2;
gapLevel             3; 

// Calculations
r     #eval "$D/2"; // radius

// domain size from the solid fraction
Vsphere #calc "4*M_PI*pow($r,3)/3"; 
Vdomain #eval "$Vsphere/$sf"; 
Ldomain #eval "cbrt($Vdomain)";
Cmin    #eval "-0.5*$Ldomain";
Cmax    #eval "0.5*$Ldomain"; 

vf      #eval "1-$sf"; // void fraction  
Ubar    #eval "$Re*$nu/$r";  // superficial velocity
Uint    #eval "$Ubar/$vf";   // interstitial velocity

ncell #eval "ceil(($Ldomain)/$D)*$ncell_D"; 

// residual control
re_control      #eval "($Re < 100) ? 1e-6 : 1e-5";

// reference point
xref #eval "-0.49*$Ldomain"; 
yref #eval "-0.49*$Ldomain";
zref #eval "-0.49*$Ldomain";
