/*
 * airlift_loop_reactor.java
 */

import com.comsol.model.*;
import com.comsol.model.util.*;

/** Model exported on May 15 2026, 11:38 by COMSOL 6.4.0.421. */
public class airlift_loop_reactor {

  public static Model run() {
    Model model = ModelUtil.create("Model");

//    From the File menu, choose New.
//    In the New window, click Model Wizard.
//    In the Model Wizard window, click 3D.
//    In the Select Physics tree, select Fluid Flow > Multiphase Flow > Bubbly Flow > Bubbly Flow, Turbulent Flow > Bubbly Flow, k-ε (bf).
//    Click Add.
//    Click Study.
//    In the Select Study tree, select General Studies > Time Dependent.
//    Click Done.

    model.component().create("comp1", true);

    model.component("comp1").geom().create("geom1", 3);
    model.component("comp1").geom("geom1").geomRep("comsol");

    model.component("comp1").mesh().create("mesh1");
    model.component("comp1").mesh("mesh1").contribute("geom/detail", true);

    model.component("comp1").physics().create("bf", "BubblyFlowkeps", "geom1");

    model.study().create("std1");
    model.study("std1").create("time", "Transient");

//    First, define some model parameters.
//    In the Model Builder window, under Global Definitions, click Parameters 1.
//    In the Settings window for Parameters, locate the Parameters section.
//    In the table, enter the following settings:

    model.param().set("H", "1.75[m]");
    model.param().descr("H", "Reactor height");
    model.param().set("W", "0.5[m]");
    model.param().descr("W", "Reactor width");
    model.param().set("T", "0.08[m]");
    model.param().descr("T", "Reactor thickness");
    model.param().set("d_b", "3e-3[m]");
    model.param().descr("d_b", "Bubble diameter");
    model.param().set("R", "0.02[m]");
    model.param().descr("R", "Frit radius");
    model.param().set("L", "0.16[m]");
    model.param().descr("L", "Width of riser and downcomer channels");
    model.param().set("V_in", "0.015[m/s]");
    model.param().descr("V_in", "Inlet velocity");
    model.param().set("Cw", "5e4[kg/(m^3*s)]");
    model.param().descr("Cw", "Slip-velocity proportionality constant");
    model.param().set("rhog_in", "0.9727[kg/(m^3)]");
    model.param().descr("rhog_in", "Gas density at inlet");

//    Define a step function to be used when ramping up the inlet gas flux as a function of time.
//    In the Home toolbar, click Functions and choose Global > Step.

    model.func().create("step1", "Step");

//    In the Settings window for Step, locate the Parameters section.
//    In the Location text field, type 5.

    model.func("step1").set("location", 5);

//    Click to expand the Smoothing section.
//    In the Size of transition zone text field, type 10.

    model.func("step1").set("smooth", 10);

//    Click Plot.

    model.func("step1").set("plotlowerlimit", -10);
    model.func("step1").set("plotupperlimit", 20);

//    Create the geometry. To simplify this step, insert a prepared geometry sequence.
//    In the Geometry toolbar, click Insert Sequence and choose Insert Sequence.

    model.component("comp1").geom("geom1").insertFile("airlift_loop_reactor_geom_sequence.mph", "geom1");

//    Browse to the model's Application Library folder and double-click the file airlift_loop_reactor_geom_sequence.mph.
//    Full geometry instructions can be found at the end of the document.
//    In the Geometry toolbar, click Build All.

    model.component("comp1").geom("geom1").run("fin");

//    In the Model Builder window, under Component 1 (comp1), click Geometry 1.
//    Hold down the left mouse button and drag in the <l>Graphics</l> window to rotate the geometry. Similarly, use the right mouse button to translate the geometry and the middle button to zoom.
//    Now pick up the materials from the Material Library.
//    In the Materials toolbar, click Add Material to open the Add Material window.
//    In the tree, select Built-in > Air.
//    Click Add to Component in the window toolbar.

    model.component("comp1").material().create("mat1", "Common");
    model.component("comp1").material("mat1").propertyGroup("def").func().create("eta", "Piecewise");
    model.component("comp1").material("mat1").propertyGroup("def").func().create("Cp", "Piecewise");
    model.component("comp1").material("mat1").propertyGroup("def").func().create("rho", "Analytic");
    model.component("comp1").material("mat1").propertyGroup("def").func().create("k", "Piecewise");
    model.component("comp1").material("mat1").propertyGroup("def").func().create("cs", "Analytic");
    model.component("comp1").material("mat1").propertyGroup("def").func().create("an1", "Analytic");
    model.component("comp1").material("mat1").propertyGroup("def").func().create("an2", "Analytic");
    model.component("comp1").material("mat1").propertyGroup()
         .create("RefractiveIndex", "RefractiveIndex", "Refractive index");
    model.component("comp1").material("mat1").propertyGroup()
         .create("NonlinearModel", "NonlinearModel", "Nonlinear model");
    model.component("comp1").material("mat1").propertyGroup().create("idealGas", "idealGas", "Ideal gas");
    model.component("comp1").material("mat1").propertyGroup("idealGas").func().create("Cp", "Piecewise");
    model.component("comp1").material("mat1").label("Air");
    model.component("comp1").material("mat1").set("family", "air");
    model.component("comp1").material("mat1").propertyGroup("def").func("eta").set("arg", "T");
    model.component("comp1").material("mat1").propertyGroup("def").func("eta")
         .set("pieces", new String[][]{{"200.0", "1600.0", "-8.38278E-7+8.35717342E-8*T^1-7.69429583E-11*T^2+4.6437266E-14*T^3-1.06585607E-17*T^4"}});
    model.component("comp1").material("mat1").propertyGroup("def").func("eta").set("argunit", "K");
    model.component("comp1").material("mat1").propertyGroup("def").func("eta").set("fununit", "Pa*s");
    model.component("comp1").material("mat1").propertyGroup("def").func("Cp").set("arg", "T");
    model.component("comp1").material("mat1").propertyGroup("def").func("Cp")
         .set("pieces", new String[][]{{"200.0", "1600.0", "1047.63657-0.372589265*T^1+9.45304214E-4*T^2-6.02409443E-7*T^3+1.2858961E-10*T^4"}});
    model.component("comp1").material("mat1").propertyGroup("def").func("Cp").set("argunit", "K");
    model.component("comp1").material("mat1").propertyGroup("def").func("Cp").set("fununit", "J/(kg*K)");
    model.component("comp1").material("mat1").propertyGroup("def").func("rho")
         .set("expr", "pA*0.02897/R_const[K*mol/J]/T");
    model.component("comp1").material("mat1").propertyGroup("def").func("rho").set("args", new String[]{"pA", "T"});
    model.component("comp1").material("mat1").propertyGroup("def").func("rho").set("fununit", "kg/m^3");
    model.component("comp1").material("mat1").propertyGroup("def").func("rho")
         .set("argunit", new String[]{"Pa", "K"});
    model.component("comp1").material("mat1").propertyGroup("def").func("rho")
         .set("plotaxis", new String[]{"off", "on"});
    model.component("comp1").material("mat1").propertyGroup("def").func("rho")
         .set("plotfixedvalue", new String[]{"101325", "273.15"});
    model.component("comp1").material("mat1").propertyGroup("def").func("rho")
         .set("plotargs", new String[][]{{"pA", "101325", "101325"}, {"T", "273.15", "293.15"}});
    model.component("comp1").material("mat1").propertyGroup("def").func("k").set("arg", "T");
    model.component("comp1").material("mat1").propertyGroup("def").func("k")
         .set("pieces", new String[][]{{"200.0", "1600.0", "-0.00227583562+1.15480022E-4*T^1-7.90252856E-8*T^2+4.11702505E-11*T^3-7.43864331E-15*T^4"}});
    model.component("comp1").material("mat1").propertyGroup("def").func("k").set("argunit", "K");
    model.component("comp1").material("mat1").propertyGroup("def").func("k").set("fununit", "W/(m*K)");
    model.component("comp1").material("mat1").propertyGroup("def").func("cs")
         .set("expr", "sqrt(1.4*R_const[K*mol/J]/0.02897*T)");
    model.component("comp1").material("mat1").propertyGroup("def").func("cs").set("args", new String[]{"T"});
    model.component("comp1").material("mat1").propertyGroup("def").func("cs").set("fununit", "m/s");
    model.component("comp1").material("mat1").propertyGroup("def").func("cs").set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("def").func("cs")
         .set("plotfixedvalue", new String[]{"273.15"});
    model.component("comp1").material("mat1").propertyGroup("def").func("cs")
         .set("plotargs", new String[][]{{"T", "273.15", "373.15"}});
    model.component("comp1").material("mat1").propertyGroup("def").func("an1").set("funcname", "alpha_p");
    model.component("comp1").material("mat1").propertyGroup("def").func("an1")
         .set("expr", "-1/rho(pA,T)*d(rho(pA,T),T)");
    model.component("comp1").material("mat1").propertyGroup("def").func("an1").set("args", new String[]{"pA", "T"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an1").set("fununit", "1/K");
    model.component("comp1").material("mat1").propertyGroup("def").func("an1")
         .set("argunit", new String[]{"Pa", "K"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an1")
         .set("plotaxis", new String[]{"off", "on"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an1")
         .set("plotfixedvalue", new String[]{"101325", "273.15"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an1")
         .set("plotargs", new String[][]{{"pA", "101325", "101325"}, {"T", "273.15", "373.15"}});
    model.component("comp1").material("mat1").propertyGroup("def").func("an2").set("funcname", "muB");
    model.component("comp1").material("mat1").propertyGroup("def").func("an2").set("expr", "0.6*eta(T)");
    model.component("comp1").material("mat1").propertyGroup("def").func("an2").set("args", new String[]{"T"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an2").set("fununit", "Pa*s");
    model.component("comp1").material("mat1").propertyGroup("def").func("an2").set("argunit", new String[]{"K"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an2")
         .set("plotfixedvalue", new String[]{"200"});
    model.component("comp1").material("mat1").propertyGroup("def").func("an2")
         .set("plotargs", new String[][]{{"T", "200", "1600"}});
    model.component("comp1").material("mat1").propertyGroup("def").set("thermalexpansioncoefficient", "");
    model.component("comp1").material("mat1").propertyGroup("def").set("molarmass", "");
    model.component("comp1").material("mat1").propertyGroup("def").set("bulkviscosity", "");
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("thermalexpansioncoefficient", new String[]{"alpha_p(pA,T)", "0", "0", "0", "alpha_p(pA,T)", "0", "0", "0", "alpha_p(pA,T)"});
    model.component("comp1").material("mat1").propertyGroup("def").set("molarmass", "0.02897[kg/mol]");
    model.component("comp1").material("mat1").propertyGroup("def").set("bulkviscosity", "muB(T)");
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("relpermeability", new String[]{"1", "0", "0", "0", "1", "0", "0", "0", "1"});
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("relpermittivity", new String[]{"1", "0", "0", "0", "1", "0", "0", "0", "1"});
    model.component("comp1").material("mat1").propertyGroup("def").set("dynamicviscosity", "eta(T)");
    model.component("comp1").material("mat1").propertyGroup("def").set("ratioofspecificheat", "1.4");
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("electricconductivity", new String[]{"0[S/m]", "0", "0", "0", "0[S/m]", "0", "0", "0", "0[S/m]"});
    model.component("comp1").material("mat1").propertyGroup("def").set("heatcapacity", "Cp(T)");
    model.component("comp1").material("mat1").propertyGroup("def").set("density", "rho(pA,T)");
    model.component("comp1").material("mat1").propertyGroup("def")
         .set("thermalconductivity", new String[]{"k(T)", "0", "0", "0", "k(T)", "0", "0", "0", "k(T)"});
    model.component("comp1").material("mat1").propertyGroup("def").set("soundspeed", "cs(T)");
    model.component("comp1").material("mat1").propertyGroup("def").addInput("temperature");
    model.component("comp1").material("mat1").propertyGroup("def").addInput("pressure");
    model.component("comp1").material("mat1").propertyGroup("RefractiveIndex")
         .set("n", new String[]{"1", "0", "0", "0", "1", "0", "0", "0", "1"});
    model.component("comp1").material("mat1").propertyGroup("NonlinearModel").set("BA", "def.gamma-1");
    model.component("comp1").material("mat1").propertyGroup("idealGas").func("Cp").label("Piecewise 2");
    model.component("comp1").material("mat1").propertyGroup("idealGas").func("Cp").set("arg", "T");
    model.component("comp1").material("mat1").propertyGroup("idealGas").func("Cp")
         .set("pieces", new String[][]{{"200.0", "1600.0", "1047.63657-0.372589265*T^1+9.45304214E-4*T^2-6.02409443E-7*T^3+1.2858961E-10*T^4"}});
    model.component("comp1").material("mat1").propertyGroup("idealGas").func("Cp").set("argunit", "K");
    model.component("comp1").material("mat1").propertyGroup("idealGas").func("Cp").set("fununit", "J/(kg*K)");
    model.component("comp1").material("mat1").propertyGroup("idealGas").set("Rs", "R_const/Mn");
    model.component("comp1").material("mat1").propertyGroup("idealGas").set("heatcapacity", "Cp(T)");
    model.component("comp1").material("mat1").propertyGroup("idealGas").set("ratioofspecificheat", "1.4");
    model.component("comp1").material("mat1").propertyGroup("idealGas").set("molarmass", "0.02897[kg/mol]");
    model.component("comp1").material("mat1").propertyGroup("idealGas").addInput("temperature");
    model.component("comp1").material("mat1").propertyGroup("idealGas").addInput("pressure");
    model.component("comp1").material("mat1").materialType("nonSolid");

//    In the tree, select Built-in > Water, liquid.
//    Click Add to Component in the window toolbar.

    model.component("comp1").material().create("mat2", "Common");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("eta", "Piecewise");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("Cp", "Piecewise");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("rho", "Piecewise");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("k", "Piecewise");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("cs", "Interpolation");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("an1", "Analytic");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("an2", "Analytic");
    model.component("comp1").material("mat2").propertyGroup("def").func().create("an3", "Analytic");
    model.component("comp1").material("mat2").label("Water, liquid");
    model.component("comp1").material("mat2").set("family", "water");
    model.component("comp1").material("mat2").propertyGroup("def").func("eta").set("arg", "T");
    model.component("comp1").material("mat2").propertyGroup("def").func("eta")
         .set("pieces", new String[][]{{"273.15", "413.15", "1.3799566804-0.021224019151*T^1+1.3604562827E-4*T^2-4.6454090319E-7*T^3+8.9042735735E-10*T^4-9.0790692686E-13*T^5+3.8457331488E-16*T^6"}, {"413.15", "553.75", "0.00401235783-2.10746715E-5*T^1+3.85772275E-8*T^2-2.39730284E-11*T^3"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("eta").set("argunit", "K");
    model.component("comp1").material("mat2").propertyGroup("def").func("eta").set("fununit", "Pa*s");
    model.component("comp1").material("mat2").propertyGroup("def").func("Cp").set("arg", "T");
    model.component("comp1").material("mat2").propertyGroup("def").func("Cp")
         .set("pieces", new String[][]{{"273.15", "553.75", "12010.1471-80.4072879*T^1+0.309866854*T^2-5.38186884E-4*T^3+3.62536437E-7*T^4"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("Cp").set("argunit", "K");
    model.component("comp1").material("mat2").propertyGroup("def").func("Cp").set("fununit", "J/(kg*K)");
    model.component("comp1").material("mat2").propertyGroup("def").func("rho").set("arg", "T");
    model.component("comp1").material("mat2").propertyGroup("def").func("rho").set("smooth", "contd1");
    model.component("comp1").material("mat2").propertyGroup("def").func("rho")
         .set("pieces", new String[][]{{"273.15", "293.15", "0.000063092789034*T^3-0.060367639882855*T^2+18.9229382407066*T-950.704055329848"}, {"293.15", "373.15", "0.000010335053319*T^3-0.013395065634452*T^2+4.969288832655160*T+432.257114008512"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("rho").set("argunit", "K");
    model.component("comp1").material("mat2").propertyGroup("def").func("rho").set("fununit", "kg/m^3");
    model.component("comp1").material("mat2").propertyGroup("def").func("k").set("arg", "T");
    model.component("comp1").material("mat2").propertyGroup("def").func("k")
         .set("pieces", new String[][]{{"273.15", "553.75", "-0.869083936+0.00894880345*T^1-1.58366345E-5*T^2+7.97543259E-9*T^3"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("k").set("argunit", "K");
    model.component("comp1").material("mat2").propertyGroup("def").func("k").set("fununit", "W/(m*K)");
    model.component("comp1").material("mat2").propertyGroup("def").func("cs")
         .set("table", new String[][]{{"273", "1403"}, 
         {"278", "1427"}, 
         {"283", "1447"}, 
         {"293", "1481"}, 
         {"303", "1507"}, 
         {"313", "1526"}, 
         {"323", "1541"}, 
         {"333", "1552"}, 
         {"343", "1555"}, 
         {"353", "1555"}, 
         {"363", "1550"}, 
         {"373", "1543"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("cs").set("interp", "piecewisecubic");
    model.component("comp1").material("mat2").propertyGroup("def").func("cs").set("fununit", new String[]{"m/s"});
    model.component("comp1").material("mat2").propertyGroup("def").func("cs").set("argunit", new String[]{"K"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an1").set("funcname", "alpha_p");
    model.component("comp1").material("mat2").propertyGroup("def").func("an1").set("expr", "-1/rho(T)*d(rho(T),T)");
    model.component("comp1").material("mat2").propertyGroup("def").func("an1").set("args", new String[]{"T"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an1").set("fununit", "1/K");
    model.component("comp1").material("mat2").propertyGroup("def").func("an1").set("argunit", new String[]{"K"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an1")
         .set("plotfixedvalue", new String[]{"273.15"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an1")
         .set("plotargs", new String[][]{{"T", "273.15", "373.15"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("an2").set("funcname", "gamma_w");
    model.component("comp1").material("mat2").propertyGroup("def").func("an2")
         .set("expr", "1+(T/Cp(T))*(alpha_p(T)*cs(T))^2");
    model.component("comp1").material("mat2").propertyGroup("def").func("an2").set("args", new String[]{"T"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an2").set("fununit", "1");
    model.component("comp1").material("mat2").propertyGroup("def").func("an2").set("argunit", new String[]{"K"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an2")
         .set("plotfixedvalue", new String[]{"273.15"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an2")
         .set("plotargs", new String[][]{{"T", "273.15", "373.15"}});
    model.component("comp1").material("mat2").propertyGroup("def").func("an3").set("funcname", "muB");
    model.component("comp1").material("mat2").propertyGroup("def").func("an3").set("expr", "2.79*eta(T)");
    model.component("comp1").material("mat2").propertyGroup("def").func("an3").set("args", new String[]{"T"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an3").set("fununit", "Pa*s");
    model.component("comp1").material("mat2").propertyGroup("def").func("an3").set("argunit", new String[]{"K"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an3")
         .set("plotfixedvalue", new String[]{"273.15"});
    model.component("comp1").material("mat2").propertyGroup("def").func("an3")
         .set("plotargs", new String[][]{{"T", "273.15", "553.75"}});
    model.component("comp1").material("mat2").propertyGroup("def").set("thermalexpansioncoefficient", "");
    model.component("comp1").material("mat2").propertyGroup("def").set("bulkviscosity", "");
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("thermalexpansioncoefficient", new String[]{"alpha_p(T)", "0", "0", "0", "alpha_p(T)", "0", "0", "0", "alpha_p(T)"});
    model.component("comp1").material("mat2").propertyGroup("def").set("bulkviscosity", "muB(T)");
    model.component("comp1").material("mat2").propertyGroup("def").set("dynamicviscosity", "eta(T)");
    model.component("comp1").material("mat2").propertyGroup("def").set("ratioofspecificheat", "gamma_w(T)");
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("electricconductivity", new String[]{"5.5e-6[S/m]", "0", "0", "0", "5.5e-6[S/m]", "0", "0", "0", "5.5e-6[S/m]"});
    model.component("comp1").material("mat2").propertyGroup("def").set("heatcapacity", "Cp(T)");
    model.component("comp1").material("mat2").propertyGroup("def").set("density", "rho(T)");
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("thermalconductivity", new String[]{"k(T)", "0", "0", "0", "k(T)", "0", "0", "0", "k(T)"});
    model.component("comp1").material("mat2").propertyGroup("def").set("soundspeed", "cs(T)");
    model.component("comp1").material("mat2").propertyGroup("def").addInput("temperature");

//    In the Materials toolbar, click Add Material to close the Add Material window.
//    In the Settings window for Fluid Properties, locate the Materials section.
//    From the Liquid list, select Water, liquid (mat2).

    model.component("comp1").physics("bf").feature("fp1").set("Liquid", "mat2");

//    From the Gas list, select Air (mat1).

    model.component("comp1").physics("bf").feature("fp1").set("Gas", "mat1");

//    Locate the Gas Properties section.
//    From the \[\rho_\textrm{g}\] list, select Calculate from ideal gas law.

    model.component("comp1").physics("bf").feature("fp1").set("rhog_mat", "CalculateFromIdealGasLaw");

//    In the \[d_\textrm{b}\] text field, type d_b.

    model.component("comp1").physics("bf").feature("fp1").set("diamb", "d_b");

//    Locate the Slip Model section.
//    From the Slip model list, select Pressure-drag balance.

    model.component("comp1").physics("bf").feature("fp1").set("SlipModel", "PressureDragBalance");

//    From the Drag coefficient model list, select Large bubbles.

    model.component("comp1").physics("bf").feature("fp1").set("DragCoefficientModel", "LargeBubbles");

//    In the Model Builder window, click Bubbly Flow, k-ε (bf).
//    In the Settings window for Bubbly Flow, k-ε, locate the Physical Model section.
//    Clear the Low gas concentration checkbox.

    model.component("comp1").physics("bf").prop("PhysicalModelProperty").set("LowGasConcentration", false);

//    Locate the Turbulence section.
//    Find the Turbulence model parameters subsection.
//    Select the Edit turbulence model parameters checkbox.

    model.component("comp1").physics("bf").prop("TurbulenceModelProperty").set("editTurbulenceModelParameters", true);

//    In the \[C_{\epsilon}\] text field, type 1.4.

    model.component("comp1").physics("bf").prop("TurbulenceModelProperty").set("C_epsbf", 1.4);

//    In the \[C_{k}\] text field, type 0.6.

    model.component("comp1").physics("bf").prop("TurbulenceModelProperty").set("C_kbf", 0.6);

//    In the Physics toolbar, click Domains and choose Gravity.

    model.component("comp1").physics("bf").create("gr1", "Gravity", 3);

//    Select Domain 1.

    model.component("comp1").physics("bf").feature("gr1").selection().set(1);

//    In the Physics toolbar, click Boundaries and choose Wall.

    model.component("comp1").physics("bf").create("wallbc2", "WallBC", 2);

//    In the Model Builder window, click Gravity 1.
//    In the Settings window for Gravity, locate the Gravity section.
//    Specify the \[\mathbf{g}\] vector as

    model.component("comp1").physics("bf").feature("gr1").set("g", new String[]{"0", "-g_const", "0"});

//    Click the Zoom Extents button in the Graphics toolbar.
//    In the Model Builder window, click Wall 2.
//    Select Boundaries 6, 7.

    model.component("comp1").physics("bf").feature("wallbc2").selection().set(6, 7);

//    In the Settings window for Wall, locate the Gas Boundary Condition section.
//    From the Gas boundary condition list, select Gas flux.

    model.component("comp1").physics("bf").feature("wallbc2").set("GasBoundaryCondition", "GasFlux");

//    In the \[N_{\rho\textrm{g}\phi\textrm{g}}\] text field, type V_in*rhog_in*step1(t[1/s]).

    model.component("comp1").physics("bf").feature("wallbc2").set("Nrhogeff", "V_in*rhog_in*step1(t[1/s])");

//    In the Physics toolbar, click Boundaries and choose Wall.

    model.component("comp1").physics("bf").create("wallbc3", "WallBC", 2);

//    Select Boundary 5.

    model.component("comp1").physics("bf").feature("wallbc3").selection().set(5);

//    In the Settings window for Wall, locate the Liquid Boundary Condition section.
//    From the Liquid boundary condition list, select Slip.

    model.component("comp1").physics("bf").feature("wallbc3").set("LiquidBoundaryCondition", "Slip");

//    Locate the Gas Boundary Condition section.
//    From the Gas boundary condition list, select Gas outlet.

    model.component("comp1").physics("bf").feature("wallbc3").set("GasBoundaryCondition", "GasOutlet");

//    When using gravity it is important to set the initial values of the pressure to hydrostatic conditions.
//    In the Model Builder window, click Initial Values 1.
//    In the Settings window for Initial Values, type g_const*bf.rhol*(1.75-y) in the \[p\] text field.

    model.component("comp1").physics("bf").feature("init1").set("p", "g_const*bf.rhol*(1.75-y)");

//    In the Physics toolbar, click Points and choose Pressure Point Constraint.

    model.component("comp1").physics("bf").create("prpc1", "PressurePointConstraint", 0);

//    Select Point 23.

    model.component("comp1").physics("bf").feature("prpc1").selection().set(23);

//    In the Physics toolbar, click Boundaries and choose Symmetry.

    model.component("comp1").physics("bf").create("sym1", "Symmetry", 2);

//    Select Boundary 4.

    model.component("comp1").physics("bf").feature("sym1").selection().set(4);

//    In the Model Builder window, under Component 1 (comp1), click Mesh 1.
//    In the Settings window for Mesh, locate the Physics-Controlled Mesh section.
//    From the Element size list, select Coarse.

    model.component("comp1").mesh("mesh1").autoMeshSize(6);

//    Right-click Component 1 (comp1) > Mesh 1 and choose Edit Physics-Induced Sequence.

    model.component("comp1").mesh("mesh1").automatic(false);

//    In the Model Builder window, expand the Component 1 (comp1) > Mesh 1 > Boundary Layers 1 node, then click Boundary Layer Properties 1.
//    In the Settings window for Boundary Layer Properties, locate the Layers section.
//    In the Number of layers text field, type 4.

    model.component("comp1").mesh("mesh1").feature("bl1").feature("blp1").set("blnlayers", 4);

//    In the Thickness adjustment factor text field, type 3.

    model.component("comp1").mesh("mesh1").feature("bl1").feature("blp1").set("blhminfact", 3);

//    Click Build All.

    model.component("comp1").mesh("mesh1").run();

//    Click the Zoom Extents button in the Graphics toolbar.
//    In the Model Builder window, under Study 1, click Step 1: Time Dependent.
//    In the Settings window for Time Dependent, locate the Study Settings section.
//    In the Output times text field, type range(0,0.05,1)*30.

    model.study("std1").feature("time").set("tlist", "range(0,0.05,1)*30");

//    From the Tolerance list, select User controlled.

    model.study("std1").feature("time").set("usertol", true);

//    In the Relative tolerance text field, type 0.005.

    model.study("std1").feature("time").set("rtol", 0.005);

//    Measurement data makes it possible to estimate manual scales for velocity and pressure.
//    In the Study toolbar, click Show Default Solver.

    model.study("std1").showAutoSequences("all");

//    In the Model Builder window, expand the Solution 1 (sol1) node.
//    In the Model Builder window, expand the Study 1 > Solver Configurations > Solution 1 (sol1) > Dependent Variables 1 node, then click Pressure (comp1.p).
//    In the Settings window for Field, locate the Scaling section.
//    From the Method list, select Manual.

    model.sol("sol1").feature("v1").feature("comp1_p").set("scalemethod", "manual");

//    In the Scale text field, type 1.7e4.

    model.sol("sol1").feature("v1").feature("comp1_p").set("scaleval", "1.7e4");

//    In the Model Builder window, under Study 1 > Solver Configurations > Solution 1 (sol1) > Dependent Variables 1, click Velocity Field, Liquid Phase (comp1.u).
//    In the Settings window for Field, locate the Scaling section.
//    From the Method list, select Manual.

    model.sol("sol1").feature("v1").feature("comp1_u").set("scalemethod", "manual");

//    In the Scale text field, type 0.5.

    model.sol("sol1").feature("v1").feature("comp1_u").set("scaleval", 0.5);

//    In the Model Builder window, collapse the Solution 1 (sol1) node.
//    In the Model Builder window, right-click Solution 1 (sol1) and choose Run.

    model.sol("sol1").runAll();

    model.result().create("pg1", "PlotGroup3D");
    model.result("pg1").label("Liquid Phase Velocity (bf)");
    model.result("pg1").set("frametype", "spatial");
    model.result("pg1").set("smooth", "internal");
    model.result("pg1").feature().create("mslc1", "Multislice");
    model.result("pg1").feature("mslc1").set("expr", "bf.Ul");
    model.result("pg1").feature("mslc1").set("smooth", "internal");
    model.result("pg1").feature("mslc1").set("data", "parent");
    model.result().create("pg2", "PlotGroup3D");
    model.result("pg2").label("Gas Phase Volume Fraction (bf)");
    model.result("pg2").set("frametype", "spatial");
    model.result("pg2").set("smooth", "internal");
    model.result("pg2").feature().create("mslc1", "Multislice");
    model.result("pg2").feature("mslc1").set("colortable", "Pelagic");
    model.result("pg2").feature("mslc1").set("smooth", "internal");
    model.result("pg2").feature("mslc1").set("data", "parent");
    model.result().create("pg3", "PlotGroup3D");
    model.result("pg3").label("Pressure (bf)");
    model.result("pg3").set("frametype", "spatial");
    model.result("pg3").set("smooth", "internal");
    model.result("pg3").feature().create("surf1", "Surface");
    model.result("pg3").feature("surf1").set("expr", "p");
    model.result("pg3").feature("surf1").set("colortable", "Tectocoris");
    model.result("pg3").feature("surf1").set("colortabletype", "discrete");
    model.result("pg3").feature("surf1").set("bandcount", 25);
    model.result("pg3").feature("surf1").set("smooth", "internal");
    model.result("pg3").feature("surf1").set("data", "parent");
    model.result("pg3").feature("surf1").feature().create("sel1", "Selection");
    model.result("pg3").feature("surf1").feature("sel1").selection().geom("geom1", 2);
    model.result("pg3").feature("surf1").feature("sel1").selection().set(1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13);
    model.result().create("pg4", "PlotGroup3D");
    model.result("pg4").label("Wall Resolution (bf)");
    model.result("pg4").set("frametype", "spatial");
    model.result("pg4").set("smooth", "internal");
    model.result("pg4").feature().create("surf1", "Surface");
    model.result("pg4").feature("surf1").set("expr", "bf.Delta_wPlus");

    return model;
  }

  public static Model run2(Model model) {
    model.result("pg4").feature("surf1").set("smooth", "internal");
    model.result("pg4").feature("surf1").set("data", "parent");
    model.result("pg4").feature("surf1").feature().create("sel1", "Selection");
    model.result("pg4").feature("surf1").feature("sel1").selection().geom("geom1", 2);
    model.result("pg4").feature("surf1").feature("sel1").selection().set(1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13);
    model.result("pg1").run();

//    In the Results toolbar, click More Datasets and choose Surface.

    model.result().dataset().create("surf1", "Surface");

//    Select Boundary 4.

    model.result().dataset("surf1").selection().set(4);

//    In the Settings window for Surface, locate the Parameterization section.
//    From the x- and y-axes list, select xy-plane.

    model.result().dataset("surf1").set("param", "xy");

//    In the Results toolbar, click 2D Plot Group.

    model.result().create("pg5", "PlotGroup2D");
    model.result("pg5").run();

//    Right-click 2D Plot Group 5 and choose Surface.

    model.result("pg5").create("surf1", "Surface");
    model.result("pg5").feature("surf1").set("evaluationsettings", "parent");
    model.result("pg5").run();

//    In the Model Builder window, right-click 2D Plot Group 5 and choose Streamline.

    model.result("pg5").create("str1", "Streamline");
    model.result("pg5").feature("str1").set("evaluationsettings", "parent");

//    In the Settings window for Streamline, locate the Coloring and Style section.
//    Find the Point style subsection.
//    From the Color list, select White.

    model.result("pg5").feature("str1").set("color", "white");

//    Locate the Streamline Positioning section.
//    From the Positioning list, select Uniform density.

    model.result("pg5").feature("str1").set("posmethod", "uniform");

//    In the Density level text field, type 9.7.

    model.result("pg5").feature("str1").set("udensity", 9.7);

//    In the 2D Plot Group 5 toolbar, click Plot.

    model.result("pg5").run();

//    In the Results toolbar, click 2D Plot Group.

    model.result().create("pg6", "PlotGroup2D");
    model.result("pg6").run();

//    Right-click 2D Plot Group 6 and choose Surface.

    model.result("pg6").create("surf1", "Surface");
    model.result("pg6").feature("surf1").set("evaluationsettings", "parent");

//    In the Settings window for Surface, locate the Expression section.
//    In the Expression text field, type bf.muT.

    model.result("pg6").feature("surf1").set("expr", "bf.muT");

//    In the 2D Plot Group 6 toolbar, click Plot.

    model.result("pg6").run();

//    In the Results toolbar, click Table.

    model.result().table().create("tbl1", "Table");

//    In the Settings window for Table, type vl3 in the Label text field.

    model.result().table("tbl1").label("vl3");

//    Locate the Data section.
//    Click Import.
//    Browse to the model's Application Library folder and double-click the file airlift_loop_reactor_vl_no3.txt.

    model.result().table("tbl1").importData("airlift_loop_reactor_vl_no3.txt");

//    In the Results toolbar, click Table.

    model.result().table().create("tbl2", "Table");

//    In the Settings window for Table, type vg3 in the Label text field.

    model.result().table("tbl2").label("vg3");

//    Locate the Data section.
//    Click Import.
//    Browse to the model's Application Library folder and double-click the file airlift_loop_reactor_vg_no3.txt.

    model.result().table("tbl2").importData("airlift_loop_reactor_vg_no3.txt");

//    In the Results toolbar, click Table.

    model.result().table().create("tbl3", "Table");

//    In the Settings window for Table, type vl5 in the Label text field.

    model.result().table("tbl3").label("vl5");

//    Locate the Data section.
//    Click Import.
//    Browse to the model's Application Library folder and double-click the file airlift_loop_reactor_vl_no5.txt.

    model.result().table("tbl3").importData("airlift_loop_reactor_vl_no5.txt");

//    In the Results toolbar, click Table.

    model.result().table().create("tbl4", "Table");

//    In the Settings window for Table, type vg5 in the Label text field.

    model.result().table("tbl4").label("vg5");

//    Locate the Data section.
//    Click Import.
//    Browse to the model's Application Library folder and double-click the file airlift_loop_reactor_vg_no5.txt.

    model.result().table("tbl4").importData("airlift_loop_reactor_vg_no5.txt");

//    In the Results toolbar, click Table.

    model.result().table().create("tbl5", "Table");

//    In the Settings window for Table, type vl7 in the Label text field.

    model.result().table("tbl5").label("vl7");

//    Locate the Data section.
//    Click Import.
//    Browse to the model's Application Library folder and double-click the file airlift_loop_reactor_vl_no7.txt.

    model.result().table("tbl5").importData("airlift_loop_reactor_vl_no7.txt");

//    In the Results toolbar, click Table.

    model.result().table().create("tbl6", "Table");

//    In the Settings window for Table, type vg7 in the Label text field.

    model.result().table("tbl6").label("vg7");

//    Locate the Data section.
//    Click Import.
//    Browse to the model's Application Library folder and double-click the file airlift_loop_reactor_vg_no7.txt.

    model.result().table("tbl6").importData("airlift_loop_reactor_vg_no7.txt");

//    In the Results toolbar, click Table.

    model.result().table().create("tbl7", "Table");

//    In the Settings window for Table, type vl9 in the Label text field.

    model.result().table("tbl7").label("vl9");

//    Locate the Data section.
//    Click Import.
//    Browse to the model's Application Library folder and double-click the file airlift_loop_reactor_vl_no9.txt.

    model.result().table("tbl7").importData("airlift_loop_reactor_vl_no9.txt");

//    In the Results toolbar, click Table.

    model.result().table().create("tbl8", "Table");

//    In the Settings window for Table, type vg9 in the Label text field.

    model.result().table("tbl8").label("vg9");

//    Locate the Data section.
//    Click Import.
//    Browse to the model's Application Library folder and double-click the file airlift_loop_reactor_vg_no9.txt.

    model.result().table("tbl8").importData("airlift_loop_reactor_vg_no9.txt");

//    Define cut lines that correspond to the experimental probe positions.
//    In the Results toolbar, click Cut Line 3D.

    model.result().dataset().create("cln1", "CutLine3D");

//    In the Settings window for Cut Line 3D, type No3 in the Label text field.

    model.result().dataset("cln1").label("No3");

//    Locate the Line Data section.
//    In row Point 1, set y to 0.3.

    model.result().dataset("cln1").setIndex("genpoints", 0.3, 0, 1);

//     and <l>z</l> to <c>0.04</c>.

    model.result().dataset("cln1").setIndex("genpoints", 0.04, 0, 2);

//    In row Point 2, set x to 0.15.

    model.result().dataset("cln1").setIndex("genpoints", 0.15, 1, 0);

//    , <l>y</l> to <c>0.3</c>, and <l>z</l> to <c>0.04</c>.

    model.result().dataset("cln1").setIndex("genpoints", 0.3, 1, 1);
    model.result().dataset("cln1").setIndex("genpoints", 0.04, 1, 2);

//    From the Snapping list, select Snap to closest boundary.

    model.result().dataset("cln1").set("snapping", "boundary");

//    Right-click No3 and choose Duplicate.

    model.result().dataset().duplicate("cln2", "cln1");

//    In the Settings window for Cut Line 3D, type No5 in the Label text field.

    model.result().dataset("cln2").label("No5");

//    Locate the Line Data section.
//    In row Point 1, set y to 0.65.

    model.result().dataset("cln2").setIndex("genpoints", 0.65, 0, 1);

//    In row Point 2, set y to 0.65.

    model.result().dataset("cln2").setIndex("genpoints", 0.65, 1, 1);

//    Right-click No5 and choose Duplicate.

    model.result().dataset().duplicate("cln3", "cln2");

//    In the Settings window for Cut Line 3D, type No7 in the Label text field.

    model.result().dataset("cln3").label("No7");

//    Locate the Line Data section.
//    In row Point 1, set y to 1.25.

    model.result().dataset("cln3").setIndex("genpoints", 1.25, 0, 1);

//    In row Point 2, set y to 1.25.

    model.result().dataset("cln3").setIndex("genpoints", 1.25, 1, 1);

//    Right-click No7 and choose Duplicate.

    model.result().dataset().duplicate("cln4", "cln3");

//    In the Settings window for Cut Line 3D, type No9 in the Label text field.

    model.result().dataset("cln4").label("No9");

//    Locate the Line Data section.
//    In row Point 1, set y to 1.65.

    model.result().dataset("cln4").setIndex("genpoints", 1.65, 0, 1);

//    In row Point 2, set y to 1.65.

    model.result().dataset("cln4").setIndex("genpoints", 1.65, 1, 1);

//    In the Results toolbar, click 1D Plot Group.

    model.result().create("pg7", "PlotGroup1D");
    model.result("pg7").run();

//    In the Settings window for 1D Plot Group, type Probe position #3 in the Label text field.

    model.result("pg7").label("Probe position #3");

//    Locate the Data section.
//    From the Dataset list, select No3.

    model.result("pg7").set("data", "cln1");

//    From the Time selection list, select Last.

    model.result("pg7").setIndex("looplevelinput", "last", 0);

//    Click to expand the Title section.
//    From the Title type list, select Manual.

    model.result("pg7").set("titletype", "manual");

//    In the Title text area, type Vertical liquid and gas velocities at probe position #3.

    model.result("pg7").set("title", "Vertical liquid and gas velocities at probe position #3");

//    Right-click Probe position #3 and choose Line Graph.

    model.result("pg7").create("lngr1", "LineGraph");
    model.result("pg7").feature("lngr1").set("markerpos", "datapoints");
    model.result("pg7").feature("lngr1").set("linewidth", "preference");
    model.result("pg7").feature("lngr1").set("evaluationsettings", "parent");

//    In the Settings window for Line Graph, locate the y-Axis Data section.
//    In the Expression text field, type v.

    model.result("pg7").feature("lngr1").set("expr", "v");

//    Click to expand the Coloring and Style section.
//    From the Color list, select Blue.

    model.result("pg7").feature("lngr1").set("linecolor", "blue");

//    Click to expand the Legends section.
//    Select the Show legends checkbox.

    model.result("pg7").feature("lngr1").set("legend", true);

//    From the Legends list, select Manual.

    model.result("pg7").feature("lngr1").set("legendmethod", "manual");

//    In the table, enter the following settings:

    model.result("pg7").feature("lngr1").setIndex("legends", "Fluid velocity, simulation", 0);
    model.result("pg7").run();

//    In the Model Builder window, right-click Probe position #3 and choose Table Graph.

    model.result("pg7").create("tblp1", "Table");
    model.result("pg7").feature("tblp1").set("markerpos", "datapoints");
    model.result("pg7").feature("tblp1").set("linewidth", "preference");

//    In the Settings window for Table Graph, locate the Coloring and Style section.
//    Find the Line style subsection.
//    From the Line list, select None.

    model.result("pg7").feature("tblp1").set("linestyle", "none");

//    From the Color list, select Blue.

    model.result("pg7").feature("tblp1").set("linecolor", "blue");

//    Find the Line markers subsection.
//    From the Marker list, select Diamond.

    model.result("pg7").feature("tblp1").set("linemarker", "diamond");

//    Click to expand the Legends section.
//    Select the Show legends checkbox.

    model.result("pg7").feature("tblp1").set("legend", true);

//    From the Legends list, select Manual.

    model.result("pg7").feature("tblp1").set("legendmethod", "manual");

//    In the table, enter the following settings:

    model.result("pg7").feature("tblp1").setIndex("legends", "Fluid velocity, experiments", 0);
    model.result("pg7").run();

//    Right-click Probe position #3 and choose Line Graph.

    model.result("pg7").create("lngr2", "LineGraph");
    model.result("pg7").feature("lngr2").set("markerpos", "datapoints");
    model.result("pg7").feature("lngr2").set("linewidth", "preference");
    model.result("pg7").feature("lngr2").set("evaluationsettings", "parent");

//    In the Settings window for Line Graph, locate the y-Axis Data section.
//    In the Expression text field, type bf.ugy.

    model.result("pg7").feature("lngr2").set("expr", "bf.ugy");

//    Locate the Coloring and Style section.
//    From the Color list, select Red.

    model.result("pg7").feature("lngr2").set("linecolor", "red");

//    Locate the Legends section.
//    Select the Show legends checkbox.

    model.result("pg7").feature("lngr2").set("legend", true);

//    From the Legends list, select Manual.

    model.result("pg7").feature("lngr2").set("legendmethod", "manual");

//    In the table, enter the following settings:

    model.result("pg7").feature("lngr2").setIndex("legends", "Gas velocity, simulation", 0);
    model.result("pg7").run();

//    Right-click Probe position #3 and choose Table Graph.

    model.result("pg7").create("tblp2", "Table");
    model.result("pg7").feature("tblp2").set("markerpos", "datapoints");
    model.result("pg7").feature("tblp2").set("linewidth", "preference");

//    In the Settings window for Table Graph, locate the Data section.
//    From the Table list, select vg3.

    model.result("pg7").feature("tblp2").set("table", "tbl2");

//    Locate the Coloring and Style section.
//    Find the Line style subsection.
//    From the Line list, select None.

    model.result("pg7").feature("tblp2").set("linestyle", "none");

//    From the Color list, select Red.

    model.result("pg7").feature("tblp2").set("linecolor", "red");

//    Find the Line markers subsection.
//    From the Marker list, select Square.

    model.result("pg7").feature("tblp2").set("linemarker", "square");

//    Locate the Legends section.
//    Select the Show legends checkbox.

    model.result("pg7").feature("tblp2").set("legend", true);

//    From the Legends list, select Manual.

    model.result("pg7").feature("tblp2").set("legendmethod", "manual");

//    In the table, enter the following settings:

    model.result("pg7").feature("tblp2").setIndex("legends", "Gas velocity, experiments", 0);
    model.result("pg7").run();

//    In the Model Builder window, click Probe position #3.
//    In the Settings window for 1D Plot Group, locate the Axis section.
//    Select the Manual axis limits checkbox.

    model.result("pg7").set("axislimits", true);

//    In the x minimum text field, type 0.

    model.result("pg7").set("xmin", 0);

//    In the x maximum text field, type 0.15.

    model.result("pg7").set("xmax", 0.15);

//    In the y minimum text field, type -0.15.

    model.result("pg7").set("ymin", -0.15);

//    In the y maximum text field, type 0.85.

    model.result("pg7").set("ymax", 0.85);

//    In the Probe position #3 toolbar, click Plot.

    model.result("pg7").run();

//    Right-click Probe position #3 and choose Duplicate.

    model.result().duplicate("pg8", "pg7");
    model.result("pg8").run();

//    In the Model Builder window, collapse the Results > Probe position #3 node.
//    In the Model Builder window, under Results, click Probe position #3.1.
//    In the Settings window for 1D Plot Group, type Probe position #5 in the Label text field.

    model.result("pg8").label("Probe position #5");

//    Locate the Data section.
//    From the Dataset list, select No5.

    model.result("pg8").set("data", "cln2");

//    Locate the Title section.
//    In the Title text area, type Vertical liquid and gas velocities at probe position #5.

    model.result("pg8").set("title", "Vertical liquid and gas velocities at probe position #5");
    model.result("pg8").run();

//    In the Model Builder window, expand the Probe position #5 node, then click Table Graph 1.
//    In the Settings window for Table Graph, locate the Data section.
//    From the Table list, select vl5.

    model.result("pg8").feature("tblp1").set("table", "tbl3");
    model.result("pg8").run();

//    In the Model Builder window, click Table Graph 2.
//    In the Settings window for Table Graph, locate the Data section.
//    From the Table list, select vg5.

    model.result("pg8").feature("tblp2").set("table", "tbl4");

//    In the Probe position #5 toolbar, click Plot.

    model.result("pg8").run();
    model.result("pg8").run();

//    In the Model Builder window, click Probe position #5.
//    Click Plot.

    model.result("pg8").run();

//    Right-click Probe position #5 and choose Duplicate.

    model.result().duplicate("pg9", "pg8");
    model.result("pg9").run();

//    In the Model Builder window, collapse the Results > Probe position #5 node.
//    In the Model Builder window, under Results, click Probe position #5.1.
//    In the Settings window for 1D Plot Group, type Probe position #7 in the Label text field.

    model.result("pg9").label("Probe position #7");

//    Locate the Data section.
//    From the Dataset list, select No7.

    model.result("pg9").set("data", "cln3");

//    Locate the Title section.
//    In the Title text area, type Vertical liquid and gas velocities at probe position #7.

    model.result("pg9").set("title", "Vertical liquid and gas velocities at probe position #7");
    model.result("pg9").run();

//    In the Model Builder window, expand the Probe position #7 node, then click Table Graph 1.
//    In the Settings window for Table Graph, locate the Data section.
//    From the Table list, select vl7.

    model.result("pg9").feature("tblp1").set("table", "tbl5");
    model.result("pg9").run();

//    In the Model Builder window, click Table Graph 2.
//    In the Settings window for Table Graph, locate the Data section.
//    From the Table list, select vg7.

    model.result("pg9").feature("tblp2").set("table", "tbl6");
    model.result("pg9").run();

//    In the Model Builder window, click Probe position #7.
//    In the Probe position #7 toolbar, click Plot.

    model.result("pg9").run();

//    Right-click Probe position #7 and choose Duplicate.

    model.result().duplicate("pg10", "pg9");
    model.result("pg10").run();

//    In the Model Builder window, collapse the Results > Probe position #7 node.
//    In the Model Builder window, under Results, click Probe position #7.1.
//    In the Settings window for 1D Plot Group, type Probe position #9 in the Label text field.

    model.result("pg10").label("Probe position #9");

//    Locate the Data section.
//    From the Dataset list, select No9.

    model.result("pg10").set("data", "cln4");

//    Locate the Title section.
//    In the Title text area, type Vertical liquid and gas velocities at probe position #9.

    model.result("pg10").set("title", "Vertical liquid and gas velocities at probe position #9");
    model.result("pg10").run();

//    In the Model Builder window, expand the Probe position #9 node, then click Table Graph 1.
//    In the Settings window for Table Graph, locate the Data section.
//    From the Table list, select vl9.

    model.result("pg10").feature("tblp1").set("table", "tbl7");
    model.result("pg10").run();

//    In the Model Builder window, click Table Graph 2.
//    In the Settings window for Table Graph, locate the Data section.
//    From the Table list, select vg9.

    model.result("pg10").feature("tblp2").set("table", "tbl8");
    model.result("pg10").run();

//    In the Model Builder window, click Probe position #9.
//    In the Probe position #9 toolbar, click Plot.

    model.result("pg10").run();

//    In the Model Builder window, collapse the Probe position #9 node.

    model.result("pg5").run();

    model.title("Flow in an Airlift Loop Reactor");

    model
         .description("This example illustrates multiphase flow modeling in an airlift loop reactor. The reactor is filled with water and air bubbles are injected at the bottom through two frits. Due to buoyancy, the bubbles rise, inducing a circulating motion of the liquid.");

    return model;
  }

  public static void main(String[] args) {
    Model model = run();
    run2(model);
  }

}
