Removed unneeded lib dependency from mdInitialise
[foam-extend-3.2.git] / applications / solvers / surfaceTracking / bubbleInterTrackFoam / createSurfactantConcentrationField.H
blob8ac7bb8972b459e4a2aa32cb3dce1c037fb2085f
2 // Volume surfactant concentration
4 volScalarField* CPtr = NULL;
6 if(!interface.cleanInterface() && interface.surfactant().soluble())
8     Info << "\nReading field C\n" << endl;
9     CPtr = new volScalarField
10     (
11         IOobject
12         (
13             "C",
14             runTime.timeName(),
15             mesh,
16             IOobject::MUST_READ,
17             IOobject::AUTO_WRITE
18         ),
19         mesh
20     );
22     if(runTime.timeIndex() == 0)
23     {
24         const dimensionedScalar& CA =
25             interface.surfactant().surfactBulkConc();
27         dimensionedScalar CB("CB", CA.dimensions(), 0);
29         (*CPtr) = fluidIndicator*(CA - CB) + CB;
31         if
32         (
33             CPtr->boundaryField()[spacePatchID].type()
34          == inletOutletFvPatchScalarField::typeName
35         )
36         {
37             inletOutletFvPatchScalarField& spaceC =
38                 refCast<inletOutletFvPatchScalarField>
39                 (
40                     CPtr->boundaryField()[spacePatchID]
41                 );
43             spaceC.refValue() = CA.value();
44         }
45         else
46         {
47             FatalErrorIn(args.executable())
48                 << "Boundary condition for bulk surfactant concentration at "
49                     << "space patch isn't and should be: "
50                     << inletOutletFvPatchScalarField::typeName
51                     << abort(FatalError);
52         }
54         CPtr->correctBoundaryConditions();
56         CPtr->write();
57     }