|
72 | 72 | # ~~~~~~~~~~~~~~~ |
73 | 73 | # Create a material named ``"water-liquid"``. |
74 | 74 |
|
75 | | -solver.setup.materials.copy_database_material_by_name(type="fluid", name="water-liquid") |
| 75 | +if solver.get_fluent_version() == "22.2.0": |
| 76 | + solver.setup.materials.copy_database_material_by_name( |
| 77 | + type="fluid", name="water-liquid" |
| 78 | + ) |
| 79 | +else: |
| 80 | + solver.setup.materials.database.copy_by_name(type="fluid", name="water-liquid") |
76 | 81 |
|
77 | 82 | ############################################################################### |
78 | 83 | # Set up cell zone conditions |
|
96 | 101 | # Hydraulic Diameter: 4 [inch] |
97 | 102 | # Temperature: 293.15 [K] |
98 | 103 |
|
99 | | -solver.setup.boundary_conditions.velocity_inlet["cold-inlet"].vmag = { |
100 | | - "option": "constant or expression", |
101 | | - "constant": 0.4, |
102 | | -} |
| 104 | +if solver.get_fluent_version() == "22.2.0": |
| 105 | + solver.setup.boundary_conditions.velocity_inlet["cold-inlet"].vmag = { |
| 106 | + "option": "constant or expression", |
| 107 | + "constant": 0.4, |
| 108 | + } |
| 109 | +else: |
| 110 | + solver.setup.boundary_conditions.velocity_inlet["cold-inlet"].vmag = 0.4 |
103 | 111 | solver.setup.boundary_conditions.velocity_inlet[ |
104 | 112 | "cold-inlet" |
105 | 113 | ].ke_spec = "Intensity and Hydraulic Diameter" |
106 | | -solver.setup.boundary_conditions.velocity_inlet["cold-inlet"].turb_intensity = 5 |
| 114 | +solver.setup.boundary_conditions.velocity_inlet["cold-inlet"].turb_intensity = 0.05 |
107 | 115 | solver.setup.boundary_conditions.velocity_inlet[ |
108 | 116 | "cold-inlet" |
109 | 117 | ].turb_hydraulic_diam = "4 [in]" |
110 | | -solver.setup.boundary_conditions.velocity_inlet["cold-inlet"].t = { |
111 | | - "option": "constant or expression", |
112 | | - "constant": 293.15, |
113 | | -} |
| 118 | +if solver.get_fluent_version() == "22.2.0": |
| 119 | + solver.setup.boundary_conditions.velocity_inlet["cold-inlet"].t = { |
| 120 | + "option": "constant or expression", |
| 121 | + "constant": 293.15, |
| 122 | + } |
| 123 | +else: |
| 124 | + solver.setup.boundary_conditions.velocity_inlet["cold-inlet"].t = 293.15 |
114 | 125 |
|
115 | 126 | # hot inlet (hot-inlet), Setting: Value: |
116 | 127 | # Velocity Specification Method: Magnitude, Normal to Boundary |
|
120 | 131 | # Hydraulic Diameter: 1 [inch] |
121 | 132 | # Temperature: 313.15 [K] |
122 | 133 |
|
123 | | -solver.setup.boundary_conditions.velocity_inlet["hot-inlet"].vmag = { |
124 | | - "option": "constant or expression", |
125 | | - "constant": 1.2, |
126 | | -} |
| 134 | +if solver.get_fluent_version() == "22.2.0": |
| 135 | + solver.setup.boundary_conditions.velocity_inlet["hot-inlet"].vmag = { |
| 136 | + "option": "constant or expression", |
| 137 | + "constant": 1.2, |
| 138 | + } |
| 139 | +else: |
| 140 | + solver.setup.boundary_conditions.velocity_inlet["hot-inlet"].vmag = 1.2 |
127 | 141 | solver.setup.boundary_conditions.velocity_inlet[ |
128 | 142 | "hot-inlet" |
129 | 143 | ].ke_spec = "Intensity and Hydraulic Diameter" |
130 | 144 | solver.setup.boundary_conditions.velocity_inlet[ |
131 | 145 | "hot-inlet" |
132 | 146 | ].turb_hydraulic_diam = "1 [in]" |
133 | | -solver.setup.boundary_conditions.velocity_inlet["hot-inlet"].t = { |
134 | | - "option": "constant or expression", |
135 | | - "constant": 313.15, |
136 | | -} |
| 147 | +if solver.get_fluent_version() == "22.2.0": |
| 148 | + solver.setup.boundary_conditions.velocity_inlet["hot-inlet"].t = { |
| 149 | + "option": "constant or expression", |
| 150 | + "constant": 313.15, |
| 151 | + } |
| 152 | +else: |
| 153 | + solver.setup.boundary_conditions.velocity_inlet["hot-inlet"].t = 313.15 |
137 | 154 |
|
138 | 155 | # pressure outlet (outlet), Setting: Value: |
139 | 156 | # Backflow Turbulent Intensity: 5 [%] |
|
0 commit comments