Skip to content

Commit 45e14b7

Browse files
authored
small changes to the new HS solver (#310)
1 parent c451018 commit 45e14b7

4 files changed

Lines changed: 26 additions & 29 deletions

File tree

applications/solvers/dfHighSpeedFoam/createFields.H

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ if (mesh.schemesDict().readIfPresent("timeScheme", ddtSchemes))
99
}
1010
}
1111

12-
word chemScheme("RR");
12+
word chemScheme("ode");
1313
mesh.schemesDict().readIfPresent("chemScheme", chemScheme);
1414

15-
if ((chemScheme == "wrate") || (chemScheme == "RR"))
15+
if ((chemScheme == "direct") || (chemScheme == "ode"))
1616
{
1717
Info<< "chemScheme: " << chemScheme << endl;
1818
}
@@ -21,24 +21,23 @@ else
2121
FatalErrorInFunction
2222
<< "chemScheme: " << chemScheme
2323
<< " is not a valid choice. "
24-
<< "Options are: wrate, RR"
24+
<< "Options are: 'ode' | 'direct'"
2525
<< abort(FatalError);
2626
}
2727

2828

2929
if((ddtSchemes != "RK2SSP") && (ddtSchemes != "RK3SSP"))
3030
{
31-
if(chemScheme == "wrate")
31+
if(chemScheme == "direct")
3232
{
3333
FatalErrorInFunction
3434
<< "This combination is not a valid choice. "
35-
<< "If you want to use wrate for chemistry, please use RK2SSP or RK3SSP scheme."
35+
<< "If you want to use direct integrate for chemistry, please use RK2SSP or RK3SSP scheme."
3636
<< abort(FatalError);
3737
}
3838
}
3939

4040

41-
4241
Info<< "Reading thermophysical properties\n" << endl;
4342

4443
// psiThermo* pThermo = new hePsiThermo<psiThermo, CanteraMixture>(mesh, word::null);

applications/solvers/dfHighSpeedFoam/createFields_rk2.H renamed to applications/solvers/dfHighSpeedFoam/createFieldsSave.H

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,22 @@ forAll(rhoYi_save,i)
2525
);
2626
}
2727

28+
List<scalar> rkcoe1(3);
29+
List<scalar> rkcoe2(3);
30+
List<scalar> rkcoe3(3);
31+
scalar rk=2;
32+
label nrk=0;
33+
34+
if(ddtSchemes == "RK2SSP")
35+
{
36+
rkcoe1[0]=1.0; rkcoe2[0]=0.0; rkcoe3[0]=1.0;
37+
rkcoe1[1]=0.5; rkcoe2[1]=0.5; rkcoe3[1]=0.5;
38+
rkcoe1[2]=0.0; rkcoe2[2]=0.0; rkcoe3[2]=0.0;
39+
}
40+
else if(ddtSchemes == "RK3SSP")
41+
{
42+
rkcoe1[0]=1.0; rkcoe2[0]=0.0; rkcoe3[0]=1.0;
43+
rkcoe1[1]=0.75; rkcoe2[1]=0.25; rkcoe3[1]=0.25;
44+
rkcoe1[2]=0.33; rkcoe2[2]=0.66; rkcoe3[2]=0.66;
45+
rk=3;
46+
}

applications/solvers/dfHighSpeedFoam/dfHighSpeedFoam.C

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int main(int argc, char *argv[])
7676
#include "createTime.H"
7777
#include "createDynamicFvMesh.H"
7878
#include "createFields.H"
79-
#include "createFields_rk2.H"
79+
#include "createFieldsSave.H"
8080
#include "createTimeControls.H"
8181

8282
double time_monitor_flow=0;
@@ -98,27 +98,6 @@ int main(int argc, char *argv[])
9898
scalar CoNum = 0.0;
9999
scalar meanCoNum = 0.0;
100100

101-
std::vector<double> rkcoe1(3);
102-
std::vector<double> rkcoe2(3);
103-
std::vector<double> rkcoe3(3);
104-
scalar rk;
105-
label nrk=0;
106-
107-
if(ddtSchemes == "RK2SSP")
108-
{
109-
rkcoe1[0]=1.0; rkcoe2[0]=0.0; rkcoe3[0]=1.0;
110-
rkcoe1[1]=0.5; rkcoe2[1]=0.5; rkcoe3[1]=0.5;
111-
rkcoe1[2]=0.0; rkcoe2[2]=0.0; rkcoe3[2]=0.0;
112-
rk=2;
113-
}
114-
else if(ddtSchemes == "RK3SSP")
115-
{
116-
rkcoe1[0]=1.0; rkcoe2[0]=0.0; rkcoe3[0]=1.0;
117-
rkcoe1[1]=0.75; rkcoe2[1]=0.25; rkcoe3[1]=0.25;
118-
rkcoe1[2]=0.33; rkcoe2[2]=0.66; rkcoe3[2]=0.66;
119-
rk=3;
120-
}
121-
122101
Info<< "\nStarting time loop\n" << endl;
123102

124103
while (runTime.run())

examples/dfHighSpeedFoam/twoD_detonationH2/Allrun

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ cp -r 0_orig/ 0/
1010
runApplication blockMesh
1111
runApplication setFields
1212
runApplication decomposePar
13-
runApplication mpirun -np 4 $application -parallel
13+
runApplication mpirun -np 4 --allow-run-as-root $application -parallel

0 commit comments

Comments
 (0)