4 if (interface.twoFluids())
6 Cb = gSum((1.0 - fluidIndicator.internalField())*
7 mesh.C().internalField()*mesh.V())/
8 gSum((1.0 - fluidIndicator.internalField())*mesh.V());
12 scalar Va = gSum(mesh.V().field());
13 vector Ra = gSum(mesh.C().internalField()*mesh.V().field())/Va;
18 mesh.Cf().boundaryField()[interface.aPatchID()]
19 & mesh.Sf().boundaryField()[interface.aPatchID()]
24 Cb = (V*Cbf - Va*Ra)/Vb;
26 if (mesh.nGeometricD() != 3)
28 FatalErrorIn(args.executable())
29 << "One-fluid bubble centroid calc "
30 << "is not implemented for 2d mesh"
35 Info << "\nCurrent bubble centre: " << Cb << endl;
41 lambdaFf*(Cb-Cbf)/runTime.deltaT0().value()
42 + lambdaF0*(Cb-Cb0)/runTime.deltaT0().value()
45 XF += (UF + 0.5*dUF)*runTime.deltaT0();
46 Info << "Current bubble position: " << XF << endl;
48 // dimensionedVector UF00 ("UF00", dimVelocity, UF0.value());
51 Info << "Current bubble velocity: " << UF << endl;
53 aF = dUF/runTime.deltaT0();
54 // aF = (3.0*UF - 4.0*UF0 + UF00)/(2.0*runTime.deltaT0());
55 Info << "Current bubble acceleration: " << aF << endl;
59 U.boundaryField()[spacePatchID].type()
60 == inletOutletFvPatchVectorField::typeName
63 inletOutletFvPatchVectorField& spaceU =
64 refCast<inletOutletFvPatchVectorField>
66 U.boundaryField()[spacePatchID]
69 spaceU.refValue() = -UF.value();
73 FatalErrorIn(args.executable())
74 << "Velocity boundary condition at space patch is not "
75 << inletOutletFvPatchVectorField::typeName
79 // Update movingReferenceFrame dictionary
80 if (movingReferenceFrame.found("Cb"))
82 movingReferenceFrame.remove("Cb");
84 movingReferenceFrame.add("Cb", Cb);
86 if (movingReferenceFrame.found("Cbf"))
88 movingReferenceFrame.remove("Cbf");
90 movingReferenceFrame.add("Cbf", Cbf);
92 if (movingReferenceFrame.found("XF"))
94 movingReferenceFrame.remove("XF");
96 movingReferenceFrame.add("XF", XF);
98 if (movingReferenceFrame.found("UF"))
100 movingReferenceFrame.remove("UF");
102 movingReferenceFrame.add("UF", UF);
104 if (movingReferenceFrame.found("aF"))
106 movingReferenceFrame.remove("aF");
109 movingReferenceFrame.add("aF", aF);