createFields.H
Go to the documentation of this file.
1 #include "readGravitationalAcceleration.H"
2 
4 (
5  IOdictionary
6  (
7  IOobject
8  (
9  "transportProperties",
10  runTime.constant(),
11  mesh,
12  IOobject::MUST_READ
13  )
14  ).lookup("continuousPhaseName")
15 );
16 
17 Info<< "Reading field U\n" << endl;
19 (
20  IOobject
21  (
22  IOobject::groupName("U", continuousPhaseName),
23  runTime.timeName(),
24  mesh,
25  IOobject::MUST_READ,
26  IOobject::AUTO_WRITE
27  ),
28  mesh
29 );
30 
31 Info<< "Reading field p\n" << endl;
33 (
34  IOobject
35  (
36  "p",
37  runTime.timeName(),
38  mesh,
39  IOobject::MUST_READ,
40  IOobject::AUTO_WRITE
41  ),
42  mesh
43 );
44 
45 
46 Info<< "Reading/calculating continuous-phase face flux field phic\n"
47  << endl;
48 
50 (
51  IOobject
52  (
53  IOobject::groupName("phi", continuousPhaseName),
54  runTime.timeName(),
55  mesh,
56  IOobject::READ_IF_PRESENT,
57  IOobject::AUTO_WRITE
58  ),
59  linearInterpolate(Uc) & mesh.Sf()
60 );
61 
63 
64 mesh.setFluxRequired(p.name());
65 
66 Info<< "Creating turbulence model\n" << endl;
67 
68 singlePhaseTransportModel continuousPhaseTransport(Uc, phic);
69 
70 dimensionedScalar rhocValue
71 (
72  IOobject::groupName("rho", continuousPhaseName),
73  dimDensity,
74  continuousPhaseTransport.lookup
75  (
76  IOobject::groupName("rho", continuousPhaseName)
77  )
78 );
79 
80 volScalarField rhoc
81 (
82  IOobject
83  (
84  rhocValue.name(),
85  runTime.timeName(),
86  mesh,
87  IOobject::NO_READ,
88  IOobject::AUTO_WRITE
89  ),
90  mesh,
91  rhocValue
92 );
93 
95 (
96  IOobject
97  (
98  IOobject::groupName("mu", continuousPhaseName),
99  runTime.timeName(),
100  mesh,
101  IOobject::NO_READ,
102  IOobject::AUTO_WRITE
103  ),
104  rhoc*continuousPhaseTransport.nu()
105 );
106 
107 Info << "Creating field alphac\n" << endl;
108 // alphac must be constructed before the cloud
109 // so that the drag-models can find it
110 volScalarField alphac
111 (
112  IOobject
113  (
114  IOobject::groupName("alpha", continuousPhaseName),
115  runTime.timeName(),
116  mesh,
117  IOobject::READ_IF_PRESENT,
118  IOobject::AUTO_WRITE
119  ),
120  mesh,
122 );
123 
124 Info<< "Constructing clouds" << endl;
125 parcelCloudList clouds(rhoc, Uc, muc, g);
126 
127 // Particle fraction upper limit
128 scalar alphacMin
129 (
130  1 - mesh.solverDict(alphac.name()).lookup<scalar>("max")
131 );
132 
133 // Update alphac from the particle locations
134 alphac = max(1.0 - clouds.theta(), alphacMin);
135 alphac.correctBoundaryConditions();
136 
137 surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac));
138 
139 surfaceScalarField alphaPhic
140 (
141  IOobject::groupName
142  (
143  "alphaPhi",
145  ),
146  alphacf*phic
147 );
148 
149 autoPtr<phaseIncompressible::momentumTransportModel> continuousPhaseTurbulence
150 (
152  (
153  alphac,
154  Uc,
155  alphaPhic,
156  phic,
157  continuousPhaseTransport
158  )
159 );
160 
161 #include "createFvModels.H"
162 #include "createFvConstraints.H"
pimpleNoLoopControl & pimple
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > linearInterpolate(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: linear.H:108
pressureReference pressureReference(mixture.p(), p_rgh, pimple.dict(), false)
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
const dimensionSet dimless
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:58
Info<< "Reading field U\"<< endl;volVectorField Uc(IOobject(IOobject::groupName("U", continuousPhaseName), runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading field p\"<< endl;volScalarField p(IOobject("p", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE), mesh);Info<< "Reading/calculating continuous-phase face flux field phic\"<< endl;surfaceScalarField phic(IOobject(IOobject::groupName("phi", continuousPhaseName), runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), linearInterpolate(Uc) &mesh.Sf());pressureReference pressureReference(p, pimple.dict());mesh.setFluxRequired(p.name());Info<< "Creating turbulence model\"<< endl;singlePhaseTransportModel continuousPhaseTransport(Uc, phic);dimensionedScalar rhocValue(IOobject::groupName("rho", continuousPhaseName), dimDensity, continuousPhaseTransport.lookup(IOobject::groupName("rho", continuousPhaseName)));volScalarField rhoc(IOobject(rhocValue.name(), runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), mesh, rhocValue);volScalarField muc(IOobject(IOobject::groupName("mu", continuousPhaseName), runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), rhoc *continuousPhaseTransport.nu());Info<< "Creating field alphac\"<< endl;volScalarField alphac(IOobject(IOobject::groupName("alpha", continuousPhaseName), runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE), mesh, dimensionedScalar(dimless, 0));Info<< "Constructing clouds"<< endl;parcelCloudList clouds(rhoc, Uc, muc, g);scalar alphacMin(1 - mesh.solverDict(alphac.name()).lookup< scalar >"max"));alphac=max(1.0 - clouds.theta(), alphacMin);alphac.correctBoundaryConditions();surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac));surfaceScalarField alphaPhic(IOobject::groupName("alphaPhi", continuousPhaseName), alphacf *phic);autoPtr< phaseIncompressible::momentumTransportModel > continuousPhaseTurbulence(phaseIncompressible::momentumTransportModel::New(alphac, Uc, alphaPhic, phic, continuousPhaseTransport))
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
dynamicFvMesh & mesh
phic
Definition: correctPhic.H:2
autoPtr< BasicCompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleMomentumTransportModel::transportModel &transport)
const dimensionSet dimDensity
volScalarField & p
Definition: createFields.H:23
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
word continuousPhaseName(IOdictionary(IOobject("transportProperties", runTime.constant(), mesh, IOobject::MUST_READ)).lookup("continuousPhaseName"))
messageStream Info
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
const dimensionedVector & g