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 
62 label pRefCell = 0;
63 scalar pRefValue = 0.0;
65 mesh.setFluxRequired(p.name());
66 
67 Info<< "Creating turbulence model\n" << endl;
68 
69 singlePhaseTransportModel continuousPhaseTransport(Uc, phic);
70 
71 dimensionedScalar rhocValue
72 (
73  IOobject::groupName("rho", continuousPhaseName),
74  dimDensity,
75  continuousPhaseTransport.lookup
76  (
77  IOobject::groupName("rho", continuousPhaseName)
78  )
79 );
80 
81 volScalarField rhoc
82 (
83  IOobject
84  (
85  rhocValue.name(),
86  runTime.timeName(),
87  mesh,
88  IOobject::NO_READ,
89  IOobject::AUTO_WRITE
90  ),
91  mesh,
92  rhocValue
93 );
94 
96 (
97  IOobject
98  (
99  IOobject::groupName("mu", continuousPhaseName),
100  runTime.timeName(),
101  mesh,
102  IOobject::NO_READ,
103  IOobject::AUTO_WRITE
104  ),
105  rhoc*continuousPhaseTransport.nu()
106 );
107 
108 Info << "Creating field alphac\n" << endl;
109 // alphac must be constructed before the cloud
110 // so that the drag-models can find it
111 volScalarField alphac
112 (
113  IOobject
114  (
115  IOobject::groupName("alpha", continuousPhaseName),
116  runTime.timeName(),
117  mesh,
118  IOobject::READ_IF_PRESENT,
119  IOobject::AUTO_WRITE
120  ),
121  mesh,
122  dimensionedScalar("0", dimless, 0)
123 );
124 
125 word kinematicCloudName("kinematicCloud");
127 
128 Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
129 basicKinematicTypeCloud kinematicCloud
130 (
132  rhoc,
133  Uc,
134  muc,
135  g
136 );
137 
138 // Particle fraction upper limit
139 scalar alphacMin
140 (
141  1.0
142  - readScalar
143  (
144  kinematicCloud.particleProperties().subDict("constantProperties")
145  .lookup("alphaMax")
146  )
147 );
148 
149 // Update alphac from the particle locations
150 alphac = max(1.0 - kinematicCloud.theta(), alphacMin);
151 alphac.correctBoundaryConditions();
152 
153 surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac));
154 
155 surfaceScalarField alphaPhic
156 (
157  IOobject::groupName
158  (
159  "alphaPhi",
161  ),
162  alphacf*phic
163 );
164 
165 autoPtr<PhaseIncompressibleTurbulenceModel<singlePhaseTransportModel>>
167 (
169  (
170  alphac,
171  Uc,
172  alphaPhic,
173  phic,
174  continuousPhaseTransport
175  )
176 );
#define readScalar
Definition: doubleScalar.C:38
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
pimpleNoLoopControl & pimple
word continuousPhaseName(IOdictionary(IOobject("transportProperties", runTime.constant(), mesh, IOobject::MUST_READ)).lookup("continuousPhaseName"))
setRefCell(p, p_rgh, pimple.dict(), pRefCell, pRefValue)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > linearInterpolate(const GeometricField< Type, fvPatchField, volMesh > &vf)
Definition: linear.H:107
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());label pRefCell=0;scalar pRefValue=0.0;setRefCell(p, pimple.dict(), pRefCell, pRefValue);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("0", dimless, 0));word kinematicCloudName("kinematicCloud");args.optionReadIfPresent("cloudName", kinematicCloudName);Info<< "Constructing kinematicCloud "<< kinematicCloudName<< endl;basicKinematicTypeCloud kinematicCloud(kinematicCloudName, rhoc, Uc, muc, g);scalar alphacMin(1.0 - readScalar(kinematicCloud.particleProperties().subDict("constantProperties") .lookup("alphaMax")));alphac=max(1.0 - kinematicCloud.theta(), alphacMin);alphac.correctBoundaryConditions();surfaceScalarField alphacf("alphacf", fvc::interpolate(alphac));surfaceScalarField alphaPhic(IOobject::groupName("alphaPhi", continuousPhaseName), alphacf *phic);autoPtr< PhaseIncompressibleTurbulenceModel< singlePhaseTransportModel > > continuousPhaseTurbulence(PhaseIncompressibleTurbulenceModel< singlePhaseTransportModel >::New(alphac, Uc, alphaPhic, phic, continuousPhaseTransport))
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:55
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
Definition: argListI.H:198
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
dynamicFvMesh & mesh
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.
const dimensionSet dimDensity
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
surfaceScalarField phic(mixture.cAlpha() *mag(phi/mesh.magSf()))
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
label pRefCell
Definition: createFields.H:106
messageStream Info
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
const dimensionedVector & g
Foam::argList args(argc, argv)
word kinematicCloudName("kinematicCloud")
scalar pRefValue
Definition: createFields.H:107