diff --git a/.gitignore b/.gitignore index eaec01272..9ac47f062 100644 --- a/.gitignore +++ b/.gitignore @@ -93,4 +93,12 @@ src/lduSolvers/amg/amgPolicy/samgPolicy.H src/lduSolvers/amg/amgPolicy/aamgPolicy.C src/lduSolvers/amg/amgPolicy/aamgPolicy.H +# The following files are blacklisted because of a DMCA complaint by ANSYS. +src/lduSolvers/tools/PriorityArray.C +src/lduSolvers/tools/PriorityArray.H +src/lduSolvers/amg/amgPolicy/samgPolicy.C +src/lduSolvers/amg/amgPolicy/samgPolicy.H +src/lduSolvers/amg/amgPolicy/aamgPolicy.C +src/lduSolvers/amg/amgPolicy/aamgPolicy.H + # end-of-file diff --git a/applications/solvers/surfaceTracking/surfactantFoam/createFaFields.H b/applications/solvers/surfaceTracking/surfactantFoam/createFaFields.H index 5a76aebec..89d8da2f7 100644 --- a/applications/solvers/surfaceTracking/surfactantFoam/createFaFields.H +++ b/applications/solvers/surfaceTracking/surfactantFoam/createFaFields.H @@ -12,26 +12,28 @@ areaScalarField Cs aMesh ); -dimensioned Cs0 +Info<< "Reading transportProperties\n" << endl; + +IOdictionary transportProperties ( - "Cs0", - dimensionSet(1, -2, 0, 0, 0, 0, 0), - 1.0 + IOobject + ( + "transportProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) ); -const areaVectorField& R = aMesh.areaCentres(); -Cs = Cs0*(1.0 + R.component(vector::X)/mag(R)); +Info<< "Reading diffusivity D\n" << endl; - -dimensioned Ds +dimensionedScalar Ds ( - "Ds", - dimensionSet(0, 2, -1, 0, 0, 0, 0), - 1.0 + transportProperties.lookup("Ds") ); - areaVectorField Us ( IOobject @@ -39,29 +41,12 @@ areaVectorField Us "Us", runTime.timeName(), mesh, - IOobject::NO_READ, + IOobject::MUST_READ, IOobject::NO_WRITE ), - aMesh, - dimensioned("Us", dimVelocity, vector::zero) + aMesh ); -dimensioned 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 ( diff --git a/tutorials/surfaceTracking/surfactantFoam/planeTransport/0/Cs b/tutorials/surfaceTracking/surfactantFoam/planeTransport/0/Cs new file mode 100644 index 000000000..673e7998a --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/planeTransport/0/Cs @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM Extend Project: Open source CFD | +| \\ / O peration | Version: 1.6-ext | +| \\ / A nd | Web: www.extend-project.de | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class areaScalarField; + location "0"; + object Cs; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -2 0 0 0 0 0]; + +internalField uniform 0; + +referenceLevel 0; + +boundaryField +{ + inlet { + type fixedValue; + value uniform 1; + } + outlet { + type inletOutlet; + value uniform 1; + phi phis; + inletValue uniform 0; + } + bound { + type symmetryPlane; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/surfaceTracking/surfactantFoam/planeTransport/0/Cvf b/tutorials/surfaceTracking/surfactantFoam/planeTransport/0/Cvf new file mode 100644 index 000000000..e604c98bd --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/planeTransport/0/Cvf @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM Extend Project: Open source CFD | +| \\ / O peration | Version: 1.6-ext | +| \\ / A nd | Web: www.extend-project.de | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object Cvf; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 -1 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value uniform 0; + } + bound + { + type calculated; + value uniform 0; + } + outlet + { + type calculated; + value uniform 0; + } + bottom + { + type calculated; + value uniform 0; + } + top + { + type calculated; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/surfaceTracking/surfactantFoam/planeTransport/0/U b/tutorials/surfaceTracking/surfactantFoam/planeTransport/0/U new file mode 100644 index 000000000..81270be90 --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/planeTransport/0/U @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM Extend Project: Open source CFD | +| \\ / O peration | Version: 1.6-ext | +| \\ / A nd | Web: www.extend-project.de | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + location "0"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type calculated; + value uniform (0 0 0); + } + bound + { + type calculated; + value uniform (0 0 0); + } + outlet + { + type calculated; + value uniform (0 0 0); + } + bottom + { + type calculated; + value uniform (0 0 0); + } + top + { + type calculated; + value uniform (0.05 0 0); + } +} + + +// ************************************************************************* // diff --git a/tutorials/surfaceTracking/surfactantFoam/planeTransport/0/Us b/tutorials/surfaceTracking/surfactantFoam/planeTransport/0/Us new file mode 100644 index 000000000..f04eb7523 --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/planeTransport/0/Us @@ -0,0 +1,36 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM Extend Project: Open source CFD | +| \\ / O peration | Version: 1.6-ext | +| \\ / A nd | Web: www.extend-project.de | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class areaVectorField; + location "0"; + object Us; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0.05 0 0); + +boundaryField +{ + inlet { + type fixedValue; + value $internalField; + } + outlet { + type zeroGradient; + } + bound { + type symmetryPlane; + } +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/Allclean b/tutorials/surfaceTracking/surfactantFoam/planeTransport/Allclean similarity index 100% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/Allclean rename to tutorials/surfaceTracking/surfactantFoam/planeTransport/Allclean diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/Allrun b/tutorials/surfaceTracking/surfactantFoam/planeTransport/Allrun similarity index 87% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/Allrun rename to tutorials/surfaceTracking/surfactantFoam/planeTransport/Allrun index b3bc011b4..cf07ecbfd 100755 --- a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/Allrun +++ b/tutorials/surfaceTracking/surfactantFoam/planeTransport/Allrun @@ -4,5 +4,6 @@ application="surfactantFoam" +runApplication blockMesh runApplication makeFaMesh runApplication $application diff --git a/tutorials/surfaceTracking/surfactantFoam/planeTransport/constant/faMesh/faMeshDefinition b/tutorials/surfaceTracking/surfactantFoam/planeTransport/constant/faMesh/faMeshDefinition new file mode 100644 index 000000000..a9ebd9c77 --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/planeTransport/constant/faMesh/faMeshDefinition @@ -0,0 +1,40 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM Extend Project: Open source CFD | +| \\ / O peration | Version: 1.6-ext | +| \\ / A nd | Web: www.extend-project.de | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object faMeshDefinition; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +polyMeshPatches 1( top ); + +boundary +{ + inlet { + type patch; + ownerPolyPatch top; + neighbourPolyPatch inlet; + } + outlet { + type patch; + ownerPolyPatch top; + neighbourPolyPatch outlet; + } + bound { + type symmetryPlane; + ownerPolyPatch top; + neighbourPolyPatch bound; + } +} + + +// ************************************************************************** // diff --git a/tutorials/surfaceTracking/surfactantFoam/planeTransport/constant/polyMesh/blockMeshDict b/tutorials/surfaceTracking/surfactantFoam/planeTransport/constant/polyMesh/blockMeshDict new file mode 100644 index 000000000..060e55588 --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/planeTransport/constant/polyMesh/blockMeshDict @@ -0,0 +1,69 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.1; + +vertices +( + (0 0 0) + (3 0 0) + (3 1 0) + (0 1 0) + (0 0 0.1) + (3 0 0.1) + (3 1 0.1) + (0 1 0.1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (60 20 1) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + patch inlet + ( + (0 4 7 3) + ) + wall bound + ( + (3 7 6 2) + (1 5 4 0) + ) + patch outlet + ( + (2 6 5 1) + ) + patch bottom + ( + (0 3 2 1) + ) + patch top + ( + (4 5 6 7) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/surfaceTracking/surfactantFoam/planeTransport/constant/polyMesh/boundary b/tutorials/surfaceTracking/surfactantFoam/planeTransport/constant/polyMesh/boundary new file mode 100644 index 000000000..bccc60e3a --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/planeTransport/constant/polyMesh/boundary @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM Extend Project: Open source CFD | +| \\ / O peration | Version: 1.6-ext | +| \\ / A nd | Web: www.extend-project.de | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +5 +( + inlet + { + type patch; + nFaces 20; + startFace 2320; + } + bound + { + type wall; + nFaces 120; + startFace 2340; + } + outlet + { + type patch; + nFaces 20; + startFace 2460; + } + bottom + { + type patch; + nFaces 1200; + startFace 2480; + } + top + { + type patch; + nFaces 1200; + startFace 3680; + } +) + +// ************************************************************************* // diff --git a/tutorials/surfaceTracking/surfactantFoam/planeTransport/constant/transportProperties b/tutorials/surfaceTracking/surfactantFoam/planeTransport/constant/transportProperties new file mode 100644 index 000000000..7df70c875 --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/planeTransport/constant/transportProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Ds Ds [ 0 2 -1 0 0 0 0 ] 0.00001; + + +// ************************************************************************* // diff --git a/tutorials/surfaceTracking/surfactantFoam/planeTransport/system/controlDict b/tutorials/surfaceTracking/surfactantFoam/planeTransport/system/controlDict new file mode 100644 index 000000000..226cf7c09 --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/planeTransport/system/controlDict @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM Extend Project: Open source CFD | +| \\ / O peration | Version: 1.6-ext | +| \\ / A nd | Web: www.extend-project.de | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application surfactantFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 6; + +deltaT 0.1; + +writeControl runTime; + +writeInterval 0.2; + +purgeWrite 0; + +writeFormat ascii; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +// ************************************************************************* // + + diff --git a/tutorials/surfaceTracking/surfactantFoam/planeTransport/system/faSchemes b/tutorials/surfaceTracking/surfactantFoam/planeTransport/system/faSchemes new file mode 100644 index 000000000..12070465a --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/planeTransport/system/faSchemes @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM Extend Project: Open source CFD | +| \\ / O peration | Version: 1.6-ext | +| \\ / A nd | Web: www.extend-project.de | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object faSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; +} + +divSchemes +{ + default none; + div(phis,Cs) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(Ds,Cs) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + p; +} + + +// ************************************************************************* // diff --git a/tutorials/surfaceTracking/surfactantFoam/planeTransport/system/faSolution b/tutorials/surfaceTracking/surfactantFoam/planeTransport/system/faSolution new file mode 100644 index 000000000..3ba6f6f69 --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/planeTransport/system/faSolution @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM Extend Project: Open source CFD | +| \\ / O peration | Version: 1.6-ext | +| \\ / A nd | Web: www.extend-project.de | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object faSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + Cs + { + solver PBiCG; + preconditioner DILU; + minIter 0; + maxIter 2000; + tolerance 1e-06; + relTol 0; + } +} + +PISO +{ + nCorrectors 2; + nNonOrthogonalCorrectors 0; +} + +SIMPLE +{ + nTimeCorrectors 6; + nNonOrthogonalCorrectors 1; +} + +relaxationFactors +{ + p 0.7; + U 0.7; + k 0.7; + epsilon 0.7; + R 0.7; +} + +// ************************************************************************* // diff --git a/tutorials/surfaceTracking/surfactantFoam/planeTransport/system/fvSchemes b/tutorials/surfaceTracking/surfactantFoam/planeTransport/system/fvSchemes new file mode 100644 index 000000000..1b773257b --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/planeTransport/system/fvSchemes @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM Extend Project: Open source CFD | +| \\ / O peration | Version: 1.6-ext | +| \\ / A nd | Web: www.extend-project.de | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ +} + +gradSchemes +{ +} + +divSchemes +{ +} + +laplacianSchemes +{ +} + +interpolationSchemes +{ +} + +snGradSchemes +{ +} + +fluxRequired +{ +} + + +// ************************************************************************* // diff --git a/tutorials/surfaceTracking/surfactantFoam/planeTransport/system/fvSolution b/tutorials/surfaceTracking/surfactantFoam/planeTransport/system/fvSolution new file mode 100644 index 000000000..a173d41c2 --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/planeTransport/system/fvSolution @@ -0,0 +1,23 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM Extend Project: Open source CFD | +| \\ / O peration | Version: 1.6-ext | +| \\ / A nd | Web: www.extend-project.de | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ +} + + +// ************************************************************************* // diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/Make/files b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/Make/files new file mode 100644 index 000000000..574a49703 --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/Make/files @@ -0,0 +1,3 @@ +surfactantFoam.C + +EXE = $(FOAM_USER_APPBIN)/sphereSurfactantFoam diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/Make/options b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/Make/options new file mode 100644 index 000000000..05015b82b --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/Make/options @@ -0,0 +1,9 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteArea/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/cfdTools/general/lnInclude + +EXE_LIBS = \ + -lfiniteArea \ + -lfiniteVolume \ + -llduSolvers diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/createFaFields.H b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/createFaFields.H new file mode 100644 index 000000000..5a76aebec --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/createFaFields.H @@ -0,0 +1,78 @@ +Info << "Reading field Cs" << endl; +areaScalarField Cs +( + IOobject + ( + "Cs", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + aMesh +); + +dimensioned 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 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("Us", dimVelocity, vector::zero) +); + +dimensioned 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() +); + diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/createFaMesh.H b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/createFaMesh.H new file mode 100644 index 000000000..905c8e740 --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/createFaMesh.H @@ -0,0 +1,2 @@ + // Create Finite Area mesh + faMesh aMesh(mesh); diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/createVolFields.H b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/createVolFields.H new file mode 100644 index 000000000..72358cef4 --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/createVolFields.H @@ -0,0 +1,36 @@ + // Create volume-to surface mapping object + volSurfaceMapping vsm(aMesh); + + volScalarField Cvf + ( + IOobject + ( + "Cvf", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedScalar("0", dimless/dimLength, 0) + ); + + vsm.mapToVolume(Cs, Cvf.boundaryField()); + Cvf.write(); + + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedVector("zero", dimVelocity, vector::zero) + ); + + vsm.mapToVolume(Us, U.boundaryField()); + U.write(); diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/surfactantFoam.C b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/surfactantFoam.C new file mode 100644 index 000000000..d8ebbf960 --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereSurfactantFoam/surfactantFoam.C @@ -0,0 +1,83 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2004-2007 Z. Tukovic and H. Jasak + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + finiteAreaFoam + +Description + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "faCFD.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ +# include "setRootCase.H" +# include "createTime.H" +# include "createMesh.H" + +# include "createFaMesh.H" +# include "createFaFields.H" +# include "createVolFields.H" + + Info<< "Total mass of surfactant: " + << sum(Cs.internalField()*aMesh.S()) << endl; + + Info << "\nStarting time loop\n" << endl; + + for (runTime++; !runTime.end(); runTime++) + { + Info << "Time = " << runTime.value() << endl; + + faScalarMatrix CsEqn + ( + fam::ddt(Cs) + + fam::div(phis, Cs) + - fam::laplacian(Ds, Cs) + ); + + CsEqn.solve(); + + if (runTime.outputTime()) + { + vsm.mapToVolume(Cs, Cvf.boundaryField()); + + runTime.write(); + } + + Info<< "Total mass of surfactant: " + << sum(Cs.internalField()*aMesh.S()) << endl; + + Info << "ExecutionTime = " + << scalar(runTime.elapsedCpuTime()) + << " s\n" << endl << endl; + } + + return(0); +} + +// ************************************************************************* // diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/0/Cs b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/0/Cs similarity index 100% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/0/Cs rename to tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/0/Cs diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/0/Cvf b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/0/Cvf similarity index 98% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/0/Cvf rename to tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/0/Cvf index fee4e183c..bf24a7928 100644 --- a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/0/Cvf +++ b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/0/Cvf @@ -1,6 +1,6 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | -| \\ / F ield | OpenFOAM Extend Project: Open Source CFD | +| \\ / F ield | OpenFOAM Extend Project: Open source CFD | | \\ / O peration | Version: 1.6-ext | | \\ / A nd | Web: www.extend-project.de | | \\/ M anipulation | | @@ -24,7 +24,7 @@ boundaryField outer { type calculated; - value nonuniform List + value nonuniform List 600 ( 0.348943 @@ -632,4 +632,5 @@ boundaryField } } + // ************************************************************************* // diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/0/U b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/0/U similarity index 99% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/0/U rename to tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/0/U index 0dcb84c80..927bc1cc4 100644 --- a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/0/U +++ b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/0/U @@ -1,6 +1,6 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | -| \\ / F ield | OpenFOAM Extend Project: Open Source CFD | +| \\ / F ield | OpenFOAM Extend Project: Open source CFD | | \\ / O peration | Version: 1.6-ext | | \\ / A nd | Web: www.extend-project.de | | \\/ M anipulation | | @@ -24,7 +24,7 @@ boundaryField outer { type calculated; - value nonuniform List + value nonuniform List 600 ( (-0.144039 -0.122998 0.0114965) @@ -632,4 +632,5 @@ boundaryField } } + // ************************************************************************* // diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/Allclean b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/Allclean new file mode 100755 index 000000000..f9c09b1ff --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/Allclean @@ -0,0 +1,7 @@ +#!/bin/sh + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanTimeDirectories +cleanFaMesh \ No newline at end of file diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/Allrun b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/Allrun new file mode 100755 index 000000000..feb5e2e51 --- /dev/null +++ b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/Allrun @@ -0,0 +1,10 @@ +#!/bin/sh +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +application="sphereSurfactantFoam" + +wmake ../$application + +runApplication makeFaMesh +runApplication $application diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/faMesh/faMeshDefinition b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/faMesh/faMeshDefinition similarity index 100% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/faMesh/faMeshDefinition rename to tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/faMesh/faMeshDefinition diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/boundary b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/boundary similarity index 100% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/boundary rename to tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/boundary diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/cells b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/cells similarity index 100% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/cells rename to tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/cells diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/faces b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/faces similarity index 100% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/faces rename to tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/faces diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/neighbour b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/neighbour similarity index 100% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/neighbour rename to tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/neighbour diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/owner b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/owner similarity index 100% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/owner rename to tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/owner diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/points b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/points similarity index 100% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/constant/polyMesh/points rename to tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/constant/polyMesh/points diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/system/controlDict b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/system/controlDict similarity index 100% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/system/controlDict rename to tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/system/controlDict diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/system/faSchemes b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/system/faSchemes similarity index 100% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/system/faSchemes rename to tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/system/faSchemes diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/system/faSolution b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/system/faSolution similarity index 100% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/system/faSolution rename to tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/system/faSolution diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/system/fvSchemes b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/system/fvSchemes similarity index 100% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/system/fvSchemes rename to tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/system/fvSchemes diff --git a/tutorials/surfaceTracking/surfactantFoam/sphereTransport/system/fvSolution b/tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/system/fvSolution similarity index 100% rename from tutorials/surfaceTracking/surfactantFoam/sphereTransport/system/fvSolution rename to tutorials/surfaceTracking/surfactantFoam/sphereTransport/sphereTransport/system/fvSolution