diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index 9edc7a78..aac421f1 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -112,6 +112,17 @@ Foam::multiphaseMixture::multiphaseMixture zeroGradientFvPatchScalarField::typeName ), + nu_ + ( + IOobject + ( + "nu", + mesh_.time().timeName(), + mesh_ + ), + mu()/rho() + ), + sigmas_(lookup("sigmas")), dimSigma_(1, 0, -2, 0, 0), deltaN_ @@ -218,14 +229,14 @@ Foam::multiphaseMixture::muf() const Foam::tmp Foam::multiphaseMixture::nu() const { - return mu()/rho(); + return nu_; } Foam::tmp Foam::multiphaseMixture::nu(const label patchi) const { - return mu(patchi)/rho(patchi); + return nu_.boundaryField()[patchi]; } @@ -340,6 +351,9 @@ void Foam::multiphaseMixture::solve() { solveAlphas(cAlpha); } + + // Update the mixture kinematic viscosity + nu_ = mu()/rho(); } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H index be4f2cbe..173e9b03 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H @@ -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 @@ -141,9 +141,10 @@ private: const surfaceScalarField& phi_; surfaceScalarField rhoPhi_; - volScalarField alphas_; + volScalarField nu_; + typedef HashTable sigmaTable; diff --git a/src/OpenFOAM/db/error/messageStream.H b/src/OpenFOAM/db/error/messageStream.H index 68032d40..01575f22 100644 --- a/src/OpenFOAM/db/error/messageStream.H +++ b/src/OpenFOAM/db/error/messageStream.H @@ -282,13 +282,6 @@ extern messageStream Info; ::Foam::Pout<< "["<< __FILE__ << ":" << __LINE__ << "] " \ << #var " = " << var << ::Foam::endl -/** - * \def IInfo - * Indented Info -*/ -#define IInfo \ - ::Foam::Info<< indent - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C b/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C index f2bab598..a04fc522 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -130,11 +130,11 @@ void Foam::functionObjectFile::write() void Foam::functionObjectFile::resetNames(const wordList& names) { + names_.clear(); + names_.insert(names); + if (Pstream::master()) { - names_.clear(); - names_.insert(names); - filePtrs_.clear(); filePtrs_.setSize(names_.toc().size()); @@ -145,11 +145,11 @@ void Foam::functionObjectFile::resetNames(const wordList& names) void Foam::functionObjectFile::resetName(const word& name) { + names_.clear(); + names_.insert(name); + if (Pstream::master()) { - names_.clear(); - names_.insert(name); - filePtrs_.clear(); filePtrs_.setSize(1); @@ -191,11 +191,11 @@ Foam::functionObjectFile::functionObjectFile names_(), filePtrs_() { + names_.clear(); + names_.insert(name); + if (Pstream::master()) { - names_.clear(); - names_.insert(name); - filePtrs_.clear(); filePtrs_.setSize(1); @@ -216,11 +216,11 @@ Foam::functionObjectFile::functionObjectFile names_(names), filePtrs_() { + names_.clear(); + names_.insert(names); + if (Pstream::master()) { - names_.clear(); - names_.insert(names); - filePtrs_.clear(); filePtrs_.setSize(names_.size()); diff --git a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C index 1ce0a838..54df8c5b 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C @@ -203,9 +203,21 @@ void Foam::porosityModels::DarcyForchheimer::correct if (UEqn.dimensions() == dimForce) { const volScalarField& rho = mesh_.lookupObject(rhoName); - const volScalarField& mu = mesh_.lookupObject(muName); - apply(Udiag, Usource, V, rho, mu, U); + if (mesh_.foundObject(muName)) + { + const volScalarField& mu = + mesh_.lookupObject(muName); + + apply(Udiag, Usource, V, rho, mu, U); + } + else + { + const volScalarField& nu = + mesh_.lookupObject(nuName); + + apply(Udiag, Usource, V, rho, rho*nu, U); + } } else { diff --git a/src/fvOptions/fvOptions/fvOption.C b/src/fvOptions/fvOptions/fvOption.C index 011b8e6e..3387bdec 100644 --- a/src/fvOptions/fvOptions/fvOption.C +++ b/src/fvOptions/fvOptions/fvOption.C @@ -113,7 +113,7 @@ void Foam::fv::option::setCellSet() { case smPoints: { - IInfo<< "- selecting cells using points" << endl; + Info<< indent << "- selecting cells using points" << endl; labelHashSet selectedCells; @@ -141,7 +141,8 @@ void Foam::fv::option::setCellSet() } case smCellSet: { - IInfo<< "- selecting cells using cellSet " << cellSetName_ << endl; + Info<< indent + << "- selecting cells using cellSet " << cellSetName_ << endl; cellSet selectedCells(mesh_, cellSetName_); cells_ = selectedCells.toc(); @@ -150,7 +151,8 @@ void Foam::fv::option::setCellSet() } case smCellZone: { - IInfo<< "- selecting cells using cellZone " << cellSetName_ << endl; + Info<< indent + << "- selecting cells using cellZone " << cellSetName_ << endl; label zoneID = mesh_.cellZones().findZoneID(cellSetName_); if (zoneID == -1) @@ -168,7 +170,7 @@ void Foam::fv::option::setCellSet() { if (active_ && master_) { - IInfo<< "- selecting inter region mapping" << endl; + Info<< indent << "- selecting inter region mapping" << endl; const fvMesh& nbrMesh = mesh_.time().lookupObject(nbrRegionName_); @@ -213,7 +215,7 @@ void Foam::fv::option::setCellSet() } case smAll: { - IInfo<< "- selecting all cells" << endl; + Info<< indent << "- selecting all cells" << endl; cells_ = identity(mesh_.nCells()); break; @@ -238,7 +240,8 @@ void Foam::fv::option::setCellSet() } reduce(V_, sumOp()); - IInfo<< "- selected " << returnReduce(cells_.size(), sumOp