1 Index: LESmodels/compressible/SpalartAllmaras/SpalartAllmaras.C
2 ===================================================================
3 --- src/LESmodels/compressible/SpalartAllmaras/SpalartAllmaras.C (Revision 30)
4 +++ src/LESmodels/compressible/SpalartAllmaras/SpalartAllmaras.C (Revision 439)
8 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
10 tmp<volScalarField> SpalartAllmaras::fv1() const
12 volScalarField chi3 = pow(nuTilda_/(mu()/rho()), 3);
14 return chi3/(chi3 + pow(Cv1_, 3));
18 tmp<volScalarField> SpalartAllmaras::fv2() const
20 volScalarField chi = nuTilda_/(mu()/rho());
21 return scalar(1) - chi/(scalar(1) + chi*fv1());
25 tmp<volScalarField> SpalartAllmaras::fw(const volScalarField& Stilda) const
27 - volScalarField r = nuTilda_/(Stilda*sqr(kappa_*dTilda_));
28 + volScalarField r = min
32 + max(Stilda, dimensionedScalar("SMALL", Stilda.dimensions(), SMALL))
33 + *sqr(kappa_*dTilda_)
37 + r.boundaryField() == 0.0;
39 volScalarField g = r + Cw2_*(pow(r, 6) - r);
41 return g*pow((1.0 + pow(Cw3_, 6))/(pow(g, 6) + pow(Cw3_, 6)), 1.0/6.0);
45 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
47 Index: dynamicMesh/meshCut/meshModifiers/multiDirRefinement/multiDirRefinement.C
48 ===================================================================
49 --- src/dynamicMesh/meshCut/meshModifiers/multiDirRefinement/multiDirRefinement.C (Revision 30)
50 +++ src/dynamicMesh/meshCut/meshModifiers/multiDirRefinement/multiDirRefinement.C (Revision 439)
57 hexRefiner.setRefinement(consistentCells, meshMod);
60 - autoPtr<mapPolyMesh> morphMapPtr = meshMod.changeMesh(mesh, true, true);
61 + // Change mesh, no inflation
62 + autoPtr<mapPolyMesh> morphMapPtr = meshMod.changeMesh(mesh, false, true);
63 const mapPolyMesh& morphMap = morphMapPtr();
65 if (morphMap.hasMotionPoints())
67 mesh.movePoints(morphMap.preMotionPoints());
72 Pout<< "multiDirRefinement : updated mesh at time "
73 << mesh.time().timeName() << endl;
76 hexRefiner.updateMesh(morphMap);
78 - // Take over split pattern from hex refiner. (should be empty at this
81 - // From old cell label to index
82 - Map<label> consistentSet(2*consistentCells.size());
84 - forAll(consistentCells, i)
86 - consistentSet.insert(consistentCells[i], i);
89 // Collect all cells originating from same old cell (original + 7 extra)
91 - addedCells_.setSize(consistentCells.size());
92 - forAll(addedCells_, i)
93 + forAll(consistentCells, i)
95 - addedCells_[i].setSize(8);
96 + addedCells_[consistentCells[i]].setSize(8);
98 - labelList nAddedCells(consistentCells.size(), 0);
99 + labelList nAddedCells(addedCells_.size(), 0);
101 const labelList& cellMap = morphMap.cellMap();
103 forAll(cellMap, cellI)
105 label oldCellI = cellMap[cellI];
107 - Map<label>::const_iterator iter = consistentSet.find(oldCellI);
109 - if (iter != consistentSet.end())
110 + if (addedCells_[oldCellI].size() > 0)
112 - label index = iter();
114 - addedCells_[nAddedCells[index]++] = cellI;
115 + addedCells_[oldCellI][nAddedCells[oldCellI]++] = cellI;
121 void Foam::multiDirRefinement::refineAllDirs
124 Index: OpenFOAM/db/error/error.H
125 ===================================================================
126 --- src/OpenFOAM/db/error/error.H (Revision 30)
127 +++ src/OpenFOAM/db/error/error.H (Revision 439)
130 //- Construct from title string
131 error(const string& title);
133 //- Construct from dictionary
134 error(const dictionary& errDict);
136 + //- Construct as copy
137 + error(const error& err);
146 Index: OpenFOAM/db/error/error.C
147 ===================================================================
148 --- src/OpenFOAM/db/error/error.C (Revision 30)
149 +++ src/OpenFOAM/db/error/error.C (Revision 439)
151 "cannot open error stream"
158 +error::error(const error& err)
160 + messageStream(err),
161 + functionName_(err.functionName_),
162 + sourceFileName_(err.sourceFileName_),
163 + sourceFileLineNumber_(err.sourceFileLineNumber_),
164 + abort_(err.abort_),
165 + throwExceptions_(err.throwExceptions_),
166 + messageStreamPtr_(new OStringStream(*err.messageStreamPtr_))
168 + //*messageStreamPtr_ << err.message();
174 delete messageStreamPtr_;
178 OSstream& error::operator()
179 @@ -251,14 +265,15 @@
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 // Global error definitions
187 -error FatalError ("--> FOAM FATAL ERROR : ");
188 +error FatalError("--> FOAM FATAL ERROR : ");
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 } // End namespace Foam
194 // ************************************************************************* //
196 Index: OpenFOAM/db/dictionary/dictionary.C
197 ===================================================================
198 --- src/OpenFOAM/db/dictionary/dictionary.C (Revision 30)
199 +++ src/OpenFOAM/db/dictionary/dictionary.C (Revision 439)
200 @@ -119,14 +119,20 @@
208 +// Clear the Dictionary
209 +void Foam::dictionary::clear()
211 + IDLList<entry>::clear();
212 + hashedEntries_.clear();
215 // Find and return entry
216 bool Foam::dictionary::found(const word& keyword) const
218 return hashedEntries_.found(keyword);
221 Index: OpenFOAM/db/dictionary/dictionary.H
222 ===================================================================
223 --- src/OpenFOAM/db/dictionary/dictionary.H (Revision 30)
224 +++ src/OpenFOAM/db/dictionary/dictionary.H (Revision 439)
225 @@ -126,14 +126,16 @@
227 //- Return line number of first token in dictionary
228 label startLineNumber() const;
230 //- Return line number of last token in dictionary
231 label endLineNumber() const;
233 + //- Clear the dictionary
238 //- Search dictionary for given keyword
239 bool found(const word& keyword) const;
241 //- Find and return an entry data stream
242 Index: OpenFOAM/db/IOstreams/StringStreams/OStringStream.H
243 ===================================================================
244 --- src/OpenFOAM/db/IOstreams/StringStreams/OStringStream.H (Revision 30)
245 +++ src/OpenFOAM/db/IOstreams/StringStreams/OStringStream.H (Revision 439)
248 streamFormat format=ASCII,
249 versionNumber version=currentVersion
254 - *(new std::ostringstream()),
255 + *(new std::ostringstream()),
256 "OStringStream.sinkFile",
262 + //- Construct as copy
263 + OStringStream(const OStringStream& oss)
268 + new std::ostringstream
270 + dynamic_cast<const std::ostringstream&>
287 delete &dynamic_cast<std::ostringstream&>(stream());
289 Index: OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldFunctions.H
290 ===================================================================
291 --- src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldFunctions.H (Revision 30)
292 +++ src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldFunctions.H (Revision 439)
293 @@ -214,32 +214,28 @@
294 #undef BINARY_TYPE_OPERATOR_FT
297 #define PRODUCT_OPERATOR(product, op, opFunc) \
301 - template<class> class PatchField, \
302 - class pointPatch, \
309 <typename product<Type1, Type2>::type>& f, \
310 const pointPatchField<Type1>& f1, \
311 const pointPatchField<Type2>& f2 \
317 - template<class> class PatchField, \
318 - class pointPatch, \
326 @@ -248,16 +244,14 @@
327 const pointPatchField<Type>& f1, \
328 const VectorSpace<Form,Cmpt,nCmpt>& vs \
334 - template<class> class PatchField, \
335 - class pointPatch, \
343 @@ -272,112 +266,99 @@
344 PRODUCT_OPERATOR(crossProduct, ^, cross)
345 PRODUCT_OPERATOR(innerProduct, &, dot)
346 PRODUCT_OPERATOR(scalarProduct, &&, dotdot)
348 #undef PRODUCT_OPERATOR
351 -template<template<class> class PatchField, class pointPatch>
355 pointPatchField<vector>&,
356 const pointPatchField<tensor>&
360 -template<template<class> class PatchField, class pointPatch>
364 pointPatchField<tensor>&,
365 const pointPatchField<vector>&
369 -template<template<class> class PatchField, class pointPatch>
373 pointPatchField<vector>&,
374 const pointPatchField<tensor>&
378 -template<template<class> class PatchField, class pointPatch>
382 pointPatchField<scalar>&,
383 const pointPatchField<tensor>&
387 -template<template<class> class PatchField, class pointPatch>
391 pointPatchField<tensor>&,
392 const pointPatchField<tensor>&
396 -template<template<class> class PatchField, class pointPatch>
400 pointPatchField<tensor>&,
401 const pointPatchField<tensor>&
405 -template<template<class> class PatchField, class pointPatch>
409 pointPatchField<scalar>&,
410 const pointPatchField<tensor>&
414 -template<template<class> class PatchField, class pointPatch>
418 pointPatchField<tensor>&,
419 const pointPatchField<tensor>&
423 -template<template<class> class PatchField, class pointPatch>
427 pointPatchField<tensor>&,
428 const pointPatchField<tensor>&
432 -template<template<class> class PatchField, class pointPatch>
436 pointPatchField<tensor>&,
437 const pointPatchField<tensor>&
441 -template<template<class> class PatchField, class pointPatch>
445 pointPatchField<tensor>&,
446 const pointPatchField<tensor>&
450 -template<template<class> class PatchField, class pointPatch>
452 +inline void eigenValues
454 pointPatchField<vector>&,
455 const pointPatchField<tensor>&
459 -template<template<class> class PatchField, class pointPatch>
461 +inline void eigenVectors
463 pointPatchField<tensor>&,
464 const pointPatchField<tensor>&
469 Index: OpenFOAM/fields/Fields/symmTensorField/symmTensorField.C
470 ===================================================================
471 --- src/OpenFOAM/fields/Fields/symmTensorField/symmTensorField.C (Revision 30)
472 +++ src/OpenFOAM/fields/Fields/symmTensorField/symmTensorField.C (Revision 439)
473 @@ -131,16 +131,15 @@
476 tmp<Field<symmTensor> > transformFieldMask<symmTensor>
478 const tmp<tensorField>& ttf
481 - tmp<Field<symmTensor> > ret =
482 - transformFieldMask<symmTensor>(ttf());
483 + tmp<Field<symmTensor> > ret = transformFieldMask<symmTensor>(ttf());
490 tmp<Field<symmTensor> > transformFieldMask<symmTensor>
491 @@ -153,18 +152,15 @@
494 tmp<Field<symmTensor> > transformFieldMask<symmTensor>
496 const tmp<symmTensorField>& tstf
499 - tmp<Field<symmTensor> > ret =
500 - transformFieldMask<symmTensor>(tstf());
507 // * * * * * * * * * * * * * * * global operators * * * * * * * * * * * * * //
509 UNARY_OPERATOR(vector, symmTensor, *, hdual)
511 Index: OpenFOAM/primitives/Tensor/TensorI.H
512 ===================================================================
513 --- src/OpenFOAM/primitives/Tensor/TensorI.H (Revision 30)
514 +++ src/OpenFOAM/primitives/Tensor/TensorI.H (Revision 439)
515 @@ -358,14 +358,23 @@
516 v1.x()*v2.x(), v1.x()*v2.y(), v1.x()*v2.z(),
517 v1.y()*v2.x(), v1.y()*v2.y(), v1.y()*v2.z(),
518 v1.z()*v2.x(), v1.z()*v2.y(), v1.z()*v2.z()
523 +//- Division of a vector by a tensor, i.e. dot-product with the tensor inverse
524 +template <class Cmpt>
525 +inline typename innerProduct<Vector<Cmpt>, Tensor<Cmpt> >::type
526 +operator/(const Vector<Cmpt>& v, const Tensor<Cmpt>& t)
532 // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
534 //- Return the trace of a tensor
535 template <class Cmpt>
536 inline Cmpt tr(const Tensor<Cmpt>& t)
538 return t.xx() + t.yy() + t.zz();
539 @@ -790,46 +799,30 @@
540 //- Double-dot-product between a spherical tensor and a tensor
541 template <class Cmpt>
543 operator&&(const SymmTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
547 - st1.xx()*t2.xx() + st1.xy()*t2.yx() + st1.xz()*t2.zx() +
548 - st1.xx()*t2.xy() + st1.xy()*t2.yy() + st1.xz()*t2.zy() +
549 - st1.xx()*t2.xz() + st1.xy()*t2.yz() + st1.xz()*t2.zz() +
551 - st1.xy()*t2.xx() + st1.yy()*t2.yx() + st1.yz()*t2.zx() +
552 - st1.xy()*t2.xy() + st1.yy()*t2.yy() + st1.yz()*t2.zy() +
553 - st1.xy()*t2.xz() + st1.yy()*t2.yz() + st1.yz()*t2.zz() +
555 - st1.xz()*t2.xx() + st1.yz()*t2.yx() + st1.zz()*t2.zx() +
556 - st1.xz()*t2.xy() + st1.yz()*t2.yy() + st1.zz()*t2.zy() +
557 - st1.xz()*t2.xz() + st1.yz()*t2.yz() + st1.zz()*t2.zz()
558 + st1.xx()*t2.xx() + st1.xy()*t2.xy() + st1.xz()*t2.xz() +
559 + st1.xy()*t2.yx() + st1.yy()*t2.yy() + st1.yz()*t2.yz() +
560 + st1.xz()*t2.zx() + st1.yz()*t2.zy() + st1.zz()*t2.zz()
565 //- Double-dot-product between a tensor and a spherical tensor
566 template <class Cmpt>
568 operator&&(const Tensor<Cmpt>& t1, const SymmTensor<Cmpt>& st2)
572 t1.xx()*st2.xx() + t1.xy()*st2.xy() + t1.xz()*st2.xz() +
573 - t1.xx()*st2.xy() + t1.xy()*st2.yy() + t1.xz()*st2.yz() +
574 - t1.xx()*st2.xz() + t1.xy()*st2.yz() + t1.xz()*st2.zz() +
576 - t1.yx()*st2.xx() + t1.yy()*st2.xy() + t1.yz()*st2.xz() +
577 t1.yx()*st2.xy() + t1.yy()*st2.yy() + t1.yz()*st2.yz() +
578 - t1.yx()*st2.xz() + t1.yy()*st2.yz() + t1.yz()*st2.zz() +
580 - t1.zx()*st2.xx() + t1.zy()*st2.xy() + t1.zz()*st2.xz() +
581 - t1.zx()*st2.xy() + t1.zy()*st2.yy() + t1.zz()*st2.yz() +
582 t1.zx()*st2.xz() + t1.zy()*st2.yz() + t1.zz()*st2.zz()
588 class typeOfSum<SymmTensor<Cmpt>, Tensor<Cmpt> >
590 Index: finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C
591 ===================================================================
592 --- src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C (Revision 30)
593 +++ src/finiteVolume/fvMatrices/fvMatrix/fvMatrixSolve.C (Revision 439)
596 You should have received a copy of the GNU General Public License
597 along with OpenFOAM; if not, write to the Free Software Foundation,
598 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
600 \*---------------------------------------------------------------------------*/
602 -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
607 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
610 -void fvMatrix<Type>::setComponentReference
611 +void Foam::fvMatrix<Type>::setComponentReference
615 const direction cmpt,
627 -lduMatrix::solverPerformance fvMatrix<Type>::solve(Istream& solverControls)
628 +Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve
630 + Istream& solverControls
635 Info<< "fvMatrix<Type>::solve(Istream& solverControls) : "
636 "solving fvMatrix<Type>"
640 "fvMatrix<Type>::solve",
644 scalarField saveDiag = diag();
646 Field<Type> source = source_;
647 - addBoundarySource(source, false);
649 + // At this point include the boundary source from the coupled boundaries.
650 + // This is corrected for the implict part by updateMatrixInterfaces within
651 + // the component loop.
652 + addBoundarySource(source);
654 typename Type::labelType validComponents
658 psi_.mesh().directions(),
659 pTraits<typename powProduct<Vector<label>, Type::rank>::type>::zero
660 @@ -105,14 +107,35 @@
662 internalCoeffs_.component(cmpt)
665 lduInterfaceFieldPtrsList interfaces =
666 psi_.boundaryField().interfaces();
668 + // Use the initMatrixInterfaces and updateMatrixInterfaces to correct
669 + // bouCoeffsCmpt for the explicit part of the coupled boundary
671 + initMatrixInterfaces
680 + updateMatrixInterfaces
689 lduMatrix::solverPerformance solverPerf;
692 solverPerf = lduMatrix::solver::New
694 psi_.name() + pTraits<Type>::componentNames[cmpt],
696 @@ -140,35 +163,36 @@
697 psi_.correctBoundaryConditions();
699 return solverPerfVec;
704 -autoPtr<typename fvMatrix<Type>::fvSolver> fvMatrix<Type>::solver()
705 +Foam::autoPtr<typename Foam::fvMatrix<Type>::fvSolver>
706 +Foam::fvMatrix<Type>::solver()
708 return solver(psi_.mesh().solver(psi_.name()));
712 -lduMatrix::solverPerformance fvMatrix<Type>::fvSolver::solve()
713 +Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::fvSolver::solve()
715 return solve(psi_.mesh().solver(psi_.name()));
720 -lduMatrix::solverPerformance fvMatrix<Type>::solve()
721 +Foam::lduMatrix::solverPerformance Foam::fvMatrix<Type>::solve()
723 return solve(psi_.mesh().solver(psi_.name()));
728 -tmp<Field<Type> > fvMatrix<Type>::residual() const
729 +Foam::tmp<Foam::Field<Type> > Foam::fvMatrix<Type>::residual() const
731 tmp<Field<Type> > tres(source_);
732 Field<Type>& res = tres();
734 addBoundarySource(res);
736 // Loop over field components
745 -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
747 -} // End namespace Foam
749 // ************************************************************************* //
750 Index: finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C
751 ===================================================================
752 --- src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C (Revision 30)
753 +++ src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C (Revision 439)
754 @@ -181,14 +181,15 @@
757 fixedValueFvPatchField<Type>(ptf, iF),
758 setAverage_(ptf.setAverage_),
759 referenceCS_(ptf.referenceCS_),
760 nearestVertex_(ptf.nearestVertex_),
761 nearestVertexWeight_(ptf.nearestVertexWeight_),
762 + fieldName_(ptf.fieldName_),
763 sampleTimes_(ptf.sampleTimes_),
764 startSampleTime_(ptf.startSampleTime_),
765 startSampledValues_(ptf.startSampledValues_),
766 startAverage_(ptf.startAverage_),
767 endSampleTime_(ptf.endSampleTime_),
768 endSampledValues_(ptf.endSampledValues_),
769 endAverage_(ptf.endAverage_)
770 Index: finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C
771 ===================================================================
772 --- src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C (Revision 30)
773 +++ src/finiteVolume/finiteVolume/ddtSchemes/backwardDdtScheme/backwardDdtScheme.C (Revision 439)
774 @@ -323,15 +323,15 @@
775 *vf.oldTime().internalField()*mesh().V0()
776 - coefft00*rho.oldTime().oldTime().internalField()
777 *vf.oldTime().oldTime().internalField()*mesh().V00()
782 - coefft*vf.boundaryField() -
783 + coefft*rho.boundaryField()*vf.boundaryField() -
785 coefft0*rho.oldTime().boundaryField()
786 *vf.oldTime().boundaryField()
787 - coefft00*rho.oldTime().oldTime().boundaryField()
788 *vf.oldTime().oldTime().boundaryField()
791 Index: finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C
792 ===================================================================
793 --- src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C (Revision 30)
794 +++ src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresVectors.C (Revision 439)
795 @@ -150,15 +150,15 @@
798 forAll(pd, patchFacei)
800 const vector& d = pd[patchFacei];
802 dd[faceCells[patchFacei]] +=
803 - (pw[patchFacei]*pMagSf[patchFacei]/magSqr(d))*sqr(d);
804 + ((1 - pw[patchFacei])*pMagSf[patchFacei]/magSqr(d))*sqr(d);
809 forAll(pd, patchFacei)
811 const vector& d = pd[patchFacei];
813 Index: turbulenceModels/compressible/kOmegaSST/kOmegaSST.C
814 ===================================================================
815 --- src/turbulenceModels/compressible/kOmegaSST/kOmegaSST.C (Revision 30)
816 +++ src/turbulenceModels/compressible/kOmegaSST/kOmegaSST.C (Revision 439)
817 @@ -237,15 +237,15 @@
820 divU += fvc::div(mesh_.phi());
823 tmp<volTensorField> tgradU = fvc::grad(U_);
824 volScalarField S2 = magSqr(symm(tgradU()));
825 - volScalarField GbyMu = 2*mut_*(tgradU() && dev(symm(tgradU())));
826 + volScalarField GbyMu = 2*(tgradU() && dev(symm(tgradU())));
827 volScalarField G = mut_*GbyMu;
830 # include "kOmegaWallFunctionsI.H"
832 volScalarField CDkOmega =
833 (2*alphaOmega2)*(fvc::grad(k_) & fvc::grad(omega_))/omega_;
834 @@ -280,15 +280,15 @@
835 // Turbulent kinetic energy equation
836 tmp<fvScalarMatrix> kEqn
840 - fvm::laplacian(DkEff(F1), k_)
842 - min(G, c1*betaStar*k_*omega_)
843 + min(G, (c1*betaStar)*rho_*k_*omega_)
844 - fvm::SuSp(2.0/3.0*rho_*divU, k_)
845 - fvm::Sp(rho_*betaStar*omega_, k_)