Ex. 1: Minimum Fluidization¶
In this first simple example, we’ll use a pre-defined MFiX case contained in the GUI to examine some of the MFiX-Nodeworks interactive features by tracing out a \(U_{mf}\) curve.
Create MFiX case¶
First enter your local MFiX environment and launch a new instance
mfix -n
.Navigate to the
New
pane in theFile Menu
and select the caseFluidBed_2D
, give the project name and location and hitOK
to create the case.In order to trace out \(U_{mf}\), we’ll need to adjust the inlet velocity. Although we could just find the MFiX intrinsic variable name in the Nodeworks dictionary, let’s give it something more identifiable. Navigate to the
Boundary conditions
pane, and select the region named Bottom Inlet. Right click on theY-axial velocity
entry, selectCreate Parameter
and give the inlet velocity a meaningful name. In the following, we’ll name it inflow.Now, we need to create a monitor to record the pressure drop in the bed. We want to compute the averaged the bed gas-phase pressure near, but not at, the inlet. First, in the
Regions
pane, click to add a new region. We’ll call this region dy1, which will range inX
fromxmin
toxmax
and inY
from 0.01 to 0.01, i.e., uniform at one vertical grid spacing \(\Delta_y\). The case is 2-D so theZ
range of the region can be left at zero.Now we can go to the
Monitors
pane, click the button to create a monitor. We’ll set the monitor type to average then highlight the dy1 region we just created and hitOK
. Set theType
toAverage
and theFilename base
to DPbed. The defaultWrite interval
is likely sufficient, but we’ll reduce it to 0.01 (s) for slightly more temporal resolution. At a minimum, make sure to checkPressure
as the monitor data to write.Before moving to nodeworks make sure to save the case. If running the GUI without a distributed default solver, we recommend also building a project solver at this time.
Sweep parameter space¶
Now that we have a base case, we can perform a parameter with the surrogate modeling and analysis tools available in Nodeworks. In this example, we just have a simple 1-D parameter space in the parameterized inflow variable. However, the general procedure can be followed for more complex sampling of higher-dimensional parameter spaces. To begin, navigate to the
Nodeworks
tab in the bottom toolbar to open up a blank Nodeworks worksheet.Right click on the sheet and add a
Design of Experiments
node from theSurrogate Modeling and Analysis
node collection in the node library.Click in the
Variable
tab to add a new variable.Now, we want to vary the gas inlet velocity which was parameterized as inflow or your user specific name. Click on the
variable
entry and type the parameterized variable name. You should see the variable appear in the tab-completion drop down menu as you type.(Optional) Label the
units
as (m/s).Now we need to determine how many points (or samples) to run and over what range. We’ll sweep from zero (exclusively) to 0.20 (m/s), by intervals of 0.01 m/s. Set
from
to 0.01,to
to 0.12 andlevels
to 10.Now navigate to the
Design
tab. Set theMethod
to factorial and check theUse variable specific levels
option. Alternatively, the global levels could be entered here on theDesign
tab. Click theBuild
button to generate the samples and verify by the table entries or in thePlot
tab that the desired points are set.Navigate to the
Run
tab and set theprefix
of the subdirectories to umf. ClickOver-Write
to create the subdirectories, each containing an individual .mfx file. You should notice messages in the console window indicating that the twelve .mfx files have been exported from the master file (base case).Now we are ready to run the jobs. Click on the
Run
button and select either your distributed default mfixsolver or local project build and then clickRun
in theRun solver
pop-up window. You should notices additional messages in the console window announcing running jobs.
Warning
In some distributions, Nodeworks can not determine the job ID leaving the MFiX server
waiting for pid
. If this occurs, please manually check if jobs are running and when
they have completed. Additionally in Step below use the Output Selection
option
All Runs
.
Determine \(U_{mf}\)¶
After the jobs have completed, right click on the Nodeworks worksheet and add a
Monitor Reader
node from theMFIX
collection in the node library. Set theMonitor
to the DPbed monitor we created previously and theVariable
to p_g. We will neglect the first 1 (s) of simulation as transient data and average in timeFrom
1To
2 (s). Set the dataReducer
to mean.Add a
Range
node from the numpy collection in the node library. Set thestart
,stop
andstep
to 0.02, 0.21 and 0.02, respectively.Add a
Plot
node from thematplotlib
collection in the node library.Connect the nodes. Set the
Output Selection
to completed or all runs and connect theSelected Output
terminal of the DOE node to thepath to project(s)
terminal of theMonitor Reader
node. Connect thearray
terminal of theMonitor Reader
to they
and the range terminal to thex
terminal of thePlot
node.Finally, press to run the sheet and generate the \(U_{mf}\) curve as shown below, predicting a value of approximately 10 (cm/s).
Note
As is, the bed pressure is not a pressure drop as the outlet (atmospheric) pressure
is included. There are several ways to remove the outlet pressure, one of which would
be to create a second monitor near the outlet. However, since the outlet pressure is
a constant across all runs, this can be handled in Nodeworks by adding a Subtract
node–make sure to use the numpy version–and a Float
node with a value of the outlet
boundary condition of 101325 Pa. Connect the monitor then the float to the subtract
node and then the subtract node to the plot node in order to arrive at the Umf plot
shown above.