.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/00-fluent/exhaust_system.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_00-fluent_exhaust_system.py: .. _ref_exhaust_system_tui_api: Fault-tolerant meshing workflow ------------------------------- This example sets up and solves a three-dimensional turbulent fluid flow in a manifold exhaust system, which is common in the automotive industry. Predicting the flow field in the area of the mixing region is important to designing the junction properly. This example uses the guided workflow for fault-tolerant meshing because it is appropriate for geometries that can have imperfections, such as gaps and leakages. **Workflow tasks** The fault-tolerant meshing workflow guides you through these tasks: - Import a CAD geometry and manage individual parts - Generate a surface mesh - Cap inlets and outlets - Extract a fluid region - Define leakages - Extract edge features - Set up size controls - Generate a volume mesh **Problem description** In the manifold exhaust system, air flows through the three inlets with a uniform velocity of 1 m/s. The air then exits through the outlet. A small pipe is placed in the main portion of the manifold where edge extraction is considered. The example also includes a known small leakage to demonstrate the automatic leakage detection aspects of the meshing workflow. .. GENERATED FROM PYTHON SOURCE LINES 37-46 Example Setup ------------- Before you can use the fault-tolerant meshing workflow, you must set up the example and initialize this workflow. Perform required imports ~~~~~~~~~~~~~~~~~~~~~~~~ Perform required imports, which includes downloading and importing the geometry file. .. GENERATED FROM PYTHON SOURCE LINES 46-54 .. code-block:: Python import ansys.fluent.core as pyfluent from ansys.fluent.core import examples import_file_name = examples.download_file( "exhaust_system.fmd", "pyfluent/exhaust_system" ) .. rst-class:: sphx-glr-script-out .. code-block:: none Download successful. File path: /home/ansys/.local/share/ansys_fluent_core/examples/exhaust_system.fmd .. GENERATED FROM PYTHON SOURCE LINES 56-60 Launch Fluent ~~~~~~~~~~~~~ Launch Fluent as a service in meshing mode with double precision running on two processors. .. GENERATED FROM PYTHON SOURCE LINES 60-67 .. code-block:: Python meshing = pyfluent.launch_fluent( precision="double", processor_count=4, mode="meshing", ) .. GENERATED FROM PYTHON SOURCE LINES 68-71 Initialize workflow ~~~~~~~~~~~~~~~~~~~ Initialize the fault-tolerant meshing workflow. .. GENERATED FROM PYTHON SOURCE LINES 71-74 .. code-block:: Python meshing.workflow.InitializeWorkflow(WorkflowType="Fault-tolerant Meshing") .. GENERATED FROM PYTHON SOURCE LINES 75-84 Fault-folerant meshing workflow ------------------------------- The fault-tolerant meshing workflow guides you through the many tasks that follow. Import CAD and manage parts ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Import the CAD geometry file (``exhaust_system.fmd``) and selectively manage some parts. .. GENERATED FROM PYTHON SOURCE LINES 84-118 .. code-block:: Python meshing.PartManagement.InputFileChanged( FilePath=import_file_name, IgnoreSolidNames=False, PartPerBody=False ) meshing.PMFileManagement.FileManager.LoadFiles() meshing.PartManagement.Node["Meshing Model"].Copy( Paths=[ "/dirty_manifold-for-wrapper," + "1/dirty_manifold-for-wrapper,1/main,1", "/dirty_manifold-for-wrapper," + "1/dirty_manifold-for-wrapper,1/flow-pipe,1", "/dirty_manifold-for-wrapper," + "1/dirty_manifold-for-wrapper,1/outpipe3,1", "/dirty_manifold-for-wrapper," + "1/dirty_manifold-for-wrapper,1/object2,1", "/dirty_manifold-for-wrapper," + "1/dirty_manifold-for-wrapper,1/object1,1", ] ) meshing.PartManagement.ObjectSetting["DefaultObjectSetting"].OneZonePer.set_state( "part" ) cad_import = meshing.workflow.TaskObject["Import CAD and Part Management"] cad_import.Arguments.set_state( { "Context": 0, "CreateObjectPer": "Custom", "FMDFileName": import_file_name, "FileLoaded": "yes", "ObjectSetting": "DefaultObjectSetting", "Options": { "Line": False, "Solid": False, "Surface": False, }, } ) cad_import.Execute() .. rst-class:: sphx-glr-script-out .. code-block:: none loading data from '/mnt/pyfluent/exhaust_system.fmd' ... classifying 115 edge occurrences ... classified 67 feature edge edges by feature angle classified 0 single-connected edges as feature edge(s) classified 0 multi-connected edges as feature edge(s) classified 0 sheet edges as feature edge(s) classified 0 wire edges as feature edge(s) classified 10 feature edges by group criteria processing 8 zones ... post-processing 0 zones for feature edge extraction ... classifying 2 edge occurrences ... classified 1 feature edge edge by feature angle classified 0 single-connected edges as feature edge(s) classified 0 multi-connected edges as feature edge(s) classified 0 sheet edges as feature edge(s) classified 0 wire edges as feature edge(s) classified 10 feature edges by group criteria processing 5 zones ... post-processing 0 zones for feature edge extraction ... classifying 13 edge occurrences ... classified 8 feature edge edges by feature angle classified 0 single-connected edges as feature edge(s) classified 0 multi-connected edges as feature edge(s) classified 0 sheet edges as feature edge(s) classified 0 wire edges as feature edge(s) classified 10 feature edges by group criteria processing 8 zones ... post-processing 0 zones for feature edge extraction ... classifying 13 edge occurrences ... classified 8 feature edge edges by feature angle classified 0 single-connected edges as feature edge(s) classified 0 multi-connected edges as feature edge(s) classified 0 sheet edges as feature edge(s) classified 0 wire edges as feature edge(s) classified 10 feature edges by group criteria processing 8 zones ... post-processing 0 zones for feature edge extraction ... classifying 50 edge occurrences ... classified 16 feature edge edges by feature angle classified 0 single-connected edges as feature edge(s) classified 0 multi-connected edges as feature edge(s) classified 0 sheet edges as feature edge(s) classified 0 wire edges as feature edge(s) classified 10 feature edges by group criteria processing 8 zones ... post-processing 0 zones for feature edge extraction ... "Meshing objects are created" .. GENERATED FROM PYTHON SOURCE LINES 119-122 Describe geometry and flow ~~~~~~~~~~~~~~~~~~~~~~~~~~ Describe the geometry and the flow characteristics. .. GENERATED FROM PYTHON SOURCE LINES 122-146 .. code-block:: Python describe_geom = meshing.workflow.TaskObject["Describe Geometry and Flow"] describe_geom.Arguments.set_state( { "AddEnclosure": "No", "CloseCaps": "Yes", "FlowType": "Internal flow through the object", } ) describe_geom.UpdateChildTasks(SetupTypeChanged=False) describe_geom.Arguments.set_state( { "AddEnclosure": "No", "CloseCaps": "Yes", "DescribeGeometryAndFlowOptions": { "AdvancedOptions": True, "ExtractEdgeFeatures": "Yes", }, "FlowType": "Internal flow through the object", } ) describe_geom.UpdateChildTasks(SetupTypeChanged=False) describe_geom.Execute() .. GENERATED FROM PYTHON SOURCE LINES 147-150 Enclose openings ~~~~~~~~~~~~~~~~ Enclose (cap) any openings in the geometry. .. GENERATED FROM PYTHON SOURCE LINES 152-155 .. image:: /_static/exhaust_system_011.png :width: 400pt :align: center .. GENERATED FROM PYTHON SOURCE LINES 157-160 .. image:: /_static/exhaust_system_012.png :width: 400pt :align: center .. GENERATED FROM PYTHON SOURCE LINES 160-286 .. code-block:: Python capping = meshing.workflow.TaskObject["Enclose Fluid Regions (Capping)"] capping.Arguments.set_state( { "CreatePatchPreferences": { "ShowCreatePatchPreferences": False, }, "PatchName": "inlet-1", "SelectionType": "zone", "ZoneSelectionList": ["inlet.1"], } ) capping.Arguments.set_state( { "CreatePatchPreferences": { "ShowCreatePatchPreferences": False, }, "PatchName": "inlet-1", "SelectionType": "zone", "ZoneLocation": [ "1", "351.68205", "-361.34322", "-301.88668", "396.96205", "-332.84759", "-266.69751", "inlet.1", ], "ZoneSelectionList": ["inlet.1"], } ) capping.AddChildToTask() capping.InsertCompoundChildTask() capping.Arguments.set_state({}) meshing.workflow.TaskObject["inlet-1"].Execute() capping.Arguments.set_state( { "PatchName": "inlet-2", "SelectionType": "zone", "ZoneSelectionList": ["inlet.2"], } ) capping.Arguments.set_state( { "PatchName": "inlet-2", "SelectionType": "zone", "ZoneLocation": [ "1", "441.68205", "-361.34322", "-301.88668", "486.96205", "-332.84759", "-266.69751", "inlet.2", ], "ZoneSelectionList": ["inlet.2"], } ) capping.AddChildToTask() capping.InsertCompoundChildTask() capping.Arguments.set_state({}) meshing.workflow.TaskObject["inlet-2"].Execute() capping.Arguments.set_state( { "PatchName": "inlet-3", "SelectionType": "zone", "ZoneSelectionList": ["inlet"], } ) capping.Arguments.set_state( { "PatchName": "inlet-3", "SelectionType": "zone", "ZoneLocation": [ "1", "261.68205", "-361.34322", "-301.88668", "306.96205", "-332.84759", "-266.69751", "inlet", ], "ZoneSelectionList": ["inlet"], } ) capping.AddChildToTask() capping.InsertCompoundChildTask() capping.Arguments.set_state({}) meshing.workflow.TaskObject["inlet-3"].Execute() capping.Arguments.set_state( { "PatchName": "outlet-1", "SelectionType": "zone", "ZoneSelectionList": ["outlet"], "ZoneType": "pressure-outlet", } ) capping.Arguments.set_state( { "PatchName": "outlet-1", "SelectionType": "zone", "ZoneLocation": [ "1", "352.22702", "-197.8957", "84.102381", "394.41707", "-155.70565", "84.102381", "outlet", ], "ZoneSelectionList": ["outlet"], "ZoneType": "pressure-outlet", } ) capping.AddChildToTask() capping.InsertCompoundChildTask() capping.Arguments.set_state({}) meshing.workflow.TaskObject["outlet-1"].Execute() .. rst-class:: sphx-glr-script-out .. code-block:: none removed 128 faces. 64 boundary nodes. 0 faces removed. ---------------- Patching of inlet-1 complete. removed 128 faces. 64 boundary nodes. 0 faces removed. ---------------- Patching of inlet-2 complete. removed 128 faces. 64 boundary nodes. 0 faces removed. ---------------- Patching of inlet-3 complete. removed 128 faces. 64 boundary nodes. 0 faces removed. ---------------- Patching of outlet-1 complete. .. GENERATED FROM PYTHON SOURCE LINES 287-290 Extract edge features ~~~~~~~~~~~~~~~~~~~~~ Extract edge features. .. GENERATED FROM PYTHON SOURCE LINES 290-312 .. code-block:: Python edge_features = meshing.workflow.TaskObject["Extract Edge Features"] edge_features.Arguments.set_state( { "ExtractMethodType": "Intersection Loops", "ObjectSelectionList": ["flow_pipe", "main"], } ) edge_features.AddChildToTask() edge_features.InsertCompoundChildTask() edge_group = meshing.workflow.TaskObject["edge-group-1"] edge_group.Arguments.set_state( { "ExtractEdgesName": "edge-group-1", "ExtractMethodType": "Intersection Loops", "ObjectSelectionList": ["flow_pipe", "main"], } ) edge_features.Arguments.set_state({}) edge_group.Execute() .. rst-class:: sphx-glr-script-out .. code-block:: none S_ExtractEdges: ExtractEdgesName : edge-group-1 ExtractMethodType : Intersection Loops SelectionType : object ObjectSelectionList: (flow_pipe main) GeomObjectSelectionList: () ZoneSelectionList: () ZoneLocation:() LabelSelectionList : () FeatureAngleLocal : 40 IndividualCollective : collectively SharpAngle : 110 .. GENERATED FROM PYTHON SOURCE LINES 313-316 Identify regions ~~~~~~~~~~~~~~~~ Identify regions. .. GENERATED FROM PYTHON SOURCE LINES 316-390 .. code-block:: Python identify_regions = meshing.workflow.TaskObject["Identify Regions"] identify_regions.Arguments.set_state( { "SelectionType": "zone", "X": 377.322045740589, "Y": -176.800676988458, "Z": -37.0764628583475, "ZoneSelectionList": ["main.1"], } ) identify_regions.Arguments.set_state( { "SelectionType": "zone", "X": 377.322045740589, "Y": -176.800676988458, "Z": -37.0764628583475, "ZoneLocation": [ "1", "213.32205", "-225.28068", "-158.25531", "541.32205", "-128.32068", "84.102381", "main.1", ], "ZoneSelectionList": ["main.1"], } ) identify_regions.AddChildToTask() identify_regions.InsertCompoundChildTask() fluid_region_1 = meshing.workflow.TaskObject["fluid-region-1"] fluid_region_1.Arguments.set_state( { "MaterialPointsName": "fluid-region-1", "SelectionType": "zone", "X": 377.322045740589, "Y": -176.800676988458, "Z": -37.0764628583475, "ZoneLocation": [ "1", "213.32205", "-225.28068", "-158.25531", "541.32205", "-128.32068", "84.102381", "main.1", ], "ZoneSelectionList": ["main.1"], } ) identify_regions.Arguments.set_state({}) fluid_region_1.Execute() identify_regions.Arguments.set_state( { "MaterialPointsName": "void-region-1", "NewRegionType": "void", "ObjectSelectionList": ["inlet-1", "inlet-2", "inlet-3", "main"], "X": 374.722045740589, "Y": -278.9775145640143, "Z": -161.1700719416913, } ) identify_regions.AddChildToTask() identify_regions.InsertCompoundChildTask() identify_regions.Arguments.set_state({}) meshing.workflow.TaskObject["void-region-1"].Execute() .. rst-class:: sphx-glr-script-out .. code-block:: none S_MaterialPoints: AddChild: yes MaterialPointsName : fluid-region-1 MptMethodType : Centroid of Objects NewRegionType : fluid LinkConstruction : no SelectionType : zone ZoneSelectionList : (main.1) ZoneLocation : (1 213.32205 -225.28068 -158.25531 541.32205 -128.32068 84.102381 main.1) LabelSelectionList : () ObjectSelectionList : () GraphicalSelection : #t ShowCoordinates : #f X : 377.32205 Y : -176.80068 Z : -37.076463 OffsetX : 0 OffsetY : 0 OffsetZ : 0 Material point fluid-region-1 is created. S_MaterialPoints: AddChild: yes MaterialPointsName : void-region-1 MptMethodType : Centroid of Objects NewRegionType : void LinkConstruction : no SelectionType : object ZoneSelectionList : () ZoneLocation : () LabelSelectionList : () ObjectSelectionList : (inlet-1 inlet-2 inlet-3 main) GraphicalSelection : #t ShowCoordinates : #f X : 374.72205 Y : -278.97751 Z : -161.17007 OffsetX : 0 OffsetY : 0 OffsetZ : 0 Material point void-region-1 is created. .. GENERATED FROM PYTHON SOURCE LINES 391-394 Define thresholds for leakages ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Define thresholds for potential leakages. .. GENERATED FROM PYTHON SOURCE LINES 394-423 .. code-block:: Python leakage_threshold = meshing.workflow.TaskObject["Define Leakage Threshold"] leakage_threshold.Arguments.set_state( { "AddChild": "yes", "FlipDirection": True, "PlaneDirection": "X", "RegionSelectionSingle": "void-region-1", } ) leakage_threshold.AddChildToTask() leakage_threshold.InsertCompoundChildTask() leakage_1 = meshing.workflow.TaskObject["leakage-1"] leakage_1.Arguments.set_state( { "AddChild": "yes", "FlipDirection": True, "LeakageName": "leakage-1", "PlaneDirection": "X", "RegionSelectionSingle": "void-region-1", } ) leakage_threshold.Arguments.set_state( { "AddChild": "yes", } ) leakage_1.Execute() .. rst-class:: sphx-glr-script-out .. code-block:: none S_LeakageDetection: AddChild: yes LeakageName: leakage-1 SelectionType: identified region DeadRegionsList: () RegionSelectionSingle: (void-region-1) DeadRegionsSize: 6.4 PlaneClippingValue: 50 PlaneDirection: X FlipDirection: #t .. GENERATED FROM PYTHON SOURCE LINES 424-427 Review region settings ~~~~~~~~~~~~~~~~~~~~~~ Review the region settings. .. GENERATED FROM PYTHON SOURCE LINES 427-465 .. code-block:: Python update_region = meshing.workflow.TaskObject["Update Region Settings"] update_region.Arguments.set_state( { "AllRegionFilterCategories": ["2"] * 5 + ["1"] * 2, "AllRegionLeakageSizeList": ["none"] * 6 + ["6.4"], "AllRegionLinkedConstructionSurfaceList": ["n/a"] * 6 + ["no"], "AllRegionMeshMethodList": ["none"] * 6 + ["wrap"], "AllRegionNameList": [ "main", "flow_pipe", "outpipe3", "object2", "object1", "void-region-1", "fluid-region-1", ], "AllRegionOversetComponenList": ["no"] * 7, "AllRegionSourceList": ["object"] * 5 + ["mpt"] * 2, "AllRegionTypeList": ["void"] * 6 + ["fluid"], "AllRegionVolumeFillList": ["none"] * 6 + ["tet"], "FilterCategory": "Identified Regions", "OldRegionLeakageSizeList": [""], "OldRegionMeshMethodList": ["wrap"], "OldRegionNameList": ["fluid-region-1"], "OldRegionOversetComponenList": ["no"], "OldRegionTypeList": ["fluid"], "OldRegionVolumeFillList": ["hexcore"], "RegionLeakageSizeList": [""], "RegionMeshMethodList": ["wrap"], "RegionNameList": ["fluid-region-1"], "RegionOversetComponenList": ["no"], "RegionTypeList": ["fluid"], "RegionVolumeFillList": ["tet"], } ) update_region.Execute() .. rst-class:: sphx-glr-script-out .. code-block:: none ---------------- Regions Updated .. GENERATED FROM PYTHON SOURCE LINES 466-469 Set mesh control options ~~~~~~~~~~~~~~~~~~~~~~~~ Set mesh control options. .. GENERATED FROM PYTHON SOURCE LINES 469-472 .. code-block:: Python meshing.workflow.TaskObject["Choose Mesh Control Options"].Execute() .. rst-class:: sphx-glr-script-out .. code-block:: none (WrapSizeFieldFileName) not found in dict (TargeSizeFieldFileName) not found in dict .. GENERATED FROM PYTHON SOURCE LINES 473-476 Generate surface mesh ~~~~~~~~~~~~~~~~~~~~~ Generate the surface mesh. .. GENERATED FROM PYTHON SOURCE LINES 478-481 .. image:: /_static/exhaust_system_013.png :width: 500pt :align: center .. GENERATED FROM PYTHON SOURCE LINES 481-484 .. code-block:: Python meshing.workflow.TaskObject["Generate the Surface Mesh"].Execute() .. rst-class:: sphx-glr-script-out .. code-block:: none Writing "/mnt/pyfluent/FM_bd7bc53c03df_292/TaskObject16.msh.h5" ... writing 19 node zones writing 11 edge zones writing 13 face zones done.Writing "/mnt/pyfluent/FM_bd7bc53c03df_292//ftm-wf-out-exhaust_system.msh.h5" ... writing 19 node zones writing 11 edge zones writing 13 face zones done.Scoped sizing written to the file "/mnt/pyfluent/FM_bd7bc53c03df_292//ftm-wf-out-exhaust_system-target.szcontrol" successfully Scoped sizing written to the file "/mnt/pyfluent/FM_bd7bc53c03df_292//ftm-wf-out-exhaust_system-initial.szcontrol" successfully Reading "/mnt/pyfluent/FM_bd7bc53c03df_292//ftm-wf-out-exhaust_system-target.sf"... Read 41961 vertices initializing octree... refining octree... projecting... Wrap-v2 projection mode set to 1 Projection completed in 0.270000 s, 184240.740741 nodes/sec Index exceed valid range, 2. No grid of ID, 2. Min mesh size 0.000000 is too small.Max mesh size 0.000000 is too small. initializing octree... refining octree... Reading "/mnt/pyfluent/FM_bd7bc53c03df_292//ftm-wf-out-exhaust_system-target.sf"... Read 41961 vertices Found 0 nodes with invalid normals Found 0 nodes with invalid normals Found 0 faces with invalid dihedral angle Gentle Improve for wrapper-surf-fluid-region-1 in 0.0042075833 minutes (7.0126719e-05 hours) Gentle Improve for wrapper-surf-fluid-region-1 in 0.0014478167 minutes (2.4130609e-05 hours) Gentle Improve for wrapper-surf-fluid-region-1 in 0.0014912168 minutes (2.4853879e-05 hours) Reading "/mnt/pyfluent/FM_bd7bc53c03df_292/ftm-wf-out-exhaust_system.msh.h5" ... 3D mesh nodes: 23322 edges: 4754 faces: 33780 cells: 0 reading 19 node zones reading 11 edge zones reading 13 face zones appending mesh... done. generating pointers...done. extracting boundary entities... 37494 boundary nodes. 62114 boundary faces. 14 boundary face zones. done. Surface Mesh: ============================================================================== Wrapping Method ----------------------------------standard Computed SF in -----------------------------------0.033873665 minutes (0.00056456109 hours). Merge zones in -----------------------------------0 minutes (0 hours). Automatic closing of holes (inner wrap) in -----0.062971667 minutes (0.0010495278 hours). Wrapped all material point regions in ------------0.1958194 minutes (0.0032636567 hours). Surface mesh all fluid objects in ----------------0 minutes (0 hours). Surface Improved in ------------------------------0.052490465 minutes (0.00087484108 hours). Surface Improved (resolve_int) in ----------------0.0078614354 minutes (0.00013102392 hours). Connected all fluid mesh objects in --------------6.934007e-06 minutes (1.1556678e-07 hours). Compute Volume-Fill Regions in -------------------0 minutes (0 hours). Solid surface mesh generated and Improved in -----0 minutes (0 hours). ============================================================================== Total (surface mesh) 0.35302365 minutes (0.0058837275 hours) ------------------------- --------------------- -------------------- ---------------- ---------- name skewed-cells (> 0.80) averaged-skewness maximum-skewness face count ------------------------- --------------------- -------------------- ---------------- ---------- fluid-region-1 0 0.037448634 0.78335353 28334 ------------------------- --------------------- -------------------- ---------------- ---------- name skewed-cells (> 0.80) averaged-skewness maximum-skewness face count ------------------------- --------------------- -------------------- ---------------- ---------- Overall Summary 0 0.037448634 0.78335353 28334 .. GENERATED FROM PYTHON SOURCE LINES 485-488 Confirm and update boundaries ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Confirm and update the boundaries. .. GENERATED FROM PYTHON SOURCE LINES 488-491 .. code-block:: Python meshing.workflow.TaskObject["Update Boundaries"].Execute() .. rst-class:: sphx-glr-script-out .. code-block:: none ---------------- Boundary Conditions Updated .. GENERATED FROM PYTHON SOURCE LINES 492-495 Add boundary layers ~~~~~~~~~~~~~~~~~~~ Add boundary layers. .. GENERATED FROM PYTHON SOURCE LINES 495-509 .. code-block:: Python meshing.workflow.TaskObject["Add Boundary Layers"].AddChildToTask() meshing.workflow.TaskObject["Add Boundary Layers"].InsertCompoundChildTask() meshing.workflow.TaskObject["aspect-ratio_1"].Arguments.set_state( { "BLControlName": "aspect-ratio_1", } ) meshing.workflow.TaskObject["Add Boundary Layers"].Arguments.set_state({}) meshing.workflow.TaskObject["aspect-ratio_1"].Execute() .. GENERATED FROM PYTHON SOURCE LINES 510-513 Generate volume mesh ~~~~~~~~~~~~~~~~~~~~ Generate the volume mesh. .. GENERATED FROM PYTHON SOURCE LINES 515-518 .. image:: /_static/exhaust_system_014.png :width: 500pt :align: center .. GENERATED FROM PYTHON SOURCE LINES 518-537 .. code-block:: Python volume_mesh_gen = meshing.workflow.TaskObject["Generate the Volume Mesh"] volume_mesh_gen.Arguments.set_state( { "AllRegionNameList": [ "main", "flow_pipe", "outpipe3", "object2", "object1", "void-region-1", "fluid-region-1", ], "AllRegionSizeList": ["11.33375"] * 7, "AllRegionVolumeFillList": ["none"] * 6 + ["tet"], "EnableParallel": True, } ) volume_mesh_gen.Execute() .. rst-class:: sphx-glr-script-out .. code-block:: none Writing "/mnt/pyfluent/FM_bd7bc53c03df_292/TaskObject23.msh.h5" ... writing 21 node zones writing 11 edge zones writing 22 face zones done. Warning: growing more than 1 layer of prisms may take a long time. warning: material point fluid-region-1 ignored because face zone label with same name exists. done creating backup for object "fluid-region-1"...done. Generating initial mesh... the existing Size Field will be used. Refining mesh... All cells met the target quality. No cells below quality 0.0001. Release: (24 1 0 2024) Build Time: Nov 06 2023 14:05:00 EST Build ID: 10183 Mesh Info for exhaust_system: Total cell count: 255836 Wall-Clock Usage (Estimate) for exhaust_system: Surface Mesh: ============================================================================== Wrapping Method ----------------------------------standard Computed SF in -----------------------------------0.033873665 minutes (0.00056456109 hours). Merge zones in -----------------------------------0 minutes (0 hours). Automatic closing of holes (inner wrap) in -----0.062971667 minutes (0.0010495278 hours). Wrapped all material point regions in ------------0.1958194 minutes (0.0032636567 hours). Surface mesh all fluid objects in ----------------0 minutes (0 hours). Surface Improved in ------------------------------0.052490465 minutes (0.00087484108 hours). Surface Improved (resolve_int) in ----------------0.0078614354 minutes (0.00013102392 hours). Connected all fluid mesh objects in --------------6.934007e-06 minutes (1.1556678e-07 hours). Compute Volume-Fill Regions in -------------------0 minutes (0 hours). Solid surface mesh generated and Improved in -----0 minutes (0 hours). ============================================================================== Total (surface mesh) 0.35302365 minutes (0.0058837275 hours) Volume Mesh: ============================================================================== Quality Method -----------------------------------Orthogonal Continuous Prisms generated and Improved in ------0.058566848 minutes (0.00097611414 hours). Volume-fill in -----------------------------------0.052166768 minutes (0.00086944613 hours). Solid volume mesh generated and Improved in ------0.010260185 minutes (0.00017100308 hours). Rezoned and final volume mesh improve in ---------0.013335466 minutes (0.00022225777 hours). ============================================================================== Total (volume mesh) 0.13432927 minutes (0.0022388211 hours) ============================================================================== Total 0.48735292 minutes (0.0081225487 hours) ============================================================================== Memory Usage for exhaust_system: ------------------------------------------------------------------------------ | Virtual Mem Usage (GB) | Resident Mem Usage(GB) | ID | Current Peak | Current Peak | Page Faults ------------------------------------------------------------------------------ host | 1.1583 1.1583 | 0.526669 0.526669 | 13 n0 | 3.96191 4.45407 | 0.447308 1.14799 | 691 n1 | 3.33384 3.39042 | 0.229397 0.229397 | 163 n2 | 3.33189 3.38846 | 0.229488 0.229488 | 179 n3 | 3.33189 3.38846 | 0.230839 0.230839 | 143 ------------------------------------------------------------------------------ Total | 15.1178 15.7797 | 1.6637 2.36438 | 1189 ------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------ | Virtual Mem Usage (GB) | Resident Mem Usage(GB) | System Mem (GB) Hostname | Current Peak | Current Peak | ------------------------------------------------------------------------------------------------ bd7bc53c03df | 15.1178 15.7797 | 1.6637 2.36438 | 31.3534 ------------------------------------------------------------------------------------------------ Total | 15.1178 15.7797 | 1.6637 2.36438 | ------------------------------------------------------------------------------------------------ Quality Report for exhaust_system: Report of Cell Orthogonal Quality: Region Name Quality<0.100 Quality<0.040 Min Quality Cell Count ------------------------- -------------- -------------- ------------- ---------- fluid-region-1 2 0 0.078 255836 Region Name Quality<0.100 Quality<0.040 Min Quality Cell Count ------------------------- -------------- -------------- ------------- ---------- Overall Summary 2 0 0.078 255836 Parallel Partitions: General Info: Total faces : 600579 Total cells : 255836 Participating nodes : (0) Non-participating nodes : (1 2 3) Faces Info: node 0 : 600579 (100.0%) faces => 477699 triangular, 122880 quadrilateral Cells Info: node 0 : 255836 (100.0%) cells => 174095 tetrahedral, 81741 wedge .. GENERATED FROM PYTHON SOURCE LINES 538-541 Check mesh ~~~~~~~~~~ Check the mesh. .. GENERATED FROM PYTHON SOURCE LINES 541-544 .. code-block:: Python meshing.tui.mesh.check_mesh() .. rst-class:: sphx-glr-script-out .. code-block:: none Domain extents. x-coordinate: min = 2.133220e+02, max = 5.413220e+02. y-coordinate: min = -3.613432e+02, max = -1.283207e+02. z-coordinate: min = -3.692476e+02, max = 8.410238e+01. Volume statistics. minimum volume: 9.996647e-02. maximum volume: 3.102730e+02. total volume: 5.478863e+06. Face area statistics. minimum face area: 4.247814e-03. maximum face area: 1.743890e+04. average face area: 1.210764e+01. Checking number of nodes per edge. Checking number of nodes per face. Checking number of nodes per cell. Checking number of faces/neighbors per cell. Checking cell faces/neighbors. Checking isolated cells. Checking face handedness. Checking periodic face pairs. Checking face children. Checking face zone boundary conditions. Checking for invalid node coordinates. Checking poly cells. Checking zones. Checking neighborhood. Checking modified centroid. Checking non-positive or too small area. Checking face zones thread type. .. GENERATED FROM PYTHON SOURCE LINES 545-553 Solve and postprocess --------------------- Once you have completed the fault tolerate meshing workflow, you can solve and postprcess the results. Switch to solution mode ~~~~~~~~~~~~~~~~~~~~~~~ Switch to the solution mode. .. GENERATED FROM PYTHON SOURCE LINES 553-558 .. code-block:: Python solver = meshing.switch_to_solver() solver.tui.mesh.check() .. rst-class:: sphx-glr-script-out .. code-block:: none Done. Preparing... deleting exterior entities...done. unused zone boundary-node-216 removed unused zone boundary-node-218 removed Transferring mesh creating threads... done transferring nodes... done transferring cells... done transferring faces... done post mesh transfer operations... done done Building... mesh auto partitioning mesh by Metis (fast), distributing mesh parts...., faces...., nodes...., cells...., bandwidth reduction using Reverse Cuthill-McKee: 50516/1139 = 44.3512 materials, interface, domains, zones, outlet-1 inlet-3 inlet-2 inlet-1 interior--fluid-region-1 main.1 flow-pipe outpipe3.1 object2.1 object1.1 fluid-region-1 surfaces, parallel, Done. Mesh is now scaled to meters. Domain Extents: x-coordinate: min (m) = 2.154117e-01, max (m) = 5.347255e-01 y-coordinate: min (m) = -3.600596e-01, max (m) = -1.293207e-01 z-coordinate: min (m) = -3.627121e-01, max (m) = 8.410238e-02 Volume statistics: minimum volume (m3): 9.996647e-11 maximum volume (m3): 3.102730e-07 total volume (m3): 5.478863e-03 Face area statistics: minimum face area (m2): 2.733096e-07 maximum face area (m2): 1.000720e-04 Checking mesh..................................... Done. .. GENERATED FROM PYTHON SOURCE LINES 559-562 Select turbulence model ~~~~~~~~~~~~~~~~~~~~~~~ Select the kw sst turbulence model. .. GENERATED FROM PYTHON SOURCE LINES 562-565 .. code-block:: Python solver.tui.define.models.viscous.kw_sst("yes") .. GENERATED FROM PYTHON SOURCE LINES 566-570 Set velocity and turbulence boundary conditions for first inlet ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set the velocity and turbulence boundary conditions for the first inlet (``inlet-1``). .. GENERATED FROM PYTHON SOURCE LINES 570-575 .. code-block:: Python solver.tui.define.boundary_conditions.set.velocity_inlet( "inlet-1", [], "vmag", "no", 1, "quit" ) .. GENERATED FROM PYTHON SOURCE LINES 576-580 Set same boundary conditions for other velocity inlets ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set the same boundary conditions for the other velocity inlets (``inlet_2`` and ``inlet_3``). .. GENERATED FROM PYTHON SOURCE LINES 580-583 .. code-block:: Python solver.tui.define.boundary_conditions.copy_bc("inlet-1", "inlet-2", "inlet-3", ()) .. rst-class:: sphx-glr-script-out .. code-block:: none Copy inlet-1 boundary conditions to inlet-3 Copy inlet-1 boundary conditions to inlet-2 .. GENERATED FROM PYTHON SOURCE LINES 584-587 Set boundary conditions at outlet ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Set the boundary conditions at the outlet (``outlet-1``). .. GENERATED FROM PYTHON SOURCE LINES 587-593 .. code-block:: Python solver.tui.define.boundary_conditions.set.pressure_outlet( "outlet-1", [], "turb-intensity", 5, "quit" ) solver.tui.solve.monitors.residual.plot("yes") .. GENERATED FROM PYTHON SOURCE LINES 594-597 Initialize flow field ~~~~~~~~~~~~~~~~~~~~~ Initialize the flow field using hybrid initialization. .. GENERATED FROM PYTHON SOURCE LINES 597-600 .. code-block:: Python solver.tui.solve.initialize.hyb_initialization() .. rst-class:: sphx-glr-script-out .. code-block:: none Initialize using the hybrid initialization method. Checking case topology... -This case has both inlets & outlets -Pressure information is not available at the boundaries. Case will be initialized with constant pressure iter scalar-0 1 1.000000e+00 2 1.932504e-04 3 3.072065e-05 4 7.384762e-06 5 4.993190e-06 6 2.261922e-06 7 7.634703e-06 8 1.551114e-06 9 1.918689e-06 10 6.698705e-07 Hybrid initialization is done. .. GENERATED FROM PYTHON SOURCE LINES 601-604 Start calculation ~~~~~~~~~~~~~~~~~ Start the calculation by requesting 100 iterations. .. GENERATED FROM PYTHON SOURCE LINES 606-609 .. image:: /_static/exhaust_system_015.png :width: 500pt :align: center .. GENERATED FROM PYTHON SOURCE LINES 609-615 .. code-block:: Python solver.tui.solve.set.number_of_iterations(100) solver.tui.solve.iterate() # solver.tui.report.volume_integrals.volume("fluid-region-1","()","yes","volume.vrp") .. rst-class:: sphx-glr-script-out .. code-block:: none iter continuity x-velocity y-velocity z-velocity k omega time/iter 1 1.0000e+00 3.3747e-03 3.5496e-03 3.8879e-03 5.9662e-01 2.4579e+00 0:01:42 99 2 4.4843e-01 2.1512e-03 2.3791e-03 3.0553e-03 1.6095e-01 1.4765e-01 0:01:53 98 3 3.4787e-01 1.1010e-03 1.2948e-03 2.1256e-03 1.0276e-01 9.2822e-02 0:01:56 97 4 3.3993e-01 7.1837e-04 8.8999e-04 1.4906e-03 7.4604e-02 5.4019e-02 0:01:55 96 5 3.2087e-01 4.8486e-04 6.4559e-04 1.2817e-03 5.5200e-02 2.9959e-02 0:01:52 95 6 3.0228e-01 3.8278e-04 5.2801e-04 1.1256e-03 4.4951e-02 2.2557e-02 0:01:50 94 7 2.8837e-01 3.1703e-04 4.4783e-04 1.0610e-03 3.7404e-02 1.7487e-02 0:01:45 93 8 2.7271e-01 2.7334e-04 3.9923e-04 9.6705e-04 3.4091e-02 1.4475e-02 0:01:41 92 9 2.6211e-01 2.4886e-04 3.6715e-04 9.1776e-04 2.8666e-02 1.2071e-02 0:01:46 91 10 2.5523e-01 2.3790e-04 3.4342e-04 8.7080e-04 2.5756e-02 1.0048e-02 0:01:41 90 11 2.4400e-01 2.1305e-04 3.1187e-04 8.1049e-04 2.1579e-02 8.7373e-03 0:01:38 89 iter continuity x-velocity y-velocity z-velocity k omega time/iter 12 2.3328e-01 2.0271e-04 2.9566e-04 7.7170e-04 1.9485e-02 7.5263e-03 0:01:35 88 13 2.2296e-01 1.9097e-04 2.7732e-04 7.2598e-04 1.7314e-02 6.7138e-03 0:01:32 87 14 2.1322e-01 1.8161e-04 2.6229e-04 6.8230e-04 1.5425e-02 6.0247e-03 0:01:30 86 15 2.0469e-01 1.7673e-04 2.5078e-04 6.3911e-04 1.3773e-02 5.5486e-03 0:01:27 85 16 1.9677e-01 1.7403e-04 2.4189e-04 5.9577e-04 1.2356e-02 4.9901e-03 0:01:26 84 17 1.9042e-01 1.7748e-04 2.3788e-04 5.6255e-04 1.1197e-02 4.6191e-03 0:01:24 83 18 1.8444e-01 1.7862e-04 2.3205e-04 5.2158e-04 1.0039e-02 4.3687e-03 0:01:22 82 19 1.7907e-01 1.8307e-04 2.3126e-04 4.8903e-04 9.2296e-03 4.0765e-03 0:01:21 81 20 1.7424e-01 1.9023e-04 2.3335e-04 4.6273e-04 8.5486e-03 3.9011e-03 0:01:20 80 21 1.6929e-01 1.9454e-04 2.3510e-04 4.3470e-04 7.9571e-03 3.8049e-03 0:01:18 79 22 1.6430e-01 2.0054e-04 2.3869e-04 4.1238e-04 7.5594e-03 3.7577e-03 0:01:17 78 iter continuity x-velocity y-velocity z-velocity k omega time/iter 23 1.5917e-01 2.0492e-04 2.4168e-04 3.9257e-04 7.2670e-03 3.6226e-03 0:01:16 77 24 1.5437e-01 2.0899e-04 2.4386e-04 3.7691e-04 7.0620e-03 3.5105e-03 0:01:15 76 25 1.4950e-01 2.1057e-04 2.4323e-04 3.5998e-04 6.7742e-03 3.3675e-03 0:01:14 75 26 1.4445e-01 2.1227e-04 2.4124e-04 3.4654e-04 6.5864e-03 3.2317e-03 0:01:13 74 27 1.3925e-01 2.1100e-04 2.3651e-04 3.3228e-04 6.3110e-03 3.0914e-03 0:01:12 73 28 1.3398e-01 2.0822e-04 2.2956e-04 3.1857e-04 6.1529e-03 2.9838e-03 0:01:11 72 29 1.2937e-01 2.0717e-04 2.2362e-04 3.1016e-04 5.7986e-03 2.7904e-03 0:01:10 71 30 1.2386e-01 1.9787e-04 2.1185e-04 2.9023e-04 5.4475e-03 2.6600e-03 0:01:08 70 31 1.1903e-01 1.9048e-04 2.0195e-04 2.7760e-04 5.1253e-03 2.5253e-03 0:01:08 69 32 1.1432e-01 1.8133e-04 1.9147e-04 2.6445e-04 4.7615e-03 2.3953e-03 0:01:07 68 33 1.0941e-01 1.7100e-04 1.8002e-04 2.5175e-04 4.4296e-03 2.2286e-03 0:01:06 67 iter continuity x-velocity y-velocity z-velocity k omega time/iter 34 1.0473e-01 1.6013e-04 1.6879e-04 2.3931e-04 4.1024e-03 2.0881e-03 0:01:05 66 35 1.0006e-01 1.4926e-04 1.5749e-04 2.2684e-04 3.8016e-03 1.9646e-03 0:01:04 65 36 9.5791e-02 1.3904e-04 1.4674e-04 2.1580e-04 3.5165e-03 1.8575e-03 0:01:02 64 37 9.1643e-02 1.2885e-04 1.3613e-04 2.0424e-04 3.2952e-03 1.7471e-03 0:01:02 63 38 8.7798e-02 1.2027e-04 1.2644e-04 1.9366e-04 3.0103e-03 1.5961e-03 0:01:01 62 39 8.3711e-02 1.1145e-04 1.1736e-04 1.8273e-04 2.7301e-03 1.4388e-03 0:01:00 61 40 7.9876e-02 1.0369e-04 1.0894e-04 1.7190e-04 2.4771e-03 1.3472e-03 0:00:59 60 41 7.6359e-02 9.6897e-05 1.0136e-04 1.6172e-04 2.2678e-03 1.2367e-03 0:00:58 59 42 7.3081e-02 9.1010e-05 9.4345e-05 1.5173e-04 2.0728e-03 1.1550e-03 0:00:57 58 43 7.0054e-02 8.5702e-05 8.8063e-05 1.4273e-04 1.9093e-03 1.1012e-03 0:00:56 57 44 6.7244e-02 8.1179e-05 8.2465e-05 1.3444e-04 1.7526e-03 1.0339e-03 0:00:55 56 iter continuity x-velocity y-velocity z-velocity k omega time/iter 45 6.4726e-02 7.7276e-05 7.7753e-05 1.2697e-04 1.6418e-03 9.9042e-04 0:00:54 55 46 6.2370e-02 7.4063e-05 7.3667e-05 1.2018e-04 1.5362e-03 9.4466e-04 0:00:53 54 47 6.0180e-02 7.1478e-05 7.0295e-05 1.1447e-04 1.4601e-03 9.1668e-04 0:00:52 53 48 5.8243e-02 6.9612e-05 6.7565e-05 1.0957e-04 1.3977e-03 8.8844e-04 0:00:51 52 49 5.6491e-02 6.8047e-05 6.5359e-05 1.0523e-04 1.3491e-03 8.6618e-04 0:00:50 51 50 5.4830e-02 6.7027e-05 6.3548e-05 1.0160e-04 1.3080e-03 8.4233e-04 0:00:49 50 51 5.3310e-02 6.6002e-05 6.2226e-05 9.8402e-05 1.2774e-03 8.2306e-04 0:00:48 49 52 5.1969e-02 6.5272e-05 6.0861e-05 9.5705e-05 1.2513e-03 8.0521e-04 0:00:47 48 53 5.0805e-02 6.4598e-05 5.9977e-05 9.3837e-05 1.2382e-03 7.9260e-04 0:00:46 47 54 4.9755e-02 6.4302e-05 5.9332e-05 9.1981e-05 1.2290e-03 7.7948e-04 0:00:45 46 55 4.8809e-02 6.3857e-05 5.9111e-05 9.0978e-05 1.2271e-03 7.7279e-04 0:00:44 45 iter continuity x-velocity y-velocity z-velocity k omega time/iter 56 4.7952e-02 6.3547e-05 5.8984e-05 8.9422e-05 1.2205e-03 7.5790e-04 0:00:43 44 57 4.7186e-02 6.3230e-05 5.9159e-05 8.8652e-05 1.2191e-03 7.5412e-04 0:00:42 43 58 4.6502e-02 6.2942e-05 5.9295e-05 8.7262e-05 1.2047e-03 7.3981e-04 0:00:41 42 59 4.5867e-02 6.2534e-05 5.9582e-05 8.6432e-05 1.1955e-03 7.3924e-04 0:00:40 41 60 4.5303e-02 6.2075e-05 5.9891e-05 8.5087e-05 1.1759e-03 7.2780e-04 0:00:39 40 61 4.4769e-02 6.1654e-05 6.0284e-05 8.4336e-05 1.1649e-03 7.2768e-04 0:00:38 39 62 4.4304e-02 6.1259e-05 6.0589e-05 8.2965e-05 1.1419e-03 7.1597e-04 0:00:37 38 63 4.3743e-02 6.0654e-05 6.0858e-05 8.2096e-05 1.1284e-03 7.1213e-04 0:00:36 37 64 4.3215e-02 6.0180e-05 6.0994e-05 8.0597e-05 1.1069e-03 7.0193e-04 0:00:35 36 65 4.2692e-02 5.9534e-05 6.0997e-05 7.9477e-05 1.0969e-03 6.9587e-04 0:00:34 35 66 4.2192e-02 5.8821e-05 6.0960e-05 7.7947e-05 1.0811e-03 6.8389e-04 0:00:33 34 iter continuity x-velocity y-velocity z-velocity k omega time/iter 67 4.1711e-02 5.7864e-05 6.0895e-05 7.6694e-05 1.0711e-03 6.7742e-04 0:00:32 33 68 4.1169e-02 5.6925e-05 6.0588e-05 7.5063e-05 1.0550e-03 6.6332e-04 0:00:31 32 69 4.0509e-02 5.5662e-05 5.9961e-05 7.3705e-05 1.0452e-03 6.5790e-04 0:00:30 31 70 3.9798e-02 5.4490e-05 5.9119e-05 7.2170e-05 1.0294e-03 6.4439e-04 0:00:29 30 71 3.8964e-02 5.3366e-05 5.7966e-05 7.0982e-05 1.0175e-03 6.3742e-04 0:00:28 29 72 3.8121e-02 5.2156e-05 5.6641e-05 6.9459e-05 1.0080e-03 6.2463e-04 0:00:27 28 73 3.7287e-02 5.0838e-05 5.5226e-05 6.8280e-05 9.9459e-04 6.1700e-04 0:00:26 27 74 3.6424e-02 4.9488e-05 5.3706e-05 6.6811e-05 9.8782e-04 6.0620e-04 0:00:25 26 75 3.5584e-02 4.8253e-05 5.2174e-05 6.5812e-05 9.8210e-04 6.0313e-04 0:00:24 25 76 3.4801e-02 4.7138e-05 5.0544e-05 6.4697e-05 9.8088e-04 5.9940e-04 0:00:23 24 77 3.4032e-02 4.6082e-05 4.8979e-05 6.4208e-05 9.8476e-04 6.0264e-04 0:00:22 23 iter continuity x-velocity y-velocity z-velocity k omega time/iter 78 3.3254e-02 4.5122e-05 4.7392e-05 6.3655e-05 9.9355e-04 6.0432e-04 0:00:21 22 79 3.2510e-02 4.4330e-05 4.5949e-05 6.3620e-05 1.0058e-03 6.1320e-04 0:00:20 21 80 3.1809e-02 4.3679e-05 4.4479e-05 6.3557e-05 1.0216e-03 6.1992e-04 0:00:19 20 81 3.1132e-02 4.3169e-05 4.3200e-05 6.3915e-05 1.0490e-03 6.3527e-04 0:00:18 19 82 3.0516e-02 4.2776e-05 4.1898e-05 6.4181e-05 1.0827e-03 6.5192e-04 0:00:18 18 83 2.9886e-02 4.2438e-05 4.0803e-05 6.4496e-05 1.1055e-03 6.5924e-04 0:00:17 17 84 2.9274e-02 4.1953e-05 3.9676e-05 6.4561e-05 1.1218e-03 6.6180e-04 0:00:16 16 85 2.8642e-02 4.1336e-05 3.8633e-05 6.4513e-05 1.1333e-03 6.6076e-04 0:00:15 15 86 2.8159e-02 4.0461e-05 3.7619e-05 6.4259e-05 1.1400e-03 6.6206e-04 0:00:14 14 87 2.7370e-02 3.9530e-05 3.6538e-05 6.3592e-05 1.1410e-03 6.5456e-04 0:00:13 13 88 2.6895e-02 3.8520e-05 3.5671e-05 6.3160e-05 1.1335e-03 6.6398e-04 0:00:12 12 iter continuity x-velocity y-velocity z-velocity k omega time/iter 89 2.6058e-02 3.7293e-05 3.4426e-05 6.1854e-05 1.0967e-03 6.5180e-04 0:00:11 11 90 2.5469e-02 3.6144e-05 3.3601e-05 6.0794e-05 1.0719e-03 6.3981e-04 0:00:10 10 91 2.4834e-02 3.4866e-05 3.2657e-05 5.9237e-05 1.0572e-03 6.2658e-04 0:00:09 9 92 2.4521e-02 3.3835e-05 3.2083e-05 5.8146e-05 1.0204e-03 6.0287e-04 0:00:08 8 93 2.3664e-02 3.2530e-05 3.0826e-05 5.6056e-05 9.2884e-04 5.7879e-04 0:00:07 7 94 2.3103e-02 3.1333e-05 3.0218e-05 5.4337e-05 8.9784e-04 5.4375e-04 0:00:06 6 95 2.2588e-02 3.0195e-05 2.9137e-05 5.2114e-05 8.2817e-04 5.1424e-04 0:00:05 5 96 2.2091e-02 2.9160e-05 2.8466e-05 5.0269e-05 7.8946e-04 5.0020e-04 0:00:04 4 97 2.1756e-02 2.8275e-05 2.7660e-05 4.8248e-05 7.5376e-04 4.8563e-04 0:00:03 3 98 2.1343e-02 2.7504e-05 2.7161e-05 4.6447e-05 7.1507e-04 4.6016e-04 0:00:02 2 99 2.1008e-02 2.6947e-05 2.6613e-05 4.4602e-05 6.8550e-04 4.4722e-04 0:00:01 1 iter continuity x-velocity y-velocity z-velocity k omega time/iter .. GENERATED FROM PYTHON SOURCE LINES 616-618 Write the case and data files ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 618-621 .. code-block:: Python solver.tui.file.write_case_data("exhaust_system.cas.h5", "yes") .. rst-class:: sphx-glr-script-out .. code-block:: none Fast-loading "/ansys_inc/v241/fluent/fluent24.1.0/addons/afd/lib/hdfio.bin" Done. Writing to bd7bc53c03df:"/mnt/pyfluent/exhaust_system.cas.h5" in NODE0 mode and compression level 1 ... Grouping cells for Laplace smoothing ... 255836 cells, 1 zone ... 600579 faces, 23 zones ... 94168 nodes, 1 zone ... Done. Writing boundary layer flags ... Done. Done. Writing to bd7bc53c03df:"/mnt/pyfluent/exhaust_system.dat.h5" in NODE0 mode and compression level 1 ... Writing results. Done. .. GENERATED FROM PYTHON SOURCE LINES 622-627 Configure graphics picture export ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Since Fluent is being run without the GUI, we will need to export plots as picture files. Edit the picture settings to use a custom resolution so that the images are large enough. .. GENERATED FROM PYTHON SOURCE LINES 627-635 .. code-block:: Python picture = solver.tui.display.set.picture # use-window-container TUI option not available inside containers if not solver.connection_properties.inside_container: picture.use_window_resolution("no") picture.x_resolution("1920") picture.y_resolution("1440") .. rst-class:: sphx-glr-script-out .. code-block:: none Overwrite confirmations (/file/set-batch-options ...) are on -- will therefore ignore the following invalid command: yes .. GENERATED FROM PYTHON SOURCE LINES 636-640 Create path lines ~~~~~~~~~~~~~~~~~ Create path lines highlighting the flow field, display it, then export the image for inspection. .. GENERATED FROM PYTHON SOURCE LINES 642-645 .. image:: /_static/exhaust_system_016.png :width: 500pt :align: center .. GENERATED FROM PYTHON SOURCE LINES 645-670 .. code-block:: Python solver.tui.display.objects.create( "pathlines", "pathlines-1", "field", "time", "accuracy-control", "tolerance", "0.001", "skip", "5", "surfaces-list", "inlet-1", "inlet-2", "inlet-3", "()", "quit", ) solver.tui.display.objects.display("pathlines-1") views = solver.tui.display.views views.restore_view("isometric") views.auto_scale() solver.tui.display.save_picture("pathlines-1.png") .. rst-class:: sphx-glr-script-out .. code-block:: none number tracked = 165, escaped = 133, incomplete = 32 .. GENERATED FROM PYTHON SOURCE LINES 671-674 Create iso-surface ~~~~~~~~~~~~~~~~~~ Create an iso-surface through the manifold geometry. .. GENERATED FROM PYTHON SOURCE LINES 674-685 .. code-block:: Python solver.tui.surface.iso_surface( "x-coordinate", "surf-x-coordinate", "()", "fluid-region-1", "()", "0.38", "()", ) .. GENERATED FROM PYTHON SOURCE LINES 686-690 Create contours of velocity magnitude ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Create contours of the velocity magnitude throughout the manifold along with the mesh. Display it and export the image for inspection. .. GENERATED FROM PYTHON SOURCE LINES 692-695 .. image:: /_static/exhaust_system_017.png :width: 500pt :align: center .. GENERATED FROM PYTHON SOURCE LINES 695-721 .. code-block:: Python solver.tui.display.objects.create( "contour", "contour-velocity", "field", "velocity-magnitude", "surfaces-list", "surf-x-coordinate", "()", "node-values?", "no", "range-option", "auto-range-on", "global-range?", "no", "quit", "quit", ) solver.tui.display.objects.create("mesh", "mesh-1", "surfaces-list", "*", "()", "quit") solver.tui.display.objects.display("contour-velocity") views.restore_view("right") views.auto_scale() solver.tui.display.save_picture("contour-velocity.png") .. GENERATED FROM PYTHON SOURCE LINES 722-726 Create scene ~~~~~~~~~~~~ Create a scene containing the mesh and the contours. Display it and export the image for inspection. .. GENERATED FROM PYTHON SOURCE LINES 728-731 .. image:: /_static/exhaust_system_018.png :width: 500pt :align: center .. GENERATED FROM PYTHON SOURCE LINES 731-755 .. code-block:: Python solver.tui.display.objects.create( "scene", "scene-1", "graphics-objects", "add", "mesh-1", "transparency", "90", "quit", "add", "contour-velocity", "quit", "quit", "quit", ) solver.tui.display.objects.display("scene-1") camera = solver.tui.display.views.camera camera.position("1.70", "1.14", "0.29") camera.up_vector("-0.66", "0.72", "-0.20") views.auto_scale() solver.tui.display.save_picture("scene-1.png") .. GENERATED FROM PYTHON SOURCE LINES 756-759 Close Fluent ~~~~~~~~~~~~ Close Fluent. .. GENERATED FROM PYTHON SOURCE LINES 759-761 .. code-block:: Python solver.exit() .. rst-class:: sphx-glr-timing **Total running time of the script:** (3 minutes 42.128 seconds) .. _sphx_glr_download_examples_00-fluent_exhaust_system.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: exhaust_system.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: exhaust_system.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_