2010-11-24 23:00:58 +00:00
|
|
|
|
|
|
|
if(CPtr)
|
|
|
|
{
|
|
|
|
volScalarField& C = *CPtr;
|
|
|
|
|
2013-07-18 01:02:34 +00:00
|
|
|
const dimensionedScalar& D
|
2010-11-24 23:00:58 +00:00
|
|
|
= interface.surfactant().surfactBulkDiffusion();
|
|
|
|
|
|
|
|
scalar ka = interface.surfactant().surfactAdsorptionCoeff().value();
|
|
|
|
scalar kb = interface.surfactant().surfactDesorptionCoeff().value();
|
|
|
|
scalar CsInf = interface.surfactant().surfactSaturatedConc().value();
|
|
|
|
|
2013-07-18 01:02:34 +00:00
|
|
|
scalarField& Cs =
|
2010-11-24 23:00:58 +00:00
|
|
|
interface.surfactantConcentration().internalField();
|
|
|
|
|
2013-07-18 01:02:34 +00:00
|
|
|
scalarField CP =
|
2010-11-24 23:00:58 +00:00
|
|
|
C.boundaryField()[interface.aPatchID()].patchInternalField();
|
|
|
|
|
|
|
|
const scalarField& Cfs = C.boundaryField()[interface.aPatchID()];
|
|
|
|
|
|
|
|
scalarField dn = 1.0/mesh.boundary()[interface.aPatchID()].deltaCoeffs();
|
|
|
|
|
|
|
|
if
|
|
|
|
(
|
2013-07-18 01:02:34 +00:00
|
|
|
C.boundaryField()[interface.aPatchID()].type()
|
2010-11-24 23:00:58 +00:00
|
|
|
== fixedGradientFvPatchScalarField::typeName
|
|
|
|
)
|
|
|
|
{
|
|
|
|
fixedGradientFvPatchScalarField& CA =
|
|
|
|
refCast<fixedGradientFvPatchScalarField>
|
|
|
|
(
|
|
|
|
C.boundaryField()[interface.aPatchID()]
|
|
|
|
);
|
|
|
|
|
|
|
|
CA.gradient() = (ka*kb*Cs - ka*(CsInf-Cs)*Cfs)/D.value();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FatalErrorIn(args.executable())
|
|
|
|
<< "Bulk concentration boundary condition "
|
|
|
|
<< "at the freeSurface patch is not "
|
|
|
|
<< fixedGradientFvPatchScalarField::typeName
|
|
|
|
<< exit(FatalError);
|
|
|
|
}
|
2013-07-18 01:02:34 +00:00
|
|
|
|
2010-11-24 23:00:58 +00:00
|
|
|
solve
|
|
|
|
(
|
|
|
|
fvm::ddt(C)
|
|
|
|
+ fvm::div(phi - fvc::meshPhi(rho,U), C, "div(phi,C)")
|
|
|
|
- fvm::laplacian(D, C, "laplacian(D,C)")
|
|
|
|
);
|
|
|
|
|
|
|
|
CP = C.boundaryField()[interface.aPatchID()].patchInternalField();
|
|
|
|
|
|
|
|
// Info << gMax(CP) << ", "<< gAverage(CP) << endl;
|
|
|
|
}
|