diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C index eac555d224..1f0ebf8c0e 100644 --- a/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/displacement/SBRStress/displacementSBRStressFvMotionSolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,7 +91,7 @@ Foam::displacementSBRStressFvMotionSolver::displacementSBRStressFvMotionSolver ), diffusivityPtr_ ( - motionDiffusivity::New(*this, lookup("diffusivity")) + motionDiffusivity::New(fvMesh_, lookup("diffusivity")) ) {} @@ -128,7 +128,7 @@ Foam::displacementSBRStressFvMotionSolver::curPoints() const void Foam::displacementSBRStressFvMotionSolver::solve() { // The points have moved so before interpolation update - // the fvMotionSolver accordingly + // the motionSolver accordingly movePoints(fvMesh_.points()); diffusivityPtr_->correct(); @@ -197,7 +197,7 @@ void Foam::displacementSBRStressFvMotionSolver::updateMesh // Update diffusivity. Note two stage to make sure old one is de-registered // before creating/registering new one. diffusivityPtr_.reset(NULL); - diffusivityPtr_ = motionDiffusivity::New(*this, lookup("diffusivity")); + diffusivityPtr_ = motionDiffusivity::New(fvMesh_, lookup("diffusivity")); } diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C index c9627ffca9..72b183cecd 100644 --- a/src/fvMotionSolver/fvMotionSolvers/displacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/displacement/componentLaplacian/displacementComponentLaplacianFvMotionSolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -141,7 +141,7 @@ displacementComponentLaplacianFvMotionSolver pointLocation_(NULL), diffusivityPtr_ ( - motionDiffusivity::New(*this, lookup("diffusivity")) + motionDiffusivity::New(fvMesh_, lookup("diffusivity")) ), frozenPointsZone_ ( @@ -388,7 +388,7 @@ void Foam::displacementComponentLaplacianFvMotionSolver::updateMesh // Update diffusivity. Note two stage to make sure old one is de-registered // before creating/registering new one. diffusivityPtr_.reset(NULL); - diffusivityPtr_ = motionDiffusivity::New(*this, lookup("diffusivity")); + diffusivityPtr_ = motionDiffusivity::New(fvMesh_, lookup("diffusivity")); } diff --git a/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C index fdff94f097..043bcb114d 100644 --- a/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/displacement/laplacian/displacementLaplacianFvMotionSolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -90,7 +90,7 @@ Foam::displacementLaplacianFvMotionSolver::displacementLaplacianFvMotionSolver pointLocation_(NULL), diffusivityPtr_ ( - motionDiffusivity::New(*this, lookup("diffusivity")) + motionDiffusivity::New(fvMesh_, lookup("diffusivity")) ), frozenPointsZone_ ( @@ -245,7 +245,7 @@ void Foam::displacementLaplacianFvMotionSolver::updateMesh // Update diffusivity. Note two stage to make sure old one is de-registered // before creating/registering new one. diffusivityPtr_.reset(NULL); - diffusivityPtr_ = motionDiffusivity::New(*this, lookup("diffusivity")); + diffusivityPtr_ = motionDiffusivity::New(fvMesh_, lookup("diffusivity")); } diff --git a/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.H b/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.H index 33b1d693c9..cb54b877a2 100644 --- a/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.H +++ b/src/fvMotionSolver/fvMotionSolvers/fvMotionSolver/fvMotionSolver.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -109,7 +109,7 @@ public: virtual void solve() = 0; //- Update the pointMesh corresponding to the new points - void movePoints(const pointField&); + virtual void movePoints(const pointField&); //- Update the mesh corresponding to given map virtual void updateMesh(const mapPolyMesh&); diff --git a/src/fvMotionSolver/fvMotionSolvers/velocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/velocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.C index be09d2cc34..e7cd44d761 100644 --- a/src/fvMotionSolver/fvMotionSolvers/velocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/velocity/componentLaplacian/velocityComponentLaplacianFvMotionSolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -89,7 +89,7 @@ velocityComponentLaplacianFvMotionSolver ), diffusivityPtr_ ( - motionDiffusivity::New(*this, lookup("diffusivity")) + motionDiffusivity::New(fvMesh_, lookup("diffusivity")) ) { if (cmptName_ == "x") @@ -181,7 +181,7 @@ void Foam::velocityComponentLaplacianFvMotionSolver::updateMesh // Update diffusivity. Note two stage to make sure old one is de-registered // before creating/registering new one. diffusivityPtr_.reset(NULL); - diffusivityPtr_ = motionDiffusivity::New(*this, lookup("diffusivity")); + diffusivityPtr_ = motionDiffusivity::New(fvMesh_, lookup("diffusivity")); } diff --git a/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C b/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C index dcf367f085..2b31b3759b 100644 --- a/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C +++ b/src/fvMotionSolver/fvMotionSolvers/velocity/laplacian/velocityLaplacianFvMotionSolver.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -86,7 +86,7 @@ Foam::velocityLaplacianFvMotionSolver::velocityLaplacianFvMotionSolver ), diffusivityPtr_ ( - motionDiffusivity::New(*this, lookup("diffusivity")) + motionDiffusivity::New(fvMesh_, lookup("diffusivity")) ) {} @@ -151,7 +151,7 @@ void Foam::velocityLaplacianFvMotionSolver::updateMesh // Update diffusivity. Note two stage to make sure old one is de-registered // before creating/registering new one. diffusivityPtr_.reset(NULL); - diffusivityPtr_ = motionDiffusivity::New(*this, lookup("diffusivity")); + diffusivityPtr_ = motionDiffusivity::New(mesh(), lookup("diffusivity")); } diff --git a/src/fvMotionSolver/motionDiffusivity/directional/directionalDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/directional/directionalDiffusivity.C index 462bca14bf..2fdc9b1065 100644 --- a/src/fvMotionSolver/motionDiffusivity/directional/directionalDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/directional/directionalDiffusivity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,11 +45,11 @@ namespace Foam Foam::directionalDiffusivity::directionalDiffusivity ( - const fvMotionSolver& mSolver, + const fvMesh& mesh, Istream& mdData ) : - uniformDiffusivity(mSolver, mdData), + uniformDiffusivity(mesh, mdData), diffusivityVector_(mdData) { correct(); @@ -66,9 +66,7 @@ Foam::directionalDiffusivity::~directionalDiffusivity() void Foam::directionalDiffusivity::correct() { - const fvMesh& mesh = mSolver().mesh(); - - const surfaceVectorField n(mesh.Sf()/mesh.magSf()); + const surfaceVectorField n(mesh().Sf()/mesh().magSf()); faceDiffusivity_ == (n & cmptMultiply(diffusivityVector_, n)); } diff --git a/src/fvMotionSolver/motionDiffusivity/directional/directionalDiffusivity.H b/src/fvMotionSolver/motionDiffusivity/directional/directionalDiffusivity.H index 9292c94573..2e83b37349 100644 --- a/src/fvMotionSolver/motionDiffusivity/directional/directionalDiffusivity.H +++ b/src/fvMotionSolver/motionDiffusivity/directional/directionalDiffusivity.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -72,12 +72,8 @@ public: // Constructors - //- Construct for the given fvMotionSolver and data Istream - directionalDiffusivity - ( - const fvMotionSolver& mSolver, - Istream& mdData - ); + //- Construct for the given fvMesh and data Istream + directionalDiffusivity(const fvMesh& mesh, Istream& mdData); //- Destructor diff --git a/src/fvMotionSolver/motionDiffusivity/file/fileDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/file/fileDiffusivity.C index bfb1b73d3e..61223d0591 100644 --- a/src/fvMotionSolver/motionDiffusivity/file/fileDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/file/fileDiffusivity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,22 +45,22 @@ namespace Foam Foam::fileDiffusivity::fileDiffusivity ( - const fvMotionSolver& mSolver, + const fvMesh& mesh, Istream& mdData ) : - motionDiffusivity(mSolver), + motionDiffusivity(mesh), faceDiffusivity_ ( IOobject ( word(mdData), - mSolver.mesh().time().constant(), - mSolver.mesh(), + mesh.time().constant(), + mesh, IOobject::MUST_READ, IOobject::NO_WRITE ), - mSolver.mesh() + mesh ) {} diff --git a/src/fvMotionSolver/motionDiffusivity/file/fileDiffusivity.H b/src/fvMotionSolver/motionDiffusivity/file/fileDiffusivity.H index 2bac5288d0..8269bf449b 100644 --- a/src/fvMotionSolver/motionDiffusivity/file/fileDiffusivity.H +++ b/src/fvMotionSolver/motionDiffusivity/file/fileDiffusivity.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,12 +78,8 @@ public: // Constructors - //- Construct for the given fvMotionSolver and data Istream - fileDiffusivity - ( - const fvMotionSolver& mSolver, - Istream& mdData - ); + //- Construct for the given fvMesh and data Istream + fileDiffusivity(const fvMesh& mesh, Istream& mdData); //- Destructor diff --git a/src/fvMotionSolver/motionDiffusivity/inverseDistance/inverseDistanceDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/inverseDistance/inverseDistanceDiffusivity.C index ca133b5631..657dac6d98 100644 --- a/src/fvMotionSolver/motionDiffusivity/inverseDistance/inverseDistanceDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/inverseDistance/inverseDistanceDiffusivity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,11 +49,11 @@ namespace Foam Foam::inverseDistanceDiffusivity::inverseDistanceDiffusivity ( - const fvMotionSolver& mSolver, + const fvMesh& mesh, Istream& mdData ) : - uniformDiffusivity(mSolver, mdData), + uniformDiffusivity(mesh, mdData), patchNames_(mdData) { correct(); @@ -70,37 +70,33 @@ Foam::inverseDistanceDiffusivity::~inverseDistanceDiffusivity() Foam::tmp Foam::inverseDistanceDiffusivity::y() const { - const polyMesh& mesh = mSolver().mesh(); - - labelHashSet patchSet(mesh.boundaryMesh().patchSet(patchNames_)); + labelHashSet patchSet(mesh().boundaryMesh().patchSet(patchNames_)); if (patchSet.size()) { return tmp ( - new scalarField(patchWave(mesh, patchSet, false).distance()) + new scalarField(patchWave(mesh(), patchSet, false).distance()) ); } else { - return tmp(new scalarField(mesh.nCells(), 1.0)); + return tmp(new scalarField(mesh().nCells(), 1.0)); } } void Foam::inverseDistanceDiffusivity::correct() { - const fvMesh& mesh = mSolver().mesh(); - volScalarField y_ ( IOobject ( "y", - mesh.time().timeName(), - mesh + mesh().time().timeName(), + mesh() ), - mesh, + mesh(), dimless, zeroGradientFvPatchScalarField::typeName ); diff --git a/src/fvMotionSolver/motionDiffusivity/inverseDistance/inverseDistanceDiffusivity.H b/src/fvMotionSolver/motionDiffusivity/inverseDistance/inverseDistanceDiffusivity.H index d39e4fad26..e5f6f3c9a5 100644 --- a/src/fvMotionSolver/motionDiffusivity/inverseDistance/inverseDistanceDiffusivity.H +++ b/src/fvMotionSolver/motionDiffusivity/inverseDistance/inverseDistanceDiffusivity.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,12 +78,8 @@ public: // Constructors - //- Construct for the given fvMotionSolver and data Istream - inverseDistanceDiffusivity - ( - const fvMotionSolver& mSolver, - Istream& mdData - ); + //- Construct for the given fvMesh and data Istream + inverseDistanceDiffusivity(const fvMesh& mesh, Istream& mdData); //- Destructor diff --git a/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C index 0dc3b39f98..a288667998 100644 --- a/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,11 +48,11 @@ namespace Foam Foam::inverseFaceDistanceDiffusivity::inverseFaceDistanceDiffusivity ( - const fvMotionSolver& mSolver, + const fvMesh& mesh, Istream& mdData ) : - uniformDiffusivity(mSolver, mdData), + uniformDiffusivity(mesh, mdData), patchNames_(mdData) { correct(); @@ -69,8 +69,7 @@ Foam::inverseFaceDistanceDiffusivity::~inverseFaceDistanceDiffusivity() void Foam::inverseFaceDistanceDiffusivity::correct() { - const polyMesh& mesh = mSolver().mesh(); - const polyBoundaryMesh& bdry = mesh.boundaryMesh(); + const polyBoundaryMesh& bdry = mesh().boundaryMesh(); labelHashSet patchSet(bdry.size()); @@ -112,16 +111,16 @@ void Foam::inverseFaceDistanceDiffusivity::correct() MeshWave waveInfo ( - mesh, + mesh(), changedFaces, faceDist, - mesh.globalData().nTotalCells()+1 // max iterations + mesh().globalData().nTotalCells()+1 // max iterations ); const List& faceInfo = waveInfo.allFaceInfo(); const List& cellInfo = waveInfo.allCellInfo(); - for (label faceI=0; faceI pointWallDist(mesh.nPoints()); - List edgeWallDist(mesh.nEdges()); + List pointWallDist(mesh().nPoints()); + List edgeWallDist(mesh().nEdges()); int dummyTrackData = 0; @@ -110,7 +109,7 @@ void Foam::inversePointDistanceDiffusivity::correct() // Not yet seeded seedInfo[nPatchEdges] = pointEdgePoint ( - mesh.points()[pointI], + mesh().points()[pointI], 0.0 ); seedPoints[nPatchEdges] = pointI; @@ -126,21 +125,21 @@ void Foam::inversePointDistanceDiffusivity::correct() // Do calculations PointEdgeWave waveInfo ( - mesh, + mesh(), seedPoints, seedInfo, pointWallDist, edgeWallDist, - mesh.globalData().nTotalPoints(),// max iterations + mesh().globalData().nTotalPoints(),// max iterations dummyTrackData ); } - for (label faceI=0; faceI Foam::motionDiffusivity::New ( - const fvMotionSolver& mSolver, + const fvMesh& mesh, Istream& mdData ) { @@ -61,7 +61,7 @@ Foam::autoPtr Foam::motionDiffusivity::New { FatalErrorIn ( - "motionDiffusivity::New(const tetPolyMesh& tetMesh, " + "motionDiffusivity::New(const fvMesh&, " "const Istream& dict)" ) << "Unknown diffusion type " << motionType << nl << nl @@ -70,7 +70,7 @@ Foam::autoPtr Foam::motionDiffusivity::New << exit(FatalError); } - return autoPtr(cstrIter()(mSolver, mdData)); + return autoPtr(cstrIter()(mesh, mdData)); } diff --git a/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.H b/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.H index f70524c335..b28ee1cfad 100644 --- a/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.H +++ b/src/fvMotionSolver/motionDiffusivity/motionDiffusivity/motionDiffusivity.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,8 +35,8 @@ SourceFiles #ifndef motionDiffusivity_H #define motionDiffusivity_H -#include "fvMotionSolver.H" #include "surfaceFieldsFwd.H" +#include "fvMesh.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -51,8 +51,8 @@ class motionDiffusivity { // Private data - //- Motion solver reference - const fvMotionSolver& mSolver_; + //- mesh reference + const fvMesh& mesh_; public: @@ -68,10 +68,10 @@ public: motionDiffusivity, Istream, ( - const fvMotionSolver& mSolver, + const fvMesh& mesh, Istream& mdData ), - (mSolver, mdData) + (mesh, mdData) ); @@ -80,15 +80,15 @@ public: //- Select null constructed static autoPtr New ( - const fvMotionSolver& mSolver, + const fvMesh& mesh, Istream& mdData ); // Constructors - //- Construct for the given fvMotionSolver - motionDiffusivity(const fvMotionSolver& mSolver); + //- Construct for the given fvMesh + motionDiffusivity(const fvMesh& mesh); //- Destructor @@ -97,10 +97,10 @@ public: // Member Functions - //- Return reference to the motion solver - const fvMotionSolver& mSolver() const + //- Return reference to the mesh + const fvMesh& mesh() const { - return mSolver_; + return mesh_; } //- Return diffusivity field diff --git a/src/fvMotionSolver/motionDiffusivity/motionDirectional/motionDirectionalDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/motionDirectional/motionDirectionalDiffusivity.C index f98469edd4..3fc5d48c5a 100644 --- a/src/fvMotionSolver/motionDiffusivity/motionDirectional/motionDirectionalDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/motionDirectional/motionDirectionalDiffusivity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,6 +27,7 @@ License #include "surfaceInterpolate.H" #include "zeroGradientFvPatchFields.H" #include "addToRunTimeSelectionTable.H" +#include "fvMotionSolver.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -47,11 +48,11 @@ namespace Foam Foam::motionDirectionalDiffusivity::motionDirectionalDiffusivity ( - const fvMotionSolver& mSolver, + const fvMesh& mesh, Istream& mdData ) : - uniformDiffusivity(mSolver, mdData), + uniformDiffusivity(mesh, mdData), diffusivityVector_(mdData) {} @@ -66,22 +67,20 @@ Foam::motionDirectionalDiffusivity::~motionDirectionalDiffusivity() void Foam::motionDirectionalDiffusivity::correct() { - const fvMesh& mesh = mSolver().mesh(); - static bool first = true; if (!first) { const volVectorField& cellMotionU = - mesh.lookupObject("cellMotionU"); + mesh().lookupObject("cellMotionU"); volVectorField D ( IOobject ( "D", - mesh.time().timeName(), - mesh + mesh().time().timeName(), + mesh() ), diffusivityVector_.y()*vector::one + (diffusivityVector_.x() - diffusivityVector_.y())*cellMotionU @@ -90,13 +89,17 @@ void Foam::motionDirectionalDiffusivity::correct() ); D.correctBoundaryConditions(); - const surfaceVectorField n(mesh.Sf()/mesh.magSf()); + const surfaceVectorField n(mesh().Sf()/mesh().magSf()); faceDiffusivity_ == (n & cmptMultiply(fvc::interpolate(D), n)); } else { first = false; - const_cast(mSolver()).solve(); + + const fvMotionSolver& mSolver = + mesh().lookupObject("dynamicMeshDict"); + + const_cast(mSolver).solve(); correct(); } } diff --git a/src/fvMotionSolver/motionDiffusivity/motionDirectional/motionDirectionalDiffusivity.H b/src/fvMotionSolver/motionDiffusivity/motionDirectional/motionDirectionalDiffusivity.H index 4396b1b121..02925d9a06 100644 --- a/src/fvMotionSolver/motionDiffusivity/motionDirectional/motionDirectionalDiffusivity.H +++ b/src/fvMotionSolver/motionDiffusivity/motionDirectional/motionDirectionalDiffusivity.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -72,12 +72,8 @@ public: // Constructors - //- Construct for the given fvMotionSolver and data Istream - motionDirectionalDiffusivity - ( - const fvMotionSolver& mSolver, - Istream& mdData - ); + //- Construct for the given fvMesh and data Istream + motionDirectionalDiffusivity(const fvMesh& mesh, Istream& mdData); //- Destructor diff --git a/src/fvMotionSolver/motionDiffusivity/uniform/uniformDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/uniform/uniformDiffusivity.C index 87648dfae8..8e7b470e3c 100644 --- a/src/fvMotionSolver/motionDiffusivity/uniform/uniformDiffusivity.C +++ b/src/fvMotionSolver/motionDiffusivity/uniform/uniformDiffusivity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,22 +45,22 @@ namespace Foam Foam::uniformDiffusivity::uniformDiffusivity ( - const fvMotionSolver& mSolver, + const fvMesh& mesh, Istream& ) : - motionDiffusivity(mSolver), + motionDiffusivity(mesh), faceDiffusivity_ ( IOobject ( "faceDiffusivity", - mSolver.mesh().time().timeName(), - mSolver.mesh(), + mesh.time().timeName(), + mesh, IOobject::NO_READ, IOobject::NO_WRITE ), - mSolver.mesh(), + mesh, dimensionedScalar("1.0", dimless, 1.0) ) {} diff --git a/src/fvMotionSolver/motionDiffusivity/uniform/uniformDiffusivity.H b/src/fvMotionSolver/motionDiffusivity/uniform/uniformDiffusivity.H index f843a12bf4..e0da293f71 100644 --- a/src/fvMotionSolver/motionDiffusivity/uniform/uniformDiffusivity.H +++ b/src/fvMotionSolver/motionDiffusivity/uniform/uniformDiffusivity.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,12 +78,8 @@ public: // Constructors - //- Construct for the given fvMotionSolver and data Istream - uniformDiffusivity - ( - const fvMotionSolver& mSolver, - Istream& mdData - ); + //- Construct for the given fvMesh and data Istream + uniformDiffusivity(const fvMesh& mesh, Istream& mdData); //- Destructor