solveBulkSurfactant.H
Go to the documentation of this file.
1{
2 volScalarField& C = bulkSurfactantConcentration();
3
4 const dimensionedScalar& D = surfactant().bulkDiffusion();
5
6 scalar ka = surfactant().adsorptionCoeff().value();
7 scalar kb = surfactant().desorptionCoeff().value();
8 scalar CsInf = surfactant().saturatedConc().value();
9
10 const scalarField& Cs =
11 surfactantConcentration().internalField();
12
13 // const scalarField& Cfs = C.boundaryField()[fsPatchIndex()];
14
15 if
16 (
17 C.boundaryField()[fsPatchIndex()].type()
19 )
20 {
21 fixedGradientFvPatchScalarField& fsC =
22 refCast<fixedGradientFvPatchScalarField>
23 (
24 C.boundaryFieldRef()[fsPatchIndex()]
25 );
26
27 fsC.gradient() = (ka*kb*Cs - ka*(CsInf-Cs)*fsC)/D.value();
28 }
29 else
30 {
32 << "Bulk concentration boundary condition "
33 << "at the free-surface patch is not "
35 << exit(FatalError);
36 }
37
38 fvScalarMatrix CEqn
39 (
40 fvm::ddt(C)
41 + fvm::div(phi(), C, "div(phi,C)")
42 - fvm::laplacian(D, C, "laplacian(D,C)")
43 );
44
45 CEqn.solve();
46}
static const Foam::dimensionedScalar C("", Foam::dimTemperature, 234.5)
surfaceScalarField & phi
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:82
scalar ka
const dimensionedScalar & D
scalar kb
fvScalarMatrix CEqn(fvm::ddt(C)+fvm::div(phi(), C, "div(phi,C)") - fvm::laplacian(D, C, "laplacian(D,C)"))
scalar CsInf
const scalarField & Cs
static const char *const typeName
The type name used in ensight case files.