diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/correctPhi.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/correctPhi.H index 117790446e9509ee3dcbfd235f9dd8db44508a41..9bed803d1e7be78b71e1d7bfde39bb93f8bf1d0e 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/correctPhi.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/correctPhi.H @@ -68,4 +68,6 @@ } } +phi.oldTime() = phi; + #include "continuityErrs.H" diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/correctPhi.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/correctPhi.H index 1d7b9ca624a4e0acb1d653890c23adda345b5627..513ef961bd7e411cde9fee70434c1c418e84f4e5 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/correctPhi.H +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/correctPhi.H @@ -56,6 +56,8 @@ phi -= pcorrEqn.flux(); } } - - #include "continuityErrs.H" } + +phi.oldTime() = phi; + +#include "continuityErrs.H" diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/correctPhi.H b/applications/solvers/multiphase/interFoam/interDyMFoam/correctPhi.H index 0e373e1f404f7f747795202797049a0b212f367b..c4cdbc044bc772744e1769cce6ea5c4873de93c8 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/correctPhi.H +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/correctPhi.H @@ -53,6 +53,8 @@ fvc::makeRelative(phi, U); } } - - #include "continuityErrs.H" } + +phi.oldTime() = phi; + +#include "continuityErrs.H" diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C index f5622451cbf45706cc3c7569aff24b2ea9bb2d1b..fa3d6d7a315e0fcea6297366534e853e408fa9bc 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C @@ -198,10 +198,61 @@ void Foam::fvPatchField<Type>::patchInternalField(Field<Type>& pif) const template<class Type> void Foam::fvPatchField<Type>::autoMap ( - const fvPatchFieldMapper& m + const fvPatchFieldMapper& mapper ) { - Field<Type>::autoMap(m); + Field<Type>& f = *this; + + if (!this->size()) + { + f.setSize(mapper.size()); + if (f.size()) + { + f = this->patchInternalField(); + } + } + else + { + // Map all faces provided with mapping data + Field<Type>::autoMap(mapper); + + // For unmapped faces set to internal field value (zero-gradient) + if + ( + mapper.direct() + && &mapper.directAddressing() + && mapper.directAddressing().size() + ) + { + Field<Type> pif(this->patchInternalField()); + + const labelList& mapAddressing = mapper.directAddressing(); + + forAll(mapAddressing, i) + { + if (mapAddressing[i] < 0) + { + f[i] = pif[i]; + } + } + } + else if (!mapper.direct() && mapper.addressing().size()) + { + Field<Type> pif(this->patchInternalField()); + + const labelListList& mapAddressing = mapper.addressing(); + + forAll(mapAddressing, i) + { + const labelList& localAddrs = mapAddressing[i]; + + if (!localAddrs.size()) + { + f[i] = pif[i]; + } + } + } + } } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/epsilon b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/epsilon index d5ee15eb79d080246921e64270bf55a4d1541884..bb5b3e0a73f083f93109b40e0d3659f5f1466b6d 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/epsilon +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/epsilon @@ -29,6 +29,7 @@ boundaryField outlet { type inletOutlet; + phi phiwater; inletValue uniform 0.1; value uniform 0.1; } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/k b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/k index a791cb824f67debc5017f8efa4da5b3e4349556d..9701bd625c5d07a6522baa8bdfbbc7b42ba0db3c 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/k +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/bubbleColumn/0/k @@ -29,6 +29,7 @@ boundaryField outlet { type inletOutlet; + phi phiwater; inletValue uniform 1e-8; value uniform 1e-8; } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/epsilon b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/epsilon index ee84cd44265e7dcde3de56307d9e9d6f7d737883..69b3e74c838b2f693281b70c870742448faeb9b8 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/epsilon +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/epsilon @@ -31,6 +31,7 @@ boundaryField outlet { type inletOutlet; + phi phi2; inletValue uniform 10.0; value uniform 10.0; } diff --git a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/k b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/k index 45302e2a18f632b4bcc79ff4bd9535e971dbbf5f..1ae05e468e21b3ba28c4aecccfafa12962e30bce 100644 --- a/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/k +++ b/tutorials/multiphase/compressibleTwoPhaseEulerFoam/fluidisedBed/0/k @@ -31,6 +31,7 @@ boundaryField outlet { type inletOutlet; + phi phi2; inletValue uniform 1.0; value uniform 1.0; } diff --git a/tutorials/multiphase/twoPhaseEulerFoam/bed/0/Theta b/tutorials/multiphase/twoPhaseEulerFoam/bed/0/Theta index 3a4a3b6744614cd730f8805ad21820c9e99117e8..2ac308e7d1ce434b094e84b917904db8fd356bb7 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/bed/0/Theta +++ b/tutorials/multiphase/twoPhaseEulerFoam/bed/0/Theta @@ -30,6 +30,7 @@ boundaryField top { type inletOutlet; + phi phi1; inletValue uniform 1.0e-8; } diff --git a/tutorials/multiphase/twoPhaseEulerFoam/bed/0/epsilon b/tutorials/multiphase/twoPhaseEulerFoam/bed/0/epsilon index 79b3e97bad66442ae9f9dda9d0eeaaa0edfa2ad3..79fe0eda3fb27eb2a2c43092f0df67f3bb7f12e4 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/bed/0/epsilon +++ b/tutorials/multiphase/twoPhaseEulerFoam/bed/0/epsilon @@ -29,6 +29,7 @@ boundaryField top { type inletOutlet; + phi phi2; inletValue uniform 10.0; value uniform 10.0; } diff --git a/tutorials/multiphase/twoPhaseEulerFoam/bed/0/k b/tutorials/multiphase/twoPhaseEulerFoam/bed/0/k index ebc748ced17d51773bdff65585a2e0a278dcd022..188184e8b4dbf16123ec79623d9d19789baa973f 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/bed/0/k +++ b/tutorials/multiphase/twoPhaseEulerFoam/bed/0/k @@ -29,6 +29,7 @@ boundaryField top { type inletOutlet; + phi phi2; inletValue uniform 1.0; value uniform 1.0; } diff --git a/tutorials/multiphase/twoPhaseEulerFoam/bed2/0/epsilon b/tutorials/multiphase/twoPhaseEulerFoam/bed2/0/epsilon index ee88570d3991e180c4cc884e4202b4c61309d80f..4ff943aac34460251e6bdbe47cc276215d1f766e 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/bed2/0/epsilon +++ b/tutorials/multiphase/twoPhaseEulerFoam/bed2/0/epsilon @@ -27,6 +27,7 @@ boundaryField outlet { type inletOutlet; + phi phi2; inletValue uniform 10.0; value uniform 10.0; } diff --git a/tutorials/multiphase/twoPhaseEulerFoam/bed2/0/k b/tutorials/multiphase/twoPhaseEulerFoam/bed2/0/k index 0d6e80afbab447df5016caddee63f112c9ce03b5..6b3ddf98cffd1674871f61e8f5f47d38d23fcbc8 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/bed2/0/k +++ b/tutorials/multiphase/twoPhaseEulerFoam/bed2/0/k @@ -27,6 +27,7 @@ boundaryField outlet { type inletOutlet; + phi phi2; inletValue uniform 1.0; value uniform 1.0; } diff --git a/tutorials/multiphase/twoPhaseEulerFoam/bubbleColumn/0/Theta b/tutorials/multiphase/twoPhaseEulerFoam/bubbleColumn/0/Theta index e45304b83464ea6a9568531b35b570abae0d768f..523be90f325771799ebe37548e2fb4e5e8b460e9 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/bubbleColumn/0/Theta +++ b/tutorials/multiphase/twoPhaseEulerFoam/bubbleColumn/0/Theta @@ -29,6 +29,7 @@ boundaryField outlet { type inletOutlet; + phi phi1; inletValue uniform 1.0e-7; value uniform 1.0e-7; } diff --git a/tutorials/multiphase/twoPhaseEulerFoam/bubbleColumn/0/epsilon b/tutorials/multiphase/twoPhaseEulerFoam/bubbleColumn/0/epsilon index d5ee15eb79d080246921e64270bf55a4d1541884..d54d0a402bae4eb3e2e8f7916d06fb9de239be57 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/bubbleColumn/0/epsilon +++ b/tutorials/multiphase/twoPhaseEulerFoam/bubbleColumn/0/epsilon @@ -29,6 +29,7 @@ boundaryField outlet { type inletOutlet; + phi phi2; inletValue uniform 0.1; value uniform 0.1; } diff --git a/tutorials/multiphase/twoPhaseEulerFoam/bubbleColumn/0/k b/tutorials/multiphase/twoPhaseEulerFoam/bubbleColumn/0/k index a791cb824f67debc5017f8efa4da5b3e4349556d..bf8d7cc467cd6a46871954606b86a3132f02972a 100644 --- a/tutorials/multiphase/twoPhaseEulerFoam/bubbleColumn/0/k +++ b/tutorials/multiphase/twoPhaseEulerFoam/bubbleColumn/0/k @@ -29,6 +29,7 @@ boundaryField outlet { type inletOutlet; + phi phi2; inletValue uniform 1e-8; value uniform 1e-8; }