Removed unnecessary return statement
[foam-extend-3.2.git] / applications / solvers / surfaceTracking / bubbleInterTrackFoam / solveBulkSurfactant.H
blob81ea9b20d57f6c74a176d8b5481e00ce02d7d337
2 if(CPtr)
4     volScalarField& C = *CPtr;
6     const dimensionedScalar& D
7         = interface.surfactant().surfactBulkDiffusion();
9     scalar ka = interface.surfactant().surfactAdsorptionCoeff().value();
10     scalar kb = interface.surfactant().surfactDesorptionCoeff().value();
11     scalar CsInf = interface.surfactant().surfactSaturatedConc().value();
13     scalarField& Cs =
14         interface.surfactantConcentration().internalField();
16     scalarField CP =
17         C.boundaryField()[interface.aPatchID()].patchInternalField();
19     const scalarField& Cfs = C.boundaryField()[interface.aPatchID()];
21     scalarField dn = 1.0/mesh.boundary()[interface.aPatchID()].deltaCoeffs();
23     if
24     (
25         C.boundaryField()[interface.aPatchID()].type()
26      == fixedGradientFvPatchScalarField::typeName
27     )
28     {
29         fixedGradientFvPatchScalarField& CA =
30             refCast<fixedGradientFvPatchScalarField>
31             (
32                 C.boundaryField()[interface.aPatchID()]
33             );
35         CA.gradient() = (ka*kb*Cs - ka*(CsInf-Cs)*Cfs)/D.value();
36     }
37     else
38     {
39         FatalErrorIn(args.executable())
40             << "Bulk concentration boundary condition "
41                 << "at the freeSurface patch is not "
42                 << fixedGradientFvPatchScalarField::typeName
43                 << exit(FatalError);
44     }
46     solve
47     (
48         fvm::ddt(C)
49       + fvm::div(phi - fvc::meshPhi(rho,U), C, "div(phi,C)")
50       - fvm::laplacian(D, C, "laplacian(D,C)")
51     );
53     CP = C.boundaryField()[interface.aPatchID()].patchInternalField();
55 //     Info << gMax(CP) << ", "<< gAverage(CP) << endl;