FreeFOAM The Cross-Platform CFD Toolkit
createFields.H
Go to the documentation of this file.
1  Info<< "Reading field p\n" << endl;
3  (
4  IOobject
5  (
6  "p",
7  runTime.timeName(),
8  mesh,
9  IOobject::MUST_READ,
10  IOobject::AUTO_WRITE
11  ),
12  mesh
13  );
14 
16  (
17  IOobject
18  (
19  "rho",
20  runTime.timeName(),
21  mesh,
22  IOobject::MUST_READ,
23  IOobject::AUTO_WRITE
24  ),
25  mesh
26  );
27 
28  volScalarField gamma
29  (
30  IOobject
31  (
32  "gamma",
33  runTime.timeName(),
34  mesh,
35  IOobject::NO_READ,
36  IOobject::AUTO_WRITE
37  ),
38  max(min((rho - rholSat)/(rhovSat - rholSat), scalar(1)), scalar(0))
39  );
40  gamma.oldTime();
41 
42  Info<< "Creating compressibilityModel\n" << endl;
43  autoPtr<barotropicCompressibilityModel> psiModel =
44  barotropicCompressibilityModel::New
45  (
46  thermodynamicProperties,
47  gamma
48  );
49 
50  const volScalarField& psi = psiModel->psi();
51 
52  rho == max
53  (
54  psi*p
55  + (1.0 - gamma)*rhol0
56  + ((gamma*psiv + (1.0 - gamma)*psil) - psi)*pSat,
57  rhoMin
58  );
59 
60  Info<< "Reading field U\n" << endl;
62  (
63  IOobject
64  (
65  "U",
66  runTime.timeName(),
67  mesh,
68  IOobject::MUST_READ,
69  IOobject::AUTO_WRITE
70  ),
71  mesh
72  );
73 
74  #include <finiteVolume/createPhiv.H>
76 
77  Info<< "Reading transportProperties\n" << endl;
78 
79  twoPhaseMixture twoPhaseProperties(U, phiv, "gamma");
80 
81  // Create incompressible turbulence model
82  autoPtr<incompressible::turbulenceModel> turbulence
83  (
84  incompressible::turbulenceModel::New(U, phiv, twoPhaseProperties)
85  );