diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Make/files b/applications/solvers/multiphase/multiphaseEulerFoam/Make/files index f71c44324ac7db6982d4755fa57ec062430e8d30..b5b45045f11358eaa1805ba448847d6bf4655222 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/Make/files +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Make/files @@ -1,3 +1,4 @@ multiphaseEulerFoam.C +multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C EXE = $(FOAM_APPBIN)/multiphaseEulerFoam diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/Make/options b/applications/solvers/multiphase/multiphaseEulerFoam/Make/options index 8fc20e86237ec7b86f3cc24054e04e40f9320b92..06ffdda61cf603df1bc740aeb3500974b45b0e67 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/Make/options +++ b/applications/solvers/multiphase/multiphaseEulerFoam/Make/options @@ -1,6 +1,7 @@ EXE_INC = \ -IphaseModel/lnInclude \ -ImultiphaseSystem/lnInclude \ + -ImultiphaseFixedFluxPressure \ /*-IkineticTheoryModels/lnInclude*/ \ -IinterfacialModels/lnInclude \ -I$(LIB_SRC)/transportModels \ diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/createMRFZones.H b/applications/solvers/multiphase/multiphaseEulerFoam/createMRFZones.H index 161446a8e6f2397982c0579c232b8ce3e458053d..326c934eaf1bd14c666b921c2e8b819c2d897e70 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/createMRFZones.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/createMRFZones.H @@ -1,2 +1,8 @@ MRFZones mrfZones(mesh); + + forAllIter(PtrDictionary<phaseModel>, fluid.phases(), iter) + { + mrfZones.correctBoundaryVelocity(iter().U()); + } + mrfZones.correctBoundaryVelocity(U); diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H index 5f7c38ebf08fdc5abeee9b65de1b619e63f1f5d1..6cbfbf2d16a040fe7b8caf5483f824d9137768f1 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H +++ b/applications/solvers/multiphase/multiphaseEulerFoam/pEqn.H @@ -53,12 +53,12 @@ phase.U() = rAUs[phasei]*UEqns[phasei].H(); + mrfZones.absoluteFlux(phase.phi()); phase.phi() = ( (fvc::interpolate(phase.U()) & mesh.Sf()) + fvc::ddtPhiCorr(rAUs[phasei], alpha, phase.U(), phase.phi()) ); - mrfZones.relativeFlux(phase.phi()); phase.phi() += rAlphaAUfs[phasei]*(g & mesh.Sf()); @@ -241,7 +241,6 @@ } } - phase.U() = fvc::reconstruct(phase.phi()); phase.U().correctBoundaryConditions(); U += alpha*phase.U(); diff --git a/etc/config/settings.csh b/etc/config/settings.csh index 457c1fd8ad50000a62d72c746b2124a59c29d1ec..93f3e506abdff716446fbfd173f00d76a5e42fb6 100644 --- a/etc/config/settings.csh +++ b/etc/config/settings.csh @@ -486,6 +486,14 @@ case QSMPI: _foamAddLib $MPI_ARCH_PATH/lib breaksw +case SGIMPI: + setenv FOAM_MPI ${MPI_ROOT##*/} + setenv MPI_ARCH_PATH $MPI_ROOT + + _foamAddPath $MPI_ARCH_PATH/bin + _foamAddLib $MPI_ARCH_PATH/lib + breaksw + default: setenv FOAM_MPI dummy breaksw diff --git a/etc/config/settings.sh b/etc/config/settings.sh index 8297f43deaa486f393306606b8320d53c99a8a28..5111ef405a3152cf02d526e1322127e6a346e0a3 100644 --- a/etc/config/settings.sh +++ b/etc/config/settings.sh @@ -510,6 +510,14 @@ QSMPI) _foamAddLib $MPI_ARCH_PATH/lib ;; +SGIMPI) + export FOAM_MPI=${MPI_ROOT##*/} + export MPI_ARCH_PATH=$MPI_ROOT + + _foamAddPath $MPI_ARCH_PATH/bin + _foamAddLib $MPI_ARCH_PATH/lib + ;; + *) export FOAM_MPI=dummy ;; diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index aabb0a3ca371eb4e37e0bc6511079e7817893e87..971740c7dab76d78af367655372dfa0d47096db5 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -127,7 +127,6 @@ $(derivedFvPatchFields)/fan/fanFvPatchFields.C $(derivedFvPatchFields)/fanPressure/fanPressureFvPatchScalarField.C $(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C -$(derivedFvPatchFields)/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C $(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C $(derivedFvPatchFields)/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C diff --git a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C index e1ea4007d539ad2f340543294d3a75b4b19cbba5..1e4eadce045033a3b7b5a91328eb83de51d74625 100644 --- a/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C +++ b/src/finiteVolume/cfdTools/general/solutionControl/solutionControl/solutionControl.C @@ -76,7 +76,8 @@ void Foam::solutionControl::read(const bool absTolOnly) { FatalErrorIn("bool Foam::solutionControl::read()") << "Residual data for " << iter().keyword() - << " must be specified as a dictionary"; + << " must be specified as a dictionary" + << exit(FatalError); } } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C deleted file mode 100644 index be534fb8fac0938fd62ff698e36fc7eb068d4397..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C +++ /dev/null @@ -1,177 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "multiphaseFixedFluxPressureFvPatchScalarField.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" -#include "surfaceFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::multiphaseFixedFluxPressureFvPatchScalarField:: -multiphaseFixedFluxPressureFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedGradientFvPatchScalarField(p, iF), - UName_("U"), - phiName_("phi"), - rhoName_("rho") -{} - - -Foam::multiphaseFixedFluxPressureFvPatchScalarField:: -multiphaseFixedFluxPressureFvPatchScalarField -( - const multiphaseFixedFluxPressureFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const fvPatchFieldMapper& mapper -) -: - fixedGradientFvPatchScalarField(ptf, p, iF, mapper), - UName_(ptf.UName_), - phiName_(ptf.phiName_), - rhoName_(ptf.rhoName_) -{} - - -Foam::multiphaseFixedFluxPressureFvPatchScalarField:: -multiphaseFixedFluxPressureFvPatchScalarField -( - const fvPatch& p, - const DimensionedField<scalar, volMesh>& iF, - const dictionary& dict -) -: - fixedGradientFvPatchScalarField(p, iF), - UName_(dict.lookupOrDefault<word>("U", "U")), - phiName_(dict.lookupOrDefault<word>("phi", "phi")), - rhoName_(dict.lookupOrDefault<word>("rho", "rho")) -{ - if (dict.found("gradient")) - { - gradient() = scalarField("gradient", dict, p.size()); - fixedGradientFvPatchScalarField::updateCoeffs(); - fixedGradientFvPatchScalarField::evaluate(); - } - else - { - fvPatchField<scalar>::operator=(patchInternalField()); - gradient() = 0.0; - } -} - - -Foam::multiphaseFixedFluxPressureFvPatchScalarField:: -multiphaseFixedFluxPressureFvPatchScalarField -( - const multiphaseFixedFluxPressureFvPatchScalarField& wbppsf -) -: - fixedGradientFvPatchScalarField(wbppsf), - UName_(wbppsf.UName_), - phiName_(wbppsf.phiName_), - rhoName_(wbppsf.rhoName_) -{} - - -Foam::multiphaseFixedFluxPressureFvPatchScalarField:: -multiphaseFixedFluxPressureFvPatchScalarField -( - const multiphaseFixedFluxPressureFvPatchScalarField& wbppsf, - const DimensionedField<scalar, volMesh>& iF -) -: - fixedGradientFvPatchScalarField(wbppsf, iF), - UName_(wbppsf.UName_), - phiName_(wbppsf.phiName_), - rhoName_(wbppsf.rhoName_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::multiphaseFixedFluxPressureFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const fvPatchField<vector>& Up = - patch().lookupPatchField<volVectorField, vector>(UName_); - - const surfaceScalarField& phi = - db().lookupObject<surfaceScalarField>(phiName_); - - fvsPatchField<scalar> phip = - patch().patchField<surfaceScalarField, scalar>(phi); - - if (phi.dimensions() == dimDensity*dimVelocity*dimArea) - { - const fvPatchField<scalar>& rhop = - patch().lookupPatchField<volScalarField, scalar>(rhoName_); - - phip /= rhop; - } - - const fvsPatchField<scalar>& Dpp = - patch().lookupPatchField<surfaceScalarField, scalar>("Dp"); - - gradient() = (phip - (patch().Sf() & Up))/patch().magSf()/Dpp; - - fixedGradientFvPatchScalarField::updateCoeffs(); -} - - -void Foam::multiphaseFixedFluxPressureFvPatchScalarField::write -( - Ostream& os -) const -{ - fvPatchScalarField::write(os); - writeEntryIfDifferent<word>(os, "U", "U", UName_); - writeEntryIfDifferent<word>(os, "phi", "phi", phiName_); - writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_); - gradient().writeEntry("gradient", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makePatchTypeField - ( - fvPatchScalarField, - multiphaseFixedFluxPressureFvPatchScalarField - ); -} - -// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.H deleted file mode 100644 index b97001a5c0ff6e84872f6a0718f105901cb6074f..0000000000000000000000000000000000000000 --- a/src/finiteVolume/fields/fvPatchFields/derived/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.H +++ /dev/null @@ -1,154 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::multiphaseFixedFluxPressureFvPatchScalarField - -Description - Foam::multiphaseFixedFluxPressureFvPatchScalarField - -SourceFiles - multiphaseFixedFluxPressureFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef multiphaseFixedFluxPressureFvPatchScalarFields_H -#define multiphaseFixedFluxPressureFvPatchScalarFields_H - -#include "fvPatchFields.H" -#include "fixedGradientFvPatchFields.H" -#include "Switch.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class multiphaseFixedFluxPressureFvPatch Declaration -\*---------------------------------------------------------------------------*/ - -class multiphaseFixedFluxPressureFvPatchScalarField -: - public fixedGradientFvPatchScalarField -{ - // Private data - - //- Name of the velocity field - word UName_; - - //- Name of the flux transporting the field - word phiName_; - - //- Name of the density field used to normalise the mass flux - // if neccessary - word rhoName_; - - -public: - - //- Runtime type information - TypeName("multiphaseFixedFluxPressure"); - - - // Constructors - - //- Construct from patch and internal field - multiphaseFixedFluxPressureFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct from patch, internal field and dictionary - multiphaseFixedFluxPressureFvPatchScalarField - ( - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const dictionary& - ); - - //- Construct by mapping given - // multiphaseFixedFluxPressureFvPatchScalarField onto a new patch - multiphaseFixedFluxPressureFvPatchScalarField - ( - const multiphaseFixedFluxPressureFvPatchScalarField&, - const fvPatch&, - const DimensionedField<scalar, volMesh>&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - multiphaseFixedFluxPressureFvPatchScalarField - ( - const multiphaseFixedFluxPressureFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp<fvPatchScalarField> clone() const - { - return tmp<fvPatchScalarField> - ( - new multiphaseFixedFluxPressureFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - multiphaseFixedFluxPressureFvPatchScalarField - ( - const multiphaseFixedFluxPressureFvPatchScalarField&, - const DimensionedField<scalar, volMesh>& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp<fvPatchScalarField> clone - ( - const DimensionedField<scalar, volMesh>& iF - ) const - { - return tmp<fvPatchScalarField> - ( - new multiphaseFixedFluxPressureFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - //- Write - virtual void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index d585569649e09ec581fd4f14e67da84dfcc2bad8..b23a6d2328e3bdb5a7d1f9c88d04448b73405aac 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -190,6 +190,7 @@ Foam::forces::forces rhoRef_(VGREAT), pRef_(0), coordSys_(), + localSystem_(false), forcesFilePtr_(NULL) { // Check if the available mesh is an fvMesh otherise deactivate @@ -239,6 +240,7 @@ Foam::forces::forces rhoRef_(rhoInf), pRef_(pRef), coordSys_(coordSys), + localSystem_(false), forcesFilePtr_(NULL) {} @@ -330,6 +332,7 @@ void Foam::forces::read(const dictionary& dict) if (!dict.readIfPresent<point>("CofR", coordSys_.origin())) { coordSys_ = coordinateSystem(dict, obr_); + localSystem_ = true; } } } @@ -382,10 +385,17 @@ void Foam::forces::writeFileHeader() { forcesFilePtr_() << "# Time" << tab - << "forces(pressure, viscous) moment(pressure, viscous)" - << tab - << "local forces(pressure, viscous) local moment(pressure, viscous)" - << endl; + << "forces(pressure, viscous) moment(pressure, viscous)"; + + if (localSystem_) + { + forcesFilePtr_() + << tab + << "local forces(pressure, viscous) " + << "local moment(pressure, viscous)"; + } + + forcesFilePtr_()<< endl; } } @@ -413,33 +423,42 @@ void Foam::forces::write() if (Pstream::master()) { - forcesMoments fmLocal; + if (log_) + { + Info<< "forces output:" << nl + << " forces(pressure, viscous)" << fm.first() << nl + << " moment(pressure, viscous)" << fm.second() << nl; + + forcesFilePtr_() << obr_.time().value() << tab << fm; - fmLocal.first().first() = - coordSys_.localVector(fm.first().first()); + if (localSystem_) + { + forcesMoments fmLocal; - fmLocal.first().second() = - coordSys_.localVector(fm.first().second()); + fmLocal.first().first() = + coordSys_.localVector(fm.first().first()); - fmLocal.second().first() = - coordSys_.localVector(fm.second().first()); + fmLocal.first().second() = + coordSys_.localVector(fm.first().second()); - fmLocal.second().second() = - coordSys_.localVector(fm.second().second()); + fmLocal.second().first() = + coordSys_.localVector(fm.second().first()); - forcesFilePtr_() << obr_.time().value() - << tab << fm - << tab << fmLocal << endl; + fmLocal.second().second() = + coordSys_.localVector(fm.second().second()); - if (log_) - { - Info<< "forces output:" << nl - << " forces(pressure, viscous)" << fm.first() << nl - << " moment(pressure, viscous)" << fm.second() << nl - << " local:" << nl - << " forces(pressure, viscous)" << fmLocal.first() << nl - << " moment(pressure, viscous)" << fmLocal.second() << nl - << endl; + forcesFilePtr_() << tab << fmLocal; + + + Info<< " local:" << nl + << " forces(pressure, viscous)" << fmLocal.first() + << nl + << " moment(pressure, viscous)" << fmLocal.second() + << nl; + } + + forcesFilePtr_() << endl; + Info<< endl; } } } diff --git a/src/postProcessing/functionObjects/forces/forces/forces.H b/src/postProcessing/functionObjects/forces/forces/forces.H index eb46c057d53503b42ca49b3dec52fe445ec7d2db..3d14768b2b8a7b2f8ac9f4a63fea6c48367d2cb8 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.H +++ b/src/postProcessing/functionObjects/forces/forces/forces.H @@ -165,6 +165,9 @@ protected: //- Coordinate system used when evaluting forces/moments coordinateSystem coordSys_; + //- Flag to indicate whether we are using a local co-ordinate sys + bool localSystem_; + //- Forces/moment file ptr autoPtr<OFstream> forcesFilePtr_; diff --git a/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/system/fvSolution index 9379d3029f5ef8c2a0612c7f586ea588736f09ee..cf4ce79ecf23c40a9c8a6335556f98005881425d 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/system/fvSolution @@ -97,18 +97,12 @@ PIMPLE relaxationFactors { - fields - { - } - equations - { - "U.*" 1; - "T.*" 1; - "alpha.*" 1; - "Theta.*" 1; - "k.*" 1; - "epsilon.*" 1; - } + "U.*" 1; + "T.*" 1; + "alpha.*" 1; + "Theta.*" 1; + "k.*" 1; + "epsilon.*" 1; } diff --git a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/system/fvSolution b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/system/fvSolution index 39c47f6efcb6931edabaff134cfb31c1fd4ece44..296b0cd48839b3ce647e02a066bcaaa341e692f1 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/system/fvSolution +++ b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/system/fvSolution @@ -88,13 +88,7 @@ PIMPLE relaxationFactors { - fields - { - } - equations - { - "U.*" 1; - } + "U.*" 1; } // ************************************************************************* // diff --git a/wmake/rules/General/mplibSGIMPI b/wmake/rules/General/mplibSGIMPI new file mode 100644 index 0000000000000000000000000000000000000000..8595264660f3ae07d4fadb3b9ed8689d89571427 --- /dev/null +++ b/wmake/rules/General/mplibSGIMPI @@ -0,0 +1,3 @@ +PFLAGS = -DSGIMPI -DMPI_NO_CPPBIND +PINC = -I$(MPI_ARCH_PATH)/include +PLIBS = -L$(MPI_ARCH_PATH)/lib -lmpi