/*
 * slip_flow_benchmark.java
 */

import com.comsol.model.*;
import com.comsol.model.util.*;

/** Model exported on May 15 2026, 11:11 by COMSOL 6.4.0.421. */
public class slip_flow_benchmark {

  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 2D.
//    In the Select Physics tree, select Fluid Flow > Rarefied Flow > Slip Flow (slpf).
//    Click Add.
//    Click Study.
//    In the Select Study tree, select General Studies > Stationary.
//    Click Done.

    model.component().create("comp1", true);

    model.component("comp1").geom().create("geom1", 2);

    model.component("comp1").mesh().create("mesh1");

    model.component("comp1").physics().create("slpf", "SlipFlow", "geom1");

    model.study().create("std1");
    model.study("std1").create("stat", "Stationary");

//    Change the length units to <symbol>m</symbol>m and specify the geometry.
//    In the Model Builder window, under Component 1 (comp1), click Geometry 1.
//    In the Settings window for Geometry, locate the Units section.
//    From the Length unit list, select µm.

    model.component("comp1").geom("geom1").lengthUnit("\u00b5m");

//    In the Geometry toolbar, click Rectangle.

    model.component("comp1").geom("geom1").create("r1", "Rectangle");

//    In the Settings window for Rectangle, locate the Size and Shape section.
//    In the Width text field, type 15.

    model.component("comp1").geom("geom1").feature("r1").set("size", new double[]{15, 1});

//    In the Height text field, type 1.5.

    model.component("comp1").geom("geom1").feature("r1").set("size", new double[]{15, 1.5});

//    Locate the Position section.
//    In the y text field, type -0.75.

    model.component("comp1").geom("geom1").feature("r1").set("pos", new double[]{0, -0.75});

//    In the Geometry toolbar, click Rectangle.

    model.component("comp1").geom("geom1").run("r1");
    model.component("comp1").geom("geom1").create("r2", "Rectangle");

//    In the Settings window for Rectangle, locate the Size and Shape section.
//    In the Width text field, type 7.5.

    model.component("comp1").geom("geom1").feature("r2").set("size", new double[]{7.5, 1});

//    In the Height text field, type 15.

    model.component("comp1").geom("geom1").feature("r2").set("size", new double[]{7.5, 15});

//    Locate the Position section.
//    In the x text field, type -7.5.

    model.component("comp1").geom("geom1").feature("r2").set("pos", new double[]{-7.5, 0});

//    In the y text field, type -7.5.

    model.component("comp1").geom("geom1").feature("r2").set("pos", new double[]{-7.5, -7.5});

//    In the Geometry toolbar, click Rectangle.

    model.component("comp1").geom("geom1").run("r2");
    model.component("comp1").geom("geom1").create("r3", "Rectangle");

//    In the Settings window for Rectangle, locate the Size and Shape section.
//    In the Width text field, type 7.5.

    model.component("comp1").geom("geom1").feature("r3").set("size", new double[]{7.5, 1});

//    In the Height text field, type 15.

    model.component("comp1").geom("geom1").feature("r3").set("size", new double[]{7.5, 15});

//    Locate the Position section.
//    In the x text field, type 15.

    model.component("comp1").geom("geom1").feature("r3").set("pos", new double[]{15, 0});

//    In the y text field, type -7.5.

    model.component("comp1").geom("geom1").feature("r3").set("pos", new double[]{15, -7.5});

//    In the Geometry toolbar, click Booleans and Partitions and choose Union.

    model.component("comp1").geom("geom1").run("r3");
    model.component("comp1").geom("geom1").create("uni1", "Union");

//    Click in the Graphics window and then press Ctrl+A to select all objects.

    model.component("comp1").geom("geom1").feature("uni1").selection("input").set("r1", "r2", "r3");

//    In the Settings window for Union, locate the Union section.
//    Clear the Keep interior boundaries checkbox.

    model.component("comp1").geom("geom1").feature("uni1").set("intbnd", false);

//    Click the Zoom Extents button in the Graphics toolbar.
//    In the Geometry toolbar, click Rectangle.

    model.component("comp1").geom("geom1").run("uni1");
    model.component("comp1").geom("geom1").create("r4", "Rectangle");

//    In the Settings window for Rectangle, locate the Size and Shape section.
//    In the Width text field, type 9.5.

    model.component("comp1").geom("geom1").feature("r4").set("size", new double[]{9.5, 1});

//    In the Height text field, type 17.

    model.component("comp1").geom("geom1").feature("r4").set("size", new double[]{9.5, 17});

//    Locate the Position section.
//    In the x text field, type -8.5.

    model.component("comp1").geom("geom1").feature("r4").set("pos", new double[]{-8.5, 0});

//    In the y text field, type -8.5.

    model.component("comp1").geom("geom1").feature("r4").set("pos", new double[]{-8.5, -8.5});

//    In the Geometry toolbar, click Rectangle.

    model.component("comp1").geom("geom1").run("r4");
    model.component("comp1").geom("geom1").create("r5", "Rectangle");

//    In the Settings window for Rectangle, locate the Size and Shape section.
//    In the Width text field, type 15.

    model.component("comp1").geom("geom1").feature("r5").set("size", new double[]{15, 1});

//    In the Height text field, type 3.5.

    model.component("comp1").geom("geom1").feature("r5").set("size", new double[]{15, 3.5});

//    Locate the Position section.
//    In the y text field, type -1.75.

    model.component("comp1").geom("geom1").feature("r5").set("pos", new double[]{0, -1.75});

//    In the Geometry toolbar, click Rectangle.

    model.component("comp1").geom("geom1").run("r5");
    model.component("comp1").geom("geom1").create("r6", "Rectangle");

//    In the Settings window for Rectangle, locate the Size and Shape section.
//    In the Width text field, type 9.5.

    model.component("comp1").geom("geom1").feature("r6").set("size", new double[]{9.5, 1});

//    In the Height text field, type 17.

    model.component("comp1").geom("geom1").feature("r6").set("size", new double[]{9.5, 17});

//    Locate the Position section.
//    In the x text field, type 14.

    model.component("comp1").geom("geom1").feature("r6").set("pos", new double[]{14, 0});

//    In the y text field, type -8.5.

    model.component("comp1").geom("geom1").feature("r6").set("pos", new double[]{14, -8.5});

//    In the Geometry toolbar, click Booleans and Partitions and choose Union.

    model.component("comp1").geom("geom1").run("r6");
    model.component("comp1").geom("geom1").create("uni2", "Union");

//    Select the objects r4, r5, r6.

    model.component("comp1").geom("geom1").feature("uni2").selection("input").set("r4", "r5", "r6");

//    In the Settings window for Union, locate the Union section.
//    Clear the Keep interior boundaries checkbox.

    model.component("comp1").geom("geom1").feature("uni2").set("intbnd", false);

//    In the Geometry toolbar, click Point.

    model.component("comp1").geom("geom1").run("uni2");
    model.component("comp1").geom("geom1").create("pt1", "Point");

//    In the Settings window for Point, locate the Point section.
//    In the x text field, type 7.5.

    model.component("comp1").geom("geom1").feature("pt1").setIndex("p", 7.5, 0);

//    Click Build All Objects.

    model.component("comp1").geom("geom1").runPre("fin");

//    Click the Zoom Extents button in the Graphics toolbar.
//    Specify the material properties for the cavity walls and the gas.

    model.component("comp1").geom("geom1").run();

//    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 > Silicon.
//    Click Add to Component in the window toolbar.

    model.component("comp1").material().create("mat2", "Common");
    model.component("comp1").material("mat2").propertyGroup()
         .create("Enu", "Enu", "Young's modulus and Poisson's ratio");
    model.component("comp1").material("mat2").propertyGroup()
         .create("RefractiveIndex", "RefractiveIndex", "Refractive index");
    model.component("comp1").material("mat2").label("Silicon");
    model.component("comp1").material("mat2").set("family", "custom");
    model.component("comp1").material("mat2").set("customspecular", new double[]{0.7843137254901961, 1, 1});
    model.component("comp1").material("mat2").set("diffuse", "custom");
    model.component("comp1").material("mat2")
         .set("customdiffuse", new double[]{0.6666666666666666, 0.6666666666666666, 0.7058823529411765});
    model.component("comp1").material("mat2").set("ambient", "custom");
    model.component("comp1").material("mat2")
         .set("customambient", new double[]{0.6666666666666666, 0.6666666666666666, 0.7058823529411765});
    model.component("comp1").material("mat2").set("noise", true);
    model.component("comp1").material("mat2").set("fresnel", 0.7);
    model.component("comp1").material("mat2").set("roughness", 0.5);
    model.component("comp1").material("mat2").set("diffusewrap", 0);
    model.component("comp1").material("mat2").set("reflectance", 0);
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("relpermeability", new String[]{"1", "0", "0", "0", "1", "0", "0", "0", "1"});
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("electricconductivity", new String[]{"1e-12[S/m]", "0", "0", "0", "1e-12[S/m]", "0", "0", "0", "1e-12[S/m]"});
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("thermalexpansioncoefficient", new String[]{"2.6e-6[1/K]", "0", "0", "0", "2.6e-6[1/K]", "0", "0", "0", "2.6e-6[1/K]"});
    model.component("comp1").material("mat2").propertyGroup("def").set("heatcapacity", "700[J/(kg*K)]");
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("relpermittivity", new String[]{"11.7", "0", "0", "0", "11.7", "0", "0", "0", "11.7"});
    model.component("comp1").material("mat2").propertyGroup("def").set("density", "2329[kg/m^3]");
    model.component("comp1").material("mat2").propertyGroup("def")
         .set("thermalconductivity", new String[]{"130[W/(m*K)]", "0", "0", "0", "130[W/(m*K)]", "0", "0", "0", "130[W/(m*K)]"});
    model.component("comp1").material("mat2").propertyGroup("Enu").set("E", "170[GPa]");
    model.component("comp1").material("mat2").propertyGroup("Enu").set("nu", "0.28");
    model.component("comp1").material("mat2").propertyGroup("RefractiveIndex")
         .set("n", new String[]{"3.48", "0", "0", "0", "3.48", "0", "0", "0", "3.48"});

//    In the Materials toolbar, click Add Material to close the Add Material window.
//    Select Domain 1.

    model.component("comp1").material("mat2").selection().set(1);

//    Set the physics for the solid regions to be the heat transfer equation.
//    In the Physics toolbar, click Domains and choose Solid.

    model.component("comp1").physics("slpf").create("solid1", "SolidHeatTransferModel", 2);

//    Select Domain 1.

    model.component("comp1").physics("slpf").feature("solid1").selection().set(1);

//    Apply thermal insulation on the boundaries of the connecting duct.
//    In the Physics toolbar, click Boundaries and choose Thermal Insulation.

    model.component("comp1").physics("slpf").create("ins1", "ThermalInsulation", 1);

//    Select Boundaries 12, 14.

    model.component("comp1").physics("slpf").feature("ins1").selection().set(12, 14);

//    Fix the temperature on the walls of the two reservoirs.
//    In the Physics toolbar, click Boundaries and choose Temperature.

    model.component("comp1").physics("slpf").create("temp1", "TemperatureBoundary", 1);

//    Select Boundaries 1, 2, 3, 11, 13.

    model.component("comp1").physics("slpf").feature("temp1").selection().set(1, 2, 3, 11, 13);

//    In the Settings window for Temperature, locate the Temperature section.
//    In the \[T_{\textrm{0}}\] text field, type 300[K].

    model.component("comp1").physics("slpf").feature("temp1").set("T0", "300[K]");

//    In the Physics toolbar, click Boundaries and choose Temperature.

    model.component("comp1").physics("slpf").create("temp2", "TemperatureBoundary", 1);

//    Select Boundaries 15, 16, 17, 18, 24.

    model.component("comp1").physics("slpf").feature("temp2").selection().set(15, 16, 17, 18, 24);

//    In the Settings window for Temperature, locate the Temperature section.
//    In the \[T_{\textrm{0}}\] text field, type 400[K].

    model.component("comp1").physics("slpf").feature("temp2").set("T0", "400[K]");

//    Apply slip boundary conditions near and inside the channel.
//    In the Physics toolbar, click Boundaries and choose Slip Wall.

    model.component("comp1").physics("slpf").create("slw1", "SlipWall", 1);

//    In the Settings window for Slip Wall, locate the Boundary Selection section.
//    From the Selection list, select All boundaries.

    model.component("comp1").physics("slpf").feature("slw1").selection().all();

//    Apply a pressure constraint in the center of the channel.
//    In the Physics toolbar, click Points and choose Pressure Point Constraint.

    model.component("comp1").physics("slpf").create("prpc1", "PressurePointConstraint", 0);

//    Select Point 13.

    model.component("comp1").physics("slpf").feature("prpc1").selection().set(13);

//    Set up the mesh.
//    In the Model Builder window, right-click Component 1 (comp1) > Mesh 1 and choose Size.

    model.component("comp1").mesh("mesh1").create("size1", "Size");

//    In the Settings window for Size, locate the Element Size section.
//    From the Calibrate for list, select Fluid dynamics.

    model.component("comp1").mesh("mesh1").feature("size1").set("table", "cfd");

//    From the Predefined list, select Extra fine.

    model.component("comp1").mesh("mesh1").feature("size1").set("hauto", 2);

//    In the Mesh toolbar, click Free Triangular.

    model.component("comp1").mesh("mesh1").create("ftri1", "FreeTri");

//    In the Settings window for Free Triangular, click Build All.

    model.component("comp1").mesh("mesh1").run();

//    In the Study toolbar, click Compute.

    model.study("std1").createAutoSequences("all");

    model.sol("sol1").runAll();

    model.result().dataset("dset1").set("geom", "geom1");
    model.result().create("pg1", "PlotGroup2D");
    model.result("pg1").label("Velocity (slpf)");
    model.result("pg1").set("frametype", "spatial");
    model.result("pg1").set("smooth", "internal");
    model.result("pg1").feature().create("surf1", "Surface");
    model.result("pg1").feature("surf1").label("Surface");
    model.result("pg1").feature("surf1").set("smooth", "internal");
    model.result("pg1").feature("surf1").set("data", "parent");
    model.result().create("pg2", "PlotGroup2D");
    model.result("pg2").label("Pressure (slpf)");
    model.result("pg2").set("frametype", "spatial");
    model.result("pg2").set("smooth", "internal");
    model.result("pg2").feature().create("surf1", "Surface");
    model.result("pg2").feature("surf1").set("expr", "p");
    model.result("pg2").feature("surf1").set("colortable", "Tectocoris");
    model.result("pg2").feature("surf1").set("colortabletype", "discrete");
    model.result("pg2").feature("surf1").set("bandcount", 25);
    model.result("pg2").feature("surf1").set("smooth", "internal");
    model.result("pg2").feature("surf1").set("data", "parent");
    model.result().create("pg3", "PlotGroup2D");
    model.result("pg3").label("Temperature (slpf)");
    model.result("pg3").set("smooth", "internal");
    model.result("pg3").feature().create("surf1", "Surface");
    model.result("pg3").feature("surf1").set("solutionparams", "parent");
    model.result("pg3").feature("surf1").set("expr", "T");
    model.result("pg3").feature("surf1").set("colortable", "HeatCameraLight");
    model.result("pg3").feature("surf1").set("data", "parent");
    model.result("pg1").run();

//    Plot the mean free path number in the domain to check the Knudsen number.
//    In the Results toolbar, click Result Templates to open the Result Templates window.
//    In the tree, select Study 1/Solution 1 (sol1) > Slip Flow > Isothermal Contours (slpf).
//    Click Add Result Template in the window toolbar.

    model.result().create("pg4", "PlotGroup2D");
    model.result("pg4").label("Isothermal Contours (slpf)");
    model.result("pg4").set("smooth", "internal");
    model.result("pg4").feature().create("con1", "Contour");
    model.result("pg4").feature("con1").set("solutionparams", "parent");
    model.result("pg4").feature("con1").set("expr", "T");
    model.result("pg4").feature("con1").set("colortable", "HeatCameraLight");
    model.result("pg4").feature("con1").set("smooth", "internal");
    model.result("pg4").feature("con1").set("data", "parent");
    model.result("pg4").label("Isothermal Contours (slpf)");
    model.result("pg4").run();

//    In the Results toolbar, click Result Templates to close the Result Templates window.
//    In the Results toolbar, click 2D Plot Group.

    model.result().create("pg5", "PlotGroup2D");
    model.result("pg5").run();

//    In the Settings window for 2D Plot Group, type Mean Free Path in the Label text field.

    model.result("pg5").label("Mean Free Path");

//    Right-click Mean Free Path and choose Surface.

    model.result("pg5").create("surf1", "Surface");
    model.result("pg5").feature("surf1").set("evaluationsettings", "parent");

//    In the Settings window for Surface, locate the Expression section.
//    In the Expression text field, type slpf.lambda.

    model.result("pg5").feature("surf1").set("expr", "slpf.lambda");

//    In the Mean Free Path toolbar, click Plot.

    model.result("pg5").run();

//    Click the Zoom Extents button in the Graphics toolbar.
//    Plot the <eqv>x</eqv>-velocity and streamlines in the domain.

    model.result("pg1").run();

//    In the Model Builder window, right-click Velocity (slpf) and choose Duplicate.

    model.result().duplicate("pg6", "pg1");
    model.result("pg6").run();

//    In the Settings window for 2D Plot Group, type x-Velocity, Streamlines in the Label text field.

    model.result("pg6").label("x-Velocity, Streamlines");

//    Right-click x-Velocity, Streamlines and choose Streamline.

    model.result("pg6").create("str1", "Streamline");
    model.result("pg6").feature("str1").set("evaluationsettings", "parent");

//    In the Settings window for Streamline, locate the Streamline Positioning section.
//    From the Positioning list, select Magnitude controlled.

    model.result("pg6").feature("str1").set("posmethod", "magnitude");

//    In the Minimum density level text field, type 2.2.

    model.result("pg6").feature("str1").set("magdensity", new double[]{2.2, 12.3});

//    In the Maximum density level text field, type 14.2.

    model.result("pg6").feature("str1").set("magdensity", new double[]{2.2, 14.2});

//    Locate the Coloring and Style section.
//    Find the Point style subsection.
//    From the Color list, select White.

    model.result("pg6").feature("str1").set("color", "white");
    model.result("pg6").run();

//    In the Model Builder window, click Surface.
//    In the Settings window for Surface, locate the Expression section.
//    In the Expression text field, type u.

    model.result("pg6").feature("surf1").set("expr", "u");

//    In the x-Velocity, Streamlines toolbar, click Plot.

    model.result("pg6").run();

//    Plot the Temperature in the domain.

    model.result("pg4").run();
    model.result("pg4").run();

//    In the Model Builder window, expand the Isothermal Contours (slpf) node, then click Contour 1.
//    In the Settings window for Contour, locate the Levels section.
//    In the Total levels text field, type 40.

    model.result("pg4").feature("con1").set("number", 40);

//    In the Isothermal Contours (slpf) toolbar, click Plot.

    model.result("pg4").run();

//    Locate the Coloring and Style section.
//    From the Color table list, select Rainbow.

    model.result("pg4").feature("con1").set("colortable", "Rainbow");

//    Plot the pressure along the channel wall.
//    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 Channel Pressure in the Label text field.

    model.result("pg7").label("Channel Pressure");

//    Right-click Channel Pressure 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");

//    Select Boundary 10.

    model.result("pg7").feature("lngr1").selection().set(10);

//    In the Settings window for Line Graph, locate the y-Axis Data section.
//    In the Expression text field, type p.

    model.result("pg7").feature("lngr1").set("expr", "p");

//    In the Channel Pressure toolbar, click Plot.

    model.result("pg7").run();

    model.title("Slip-Flow Benchmark");

    model
         .description("This example computes the flow between two sealed chambers connected by a microchannel with conducting walls when the chambers are maintained at different temperatures. No net flow occurs down the duct, but a pressure gradient and a circulating flow develops. This is a benchmark problem for the slip flow interface.");

    return model;
  }

  public static void main(String[] args) {
    run();
  }

}
