-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitfields_step2d.jl
56 lines (37 loc) · 1.31 KB
/
initfields_step2d.jl
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
function createFields2d(testMesh::mesh2d_Int32, thermo::THERMOPHYSICS)
densityCells = zeros(Float64,testMesh.nCells);
UxCells = zeros(Float64,testMesh.nCells);
UyCells = zeros(Float64,testMesh.nCells);
pressureCells = zeros(Float64,testMesh.nCells);
aSoundCells = zeros(Float64,testMesh.nCells); #speed of sound
VMAXCells = zeros(Float64,testMesh.nCells); #max speed in domain
densityNodes = zeros(Float64,testMesh.nNodes);
UxNodes = zeros(Float64,testMesh.nNodes);
UyNodes = zeros(Float64,testMesh.nNodes);
pressureNodes = zeros(Float64,testMesh.nNodes);
for i=1:testMesh.nCells
densityCells[i] = 1.4;
UxCells[i] = 300.0;
UyCells[i] = 0.0;
pressureCells[i] = 10000.0;
aSoundCells[i] = sqrt( thermo.Gamma * pressureCells[i]/densityCells[i] );
VMAXCells[i] = sqrt( UxCells[i]*UxCells[i] + UyCells[i]*UyCells[i] ) + aSoundCells[i];
#entropyCell[i] = UphysCells[i,1]/(thermo.Gamma-1.0)*log(UphysCells[i,4]/UphysCells[i,1]*thermo.Gamma);
end
# create fields
testFields2d = fields2d(
densityCells,
UxCells,
UyCells,
pressureCells,
aSoundCells,
VMAXCells,
densityNodes,
UxNodes,
UyNodes,
pressureNodes
#UconsCellsOld,
#UconsCellsNew
);
return testFields2d;
end