This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/surfaceTracking/bubbleInterTrackFoam/createSurfactantConcentrationField.H

59 lines
1.4 KiB
C++
Raw Normal View History

// Volume surfactant concentration
volScalarField* CPtr = nullptr;
if(!interface.cleanInterface() && interface.surfactant().soluble())
{
Info << "\nReading field C\n" << endl;
CPtr = new volScalarField
(
IOobject
(
"C",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
if(runTime.timeIndex() == 0)
{
const dimensionedScalar& CA =
interface.surfactant().surfactBulkConc();
dimensionedScalar CB("CB", CA.dimensions(), 0);
(*CPtr) = fluidIndicator*(CA - CB) + CB;
if
(
CPtr->boundaryField()[spacePatchID].type()
== inletOutletFvPatchScalarField::typeName
)
{
inletOutletFvPatchScalarField& spaceC =
refCast<inletOutletFvPatchScalarField>
(
CPtr->boundaryField()[spacePatchID]
);
spaceC.refValue() = CA.value();
}
else
{
FatalErrorIn(args.executable())
<< "Boundary condition for bulk surfactant concentration at "
<< "space patch isn't and should be: "
<< inletOutletFvPatchScalarField::typeName
<< abort(FatalError);
}
CPtr->correctBoundaryConditions();
CPtr->write();
}
}