I'm no programmer, but even I can copy the named surface lines from the CCX input file into EXCEL and extract the element and face id and write the *Film or *Radiate command line in VBA. Then copy and paste the *FILM column back into the CCX input. This seems pretty easy to do in MECWAY.
*SURFACE,NAME=Top_of_Ceramic |
F or R |
F |
*FILM |
19220,S2 |
|
Temp |
1100 |
19220,F2,1100,100 |
19222,S2 |
|
HTC |
100 |
19222,F2,1100,100 |
19224,S2 |
|
|
|
19224,F2,1100,100 |
19226,S2 |
|
|
|
19226,F2,1100,100 |
19228,S2 |
|
|
|
19228,F2,1100,100 |
19230,S2 |
|
|
|
19230,F2,1100,100 |
19232,S2 |
|
|
|
19232,F2,1100,100 |
Sub CommandButton1_Click()
'Routine to read surface from Calculix Input file and write Convection or Radiation command lines
Dim Surface, Temp, Coeff As String
Film = Cells(1, 4)
Temp = Cells(2, 4)
Coeff = Cells(3, 4)
If Film = "F" Then
Cells(1, 5) = "*FILM"
End If
If Film = "R" Then
Cells(1, 5) = "*RADIATE"
End If
i = 1
Do
Surface = Cells(i + 1, 1)
Space1 = InStr(1, Surface, ",")
Elem = Left(Surface, Space1)
Face = Mid(Surface, Space1 + 2, Space1 + 2)
If Surface <> "" Then
Cells(i + 1, 5) = Elem & Film & Face & "," & Temp & "," & Coeff
End If
i = i + 1
Loop While Surface <> ""
End Sub
Comments