chtMultiRegionFoam求解器- 文集 哔哩哔哩专栏

实际案例

案例典型结构

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
~/O/OpenFOAM-v23/t/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater > tree -L 3                                                                                                                                                                                                                      17:35:59
.
├── 0.orig
│ ├── T
│ ├── U
│ ├── alphat
│ ├── epsilon
│ ├── k
│ ├── p
│ ├── p_rgh
│ └── rho
├── Allclean
├── Allrun -> Allrun-parallel
├── Allrun-parallel
├── Allrun-serial
├── constant
│ ├── bottomAir
│ │ ├── radiationProperties
│ │ ├── thermophysicalProperties
│ │ └── turbulenceProperties
│ ├── g
│ ├── heater
│ │ ├── radiationProperties
│ │ └── thermophysicalProperties
│ ├── leftSolid
│ │ ├── radiationProperties -> ../heater/radiationProperties
│ │ └── thermophysicalProperties -> ../heater/thermophysicalProperties
│ ├── regionProperties
│ ├── rightSolid
│ │ ├── radiationProperties -> ../heater/radiationProperties
│ │ └── thermophysicalProperties -> ../heater/thermophysicalProperties
│ └── topAir
│ ├── radiationProperties -> ../bottomAir/radiationProperties
│ ├── thermophysicalProperties -> ../bottomAir/thermophysicalProperties
│ └── turbulenceProperties -> ../bottomAir/turbulenceProperties
└── system
├── blockMeshDict
├── bottomAir
│ ├── changeDictionaryDict
│ ├── decomposeParDict -> ../decomposeParDict
│ ├── fvSchemes
│ └── fvSolution
├── controlDict
├── decomposeParDict
├── decomposeParDict.6
├── fvSchemes
├── fvSolution
├── heater
│ ├── changeDictionaryDict
│ ├── decomposeParDict -> ../decomposeParDict
│ ├── fvSchemes
│ └── fvSolution
├── leftSolid
│ ├── changeDictionaryDict
│ ├── decomposeParDict -> ../heater/decomposeParDict
│ ├── fvSchemes -> ../heater/fvSchemes
│ └── fvSolution
├── meshQualityDict
├── rightSolid
│ ├── changeDictionaryDict
│ ├── decomposeParDict -> ../heater/decomposeParDict
│ ├── fvSchemes -> ../heater/fvSchemes
│ └── fvSolution
├── snappyHexMeshDict
├── surfaceFeatureExtractDict
└── topAir
├── changeDictionaryDict
├── decomposeParDict -> ../bottomAir/decomposeParDict
├── fvSchemes -> ../bottomAir/fvSchemes
└── fvSolution

13 directories, 55 files

案例典型执行流程

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------

mkdir -p constant/triSurface

cp -f "$FOAM_TUTORIALS"/resources/geometry/geom.stl.gz constant/triSurface

rm -rf constant/polyMesh/sets

# For meshing only
decompDict="-decomposeParDict system/decomposeParDict.6"

runApplication blockMesh

runApplication surfaceFeatureExtract

runApplication $decompDict decomposePar

runParallel $decompDict snappyHexMesh -overwrite

# Restore initial fields
restore0Dir -processor

runParallel $decompDict splitMeshRegions -cellZones -overwrite

# Remove fluid fields from solid regions (important for post-processing)
for region in $(foamListRegions solid)
do
rm -f 0/"$region"/{nut,alphat,epsilon,k,U,p_rgh}
rm -f processor*/0/"$region"/{nut,alphat,epsilon,k,U,p_rgh}
done

for region in $(foamListRegions)
do
runParallel $decompDict -s "$region" changeDictionary -region $region
done

# Redistribute onto fewer processors, with special treatment for heater
for region in $(foamListRegions)
do
runParallel -np 6 -s redist-"$region" \
redistributePar -overwrite -region "$region"
done

#-- Run in parallel
runParallel $(getApplication)

# Reconstruct
for region in $(foamListRegions)
do
runParallel -s reconstruct-"$region" \
redistributePar -reconstruct -region "$region"
done

#------------------------------------------------------------------------------

与multiRegionReactingFoam的区别

TonkomoLLC/multiRegionReactingFoam: OpenFOAM transient solver for laminar or turbulent fluid flow and solid heat conduction with conjugate heat transfer between solid and fluid regions, plus combustion with chemical reactions (psi thermo model)

The main difference with chtMultiRegionReactingFoam is the form of PEqn.H. PEqn in chtMultiRegionReactingFoam is based on PEqn from chtMultiRegionFoam, while PEqn in multiRegionReactingFoam is based on reactingFoam. One may find multiRegionReactingFoam to be better than chtMultiRegionReactingFoam for some situations, especially where there are large pressure changes during the simulation.