Configure an Automation Script Adapter for the Fluid Flow Simulation

Set up a Visual Basic (VB) script that varies the design of the water bottle's midsection.

Similar to the previous Automation Script adapter, you set up a VB script to change the water bottle's midsection before running the fluid flow simulation.

  1. From the 3DEXPERIENCE Operations section of the action bar, click Automation Script , and drop it onto the process diagram to the right of the Structural activity to create an activity.


  2. In the process diagram, click the Automation Script adapter to open its shortcut toolbar, and then click to open the adapter's editor.
  3. From the Select Object options, select Parameter.
  4. Create a parameter for the bottle model used in the fluid flow simulation that you previously imported.
    1. Click to search for the bottle model used in the fluid flow simulation that you previously imported.
    2. In the top bar, search for and select PlasticBottleCFD A.1.

      PlasticBottleCFD A.1 is the water bottle model used in the fluid flow simulation.

      The Create New Parameter dialog box appears and the selected object appears in the Object Selection field.
    3. Enter CFD Product for the parameter's name.
    4. Click OK.
      Optimization Process Composer creates an object parameter for the bottle. You can now refer to the bottle using this parameter, which makes it easy to edit the model later on, if required.
    5. From the Select Object options, confirm that CFD Product is selected.
  5. From the App to open options, select Generative Shape Design.

    While the simulation process runs, the Automation Script adapter uses Generative Shape Design to alter the bottle's midsection geometry.

  6. In the VBScript Macro Options section, select Content from the Macro library options.
  7. From the Macro liberary section. click
  8. Search for and select MidsectionChange.

    If you have no other macro libraries, this field autofills after you click Select.

  9. Enter Module2 for the Macro name.

    Important: The name of the macro must match the name defined in the VB module. The name of the macro used for the fluid flow simulation is different from the name of the macro used for the structural simulation.

  10. Accept the default name of the Function.
  11. Create a parameter to drive the VB module argument, selecting the bottle's midsection geometry.
    1. From Select function argument, click to create a parameter.
    2. Enter MidsectionDesign as the parameter's name.

      Important: The name of this parameter must match the name defined in the VB module.

    3. From the Type options, select Integer.
    4. Enter 1 for the Value.
    5. Accept all other defaults, and click OK.
    6. Click Add argument.
      The function argument appears in the table.
  12. Create an object parameter to represent the midsection of the bottle used in the fluid flow simulation.
    1. Select Capture object in.
    2. Click to create a parameter.
    3. Enter CFD Midsection as the parameter's name.
    4. Accept all other defaults, and click OK.
    5. From the Capture object in options, confirm that CFD Midsection is selected.
  13. Click OK.
    The VB script selects between three different midsection geometries to be used by the fluid flow simulation.