Debian Codegraph @

pkg/openfoam/coupling/Solvers/pimpleFoamYadev2312/pimpleFoamYade.C

raw
1 /*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration | Website: https://openfoam.org
5 \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation
6 \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9 This file is part of OpenFOAM.
10
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
15
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23
24 Application
25 DPMFoam
26
27 Description
28 Transient solver for the coupled transport of a single kinematic particle
29 cloud including the effect of the volume fraction of particles on the
30 continuous phase.
31
32 \*---------------------------------------------------------------------------*/
33
34 #include "fvCFD.H"
35 #include "singlePhaseTransportModel.H"
36 #include "DPMIncompressibleTurbulenceModel.H"
37 #include "pimpleControl.H"
38 #include "../../FoamYade/FoamYade.H"
39
40 int main(int argc, char *argv[])
41 {
42
43 #include "postProcess.H"
44
45 #include "setRootCaseLists.H"
46 #include "createTime.H"
47 #include "createMesh.H"
48 #include "createControl.H"
49 #include "createTimeControls.H"
50 #include "createFields.H"
51 #include "initContinuityErrs.H"
52
53 bool gaussianInterp = true;
54 FoamYade yadeCoupling(mesh,Uc, gradP, vGrad, divT,ddtU_f,g,uSourceDrag,alphac, uSource, uParticle, uCoeff,uInterp, gaussianInterp);
55 yadeCoupling.setScalarProperties(partDensity.value(), rhocValue.value(), nuValue.value());
56
57 Info<< "\nStarting time loop\n" << endl;
58
59 while (runTime.run())
60 {
61 #include "readTimeControls.H"
62 #include "CourantNo.H"
63 #include "setDeltaT.H"
64
65 runTime++;
66
67 Info<< "Time = " << runTime.timeName() << nl << endl;
68
69 continuousPhaseTransport.correct();
70 muc = rhoc*continuousPhaseTransport.nu();
71
72 ddtU_f = fvc::ddt(Uc)+fvc::div(phic, Uc);
73 gradP = fvc::grad(p);
74 divT = 2*nuValue.value()*fvc::laplacian(alphac, Uc);
75 vGrad = fvc::grad(Uc);
76
77 yadeCoupling.setParticleAction(runTime.deltaT().value());
78
79
80
81 // Update continuous phase volume fraction field
82 alphac.correctBoundaryConditions();
83 alphacf = fvc::interpolate(alphac);
84 alphaPhic = alphacf * phic;
85
86 uSource.correctBoundaryConditions();
87 uSourceDrag.correctBoundaryConditions();
88
89 // --- Pressure-velocity PIMPLE corrector loop
90 while (pimple.loop())
91 {
92 #include "UcEqn.H"
93
94 // --- PISO loop
95 while (pimple.correct())
96 {
97 #include "pEqn.H"
98 }
99
100 if (pimple.turbCorr())
101 {
102 continuousPhaseTurbulence->correct();
103 }
104 }
105
106 runTime.write();
107
108 yadeCoupling.setSourceZero();
109
110 Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
111 << " ClockTime = " << runTime.elapsedClockTime() << " s"
112 << nl << endl;
113 }
114
115 Info<< "End\n" << endl;
116
117 return 0;
118 }
119
120
121 // ************************************************************************* //