diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/correctPhi.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/correctPhi.H index e916b7a5..c7045732 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/correctPhi.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/correctPhi.H @@ -46,14 +46,18 @@ if (mesh.changing()) { fvScalarMatrix pcorrEqn ( - fvm::laplacian(rAUf, pcorr) == fvc::div(phi) - divrhoU + fvm::ddt(psi, pcorr) + + fvc::div(phi) + - fvm::laplacian(rAUf, pcorr) + == + divrhoU ); pcorrEqn.solve(); if (pimple.finalNonOrthogonalIter()) { - phi -= pcorrEqn.flux(); + phi += pcorrEqn.flux(); } } } diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H index e9fab27b..5270e3d8 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPimpleDyMFoam/pEqn.H @@ -112,5 +112,10 @@ K = 0.5*magSqr(U); if (thermo.dpdt()) { - dpdt = fvc::ddt(p) - fvc::div(fvc::meshPhi(rho, U), p); + dpdt = fvc::ddt(p); + + if (mesh.moving()) + { + dpdt -= fvc::div(fvc::meshPhi(rho, U), p); + } } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index 226d6ab3..2513312e 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -96,11 +96,6 @@ void epsilonWallFunctionFvPatchScalarField::setMaster() void epsilonWallFunctionFvPatchScalarField::createAveragingWeights() { - if (initialised_) - { - return; - } - const volScalarField& epsilon = static_cast(this->dimensionedInternalField()); @@ -108,6 +103,11 @@ void epsilonWallFunctionFvPatchScalarField::createAveragingWeights() const fvMesh& mesh = epsilon.mesh(); + if (initialised_ && !mesh.changing()) + { + return; + } + volScalarField weights ( IOobject diff --git a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index 375d4c6c..c8f8b93f 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -98,11 +98,6 @@ void omegaWallFunctionFvPatchScalarField::setMaster() void omegaWallFunctionFvPatchScalarField::createAveragingWeights() { - if (initialised_) - { - return; - } - const volScalarField& omega = static_cast(this->dimensionedInternalField()); @@ -110,6 +105,11 @@ void omegaWallFunctionFvPatchScalarField::createAveragingWeights() const fvMesh& mesh = omega.mesh(); + if (initialised_ && !mesh.changing()) + { + return; + } + volScalarField weights ( IOobject diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C index e05c34aa..b5948bed 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -145,38 +145,6 @@ flowRateInletVelocityFvPatchVectorField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs -( - const scalar uniformRho -) -{ - if (updated()) - { - return; - } - - const scalar t = db().time().timeOutputValue(); - - // a simpler way of doing this would be nice - const scalar avgU = -flowRate_->value(t)/gSum(patch().magSf()); - - tmp n = patch().nf(); - - if (volumetric_ || rhoName_ == "none") - { - // volumetric flow-rate - operator==(n*avgU); - } - else - { - // mass flow-rate - operator==(n*avgU/uniformRho); - } - - fixedValueFvPatchVectorField::updateCoeffs(); -} - - void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs() { if (updated()) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H index 80512611..f8e8f491 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,7 +71,7 @@ Description rhoInlet 1.0; } \endverbatim - + The \c flowRate entry is a \c DataEntry type, meaning that it can be specified as constant, a polynomial fuction of time, and ... @@ -195,10 +195,6 @@ public: // Member functions - //- Update the coefficients associated with the patch field given - // uniform density field - void updateCoeffs(const scalar uniformRho); - //- Update the coefficients associated with the patch field virtual void updateCoeffs(); diff --git a/src/finiteVolume/fvMesh/fvMeshGeometry.C b/src/finiteVolume/fvMesh/fvMeshGeometry.C index 422ca761..3c61706f 100644 --- a/src/finiteVolume/fvMesh/fvMeshGeometry.C +++ b/src/finiteVolume/fvMesh/fvMeshGeometry.C @@ -441,7 +441,7 @@ const surfaceScalarField& fvMesh::phi() const { FatalErrorIn("fvMesh::phi()") << "mesh flux field does not exist, is the mesh actually moving?" - << exit(FatalError); + << abort(FatalError); } // Set zero current time @@ -461,7 +461,7 @@ surfaceScalarField& fvMesh::setPhi() { FatalErrorIn("fvMesh::setPhi()") << "mesh flux field does not exist, is the mesh actually moving?" - << exit(FatalError); + << abort(FatalError); } return *phiPtr_; diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index b0899d12..1bf17b6f 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -98,11 +98,6 @@ void epsilonWallFunctionFvPatchScalarField::setMaster() void epsilonWallFunctionFvPatchScalarField::createAveragingWeights() { - if (initialised_) - { - return; - } - const volScalarField& epsilon = static_cast(this->dimensionedInternalField()); @@ -110,6 +105,11 @@ void epsilonWallFunctionFvPatchScalarField::createAveragingWeights() const fvMesh& mesh = epsilon.mesh(); + if (initialised_ && !mesh.changing()) + { + return; + } + volScalarField weights ( IOobject diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index 4fa24330..89d4782a 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -100,11 +100,6 @@ void omegaWallFunctionFvPatchScalarField::setMaster() void omegaWallFunctionFvPatchScalarField::createAveragingWeights() { - if (initialised_) - { - return; - } - const volScalarField& omega = static_cast(this->dimensionedInternalField()); @@ -112,6 +107,11 @@ void omegaWallFunctionFvPatchScalarField::createAveragingWeights() const fvMesh& mesh = omega.mesh(); + if (initialised_ && !mesh.changing()) + { + return; + } + volScalarField weights ( IOobject diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index 9a8841f7..2437271e 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -98,11 +98,6 @@ void epsilonWallFunctionFvPatchScalarField::setMaster() void epsilonWallFunctionFvPatchScalarField::createAveragingWeights() { - if (initialised_) - { - return; - } - const volScalarField& epsilon = static_cast(this->dimensionedInternalField()); @@ -110,6 +105,11 @@ void epsilonWallFunctionFvPatchScalarField::createAveragingWeights() const fvMesh& mesh = epsilon.mesh(); + if (initialised_ && !mesh.changing()) + { + return; + } + volScalarField weights ( IOobject diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index 066f03a0..ebc195ec 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -100,11 +100,6 @@ void omegaWallFunctionFvPatchScalarField::setMaster() void omegaWallFunctionFvPatchScalarField::createAveragingWeights() { - if (initialised_) - { - return; - } - const volScalarField& omega = static_cast(this->dimensionedInternalField()); @@ -112,6 +107,11 @@ void omegaWallFunctionFvPatchScalarField::createAveragingWeights() const fvMesh& mesh = omega.mesh(); + if (initialised_ && !mesh.changing()) + { + return; + } + volScalarField weights ( IOobject