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/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/createFaFields.H
Bernhard F.W. Gschaider 49006b6ef6 Moving surfactantFoam to tutorials because of its case-specific implementation
--HG--
branch : proposal/famTutorialReorganizationBranch
rename : applications/solvers/surfaceTracking/surfactantFoam/Make/files => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/Make/files
rename : applications/solvers/surfaceTracking/surfactantFoam/Make/options => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/Make/options
rename : applications/solvers/surfaceTracking/surfactantFoam/createFaFields.H => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/createFaFields.H
rename : applications/solvers/surfaceTracking/surfactantFoam/createFaMesh.H => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/createFaMesh.H
rename : applications/solvers/surfaceTracking/surfactantFoam/createVolFields.H => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/createVolFields.H
rename : applications/solvers/surfaceTracking/surfactantFoam/surfactantFoam.C => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/surfactantFoam.C
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/0/Cs => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/0/Cs
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/0/Cvf => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/0/Cvf
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/0/U => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/0/U
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/Allclean => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/Allclean
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/Allrun => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/Allrun
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/faMesh/faMeshDefinition => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/faMesh/faMeshDefinition
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/boundary => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/boundary
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/cells => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/cells
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/faces => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/faces
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/neighbour => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/neighbour
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/owner => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/owner
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/points => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/points
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/system/controlDict => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/system/controlDict
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/system/faSchemes => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/system/faSchemes
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/system/faSolution => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/system/faSolution
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/system/fvSchemes => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/system/fvSchemes
rename : tutorials/surfaceTracking/surfactantFoam/sphereTransport/system/fvSolution => tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/system/fvSolution
2011-01-29 14:58:47 +01:00

78 lines
1.3 KiB
C

Info << "Reading field Cs" << endl;
areaScalarField Cs
(
IOobject
(
"Cs",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
aMesh
);
dimensioned<scalar> Cs0
(
"Cs0",
dimensionSet(1, -2, 0, 0, 0, 0, 0),
1.0
);
const areaVectorField& R = aMesh.areaCentres();
Cs = Cs0*(1.0 + R.component(vector::X)/mag(R));
dimensioned<scalar> Ds
(
"Ds",
dimensionSet(0, 2, -1, 0, 0, 0, 0),
1.0
);
areaVectorField Us
(
IOobject
(
"Us",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
aMesh,
dimensioned<vector>("Us", dimVelocity, vector::zero)
);
dimensioned<scalar> Uinf("Uinf", dimVelocity, 1.0);
forAll (Us, faceI)
{
Us[faceI].x() =
Uinf.value()*(0.25*(3.0 + sqr(R[faceI].x()/mag(R[faceI]))) - 1.0);
Us[faceI].y() =
Uinf.value()*0.25*R[faceI].x()*R[faceI].y()/sqr(mag(R[faceI]));
Us[faceI].z() =
Uinf.value()*0.25*R[faceI].x()*R[faceI].z()/sqr(mag(R[faceI]));
}
Us -= aMesh.faceAreaNormals()*(aMesh.faceAreaNormals() & Us);
edgeScalarField phis
(
IOobject
(
"phis",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
linearEdgeInterpolate(Us) & aMesh.Le()
);