calculateCatchRatio.H
Go to the documentation of this file.
1 Info<< nl << "Calculating specific catch ratio fields\n" << endl;
2 for (int phase_no = 0; phase_no < phases.size(); phase_no++)
3 {
4  string phase_scrname = "scr";
5  string phase_no_str;
6  std::stringstream convert;
7  convert << phase_no+1;
8  phase_no_str = convert.str();
9  phase_scrname.append(phase_no_str);
10 
11  surfaceScalarField normalvel
12  (
13  IOobject
14  (
15  "normalvel",
16  runTime.timeName(),
17  mesh,
18  IOobject::NO_READ,
19  IOobject::NO_WRITE
20  ),
21  mag( (mesh.Sf()/mesh.magSf()) & fvc::interpolate(Urain[phase_no]) )
22  );
23 
24  volScalarField scrtemp
25  (
26  IOobject
27  (
28  phase_scrname,
29  runTime.timeName(),
30  mesh,
31  IOobject::NO_READ,
32  IOobject::NO_WRITE
33  ),
34  (fvc::average(normalvel) * alpharain[phase_no]) * ((3600*1E3)/(Rh*phases[phase_no][1]))
35  );
36  scr.set(phase_no,scrtemp);
37  scr[phase_no].internalField()=scalar(0);
38  scr[phase_no].write();
39 }
40 
41 Info<< nl << "Calculating catch ratio field\n" << endl;
42 
43 volScalarField gcr //initialize global catch ratio field
44 (
45  IOobject
46  (
47  "gcr",
48  runTime.timeName(),
49  mesh,
50  IOobject::NO_READ,
51  IOobject::NO_WRITE
52  ),
53  scr[0]*phases[0][1]
54 );
55 
56 for (int phase_no = 1; phase_no < phases.size(); phase_no++)
57 {
58  gcr += scr[phase_no]*phases[phase_no][1];
59 }
60 gcr.write();
Foam::MULES::interpolate
tmp< surfaceScalarField > interpolate(const RhoType &rho)
Definition: IMULESTemplates.C:40
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::mag
dimensioned< scalar > mag(const dimensioned< Type > &)
Foam::fvc::average
tmp< GeometricField< Type, fvPatchField, volMesh > > average(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Area-weighted average a surfaceField creating a volField.
Definition: fvcAverage.C:46
scr
PtrList< volScalarField > scr
Definition: createRainFields.H:7
Foam::nl
static const char nl
Definition: Ostream.H:260
Foam::Info
messageStream Info
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
alpharain
PtrList< volScalarField > alpharain
Definition: createRainFields.H:5
Urain
PtrList< volVectorField > Urain
Definition: createRainFields.H:1
Foam::surfaceScalarField
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Definition: surfaceFieldsFwd.H:52
phases
multiphaseSystem::phaseModelList & phases
Definition: createFields.H:11