diff --git a/applications/solvers/basic/laplacianFoam/laplacianFoam.C b/applications/solvers/basic/laplacianFoam/laplacianFoam.C index 76745227dd..755465bb9d 100644 --- a/applications/solvers/basic/laplacianFoam/laplacianFoam.C +++ b/applications/solvers/basic/laplacianFoam/laplacianFoam.C @@ -31,19 +31,17 @@ Description #include "fvCFD.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { + #include "setRootCase.H" -# include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" -# include "createTime.H" -# include "createMesh.H" -# include "createFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nCalculating temperature distribution\n" << endl; @@ -51,7 +49,7 @@ int main(int argc, char *argv[]) { Info<< "Time = " << runTime.timeName() << nl << endl; -# include "readSIMPLEControls.H" + #include "readSIMPLEControls.H" for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { @@ -61,7 +59,7 @@ int main(int argc, char *argv[]) ); } -# include "write.H" + #include "write.H" Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" diff --git a/applications/solvers/basic/potentialFoam/potentialFoam.C b/applications/solvers/basic/potentialFoam/potentialFoam.C index 1e0afd6dd4..81df893bac 100644 --- a/applications/solvers/basic/potentialFoam/potentialFoam.C +++ b/applications/solvers/basic/potentialFoam/potentialFoam.C @@ -39,13 +39,13 @@ int main(int argc, char *argv[]) { argList::addBoolOption("writep", "write the final pressure field"); -# include "setRootCase.H" -# include "createTime.H" -# include "createMesh.H" -# include "createFields.H" -# include "readSIMPLEControls.H" + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" + #include "readSIMPLEControls.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< nl << "Calculating potential flow" << endl; diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwclean b/applications/solvers/compressible/rhoCentralFoam/Allwclean index 21ee42fadb..cc5398c04e 100755 --- a/applications/solvers/compressible/rhoCentralFoam/Allwclean +++ b/applications/solvers/compressible/rhoCentralFoam/Allwclean @@ -4,5 +4,6 @@ set -x wclean libso BCs wclean +wclean rhoCentralDyMFoam # ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/compressible/rhoCentralFoam/Allwmake b/applications/solvers/compressible/rhoCentralFoam/Allwmake index 5f01d96a75..671c640231 100755 --- a/applications/solvers/compressible/rhoCentralFoam/Allwmake +++ b/applications/solvers/compressible/rhoCentralFoam/Allwmake @@ -4,5 +4,6 @@ set -x wmake libso BCs wmake +wmake rhoCentralDyMFoam # ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/files b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/files new file mode 100644 index 0000000000..f78400aa8d --- /dev/null +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/files @@ -0,0 +1,3 @@ +rhoCentralDyMFoam.C + +EXE = $(FOAM_APPBIN)/rhoCentralDyMFoam diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/options b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/options new file mode 100644 index 0000000000..403ffc1eef --- /dev/null +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/Make/options @@ -0,0 +1,17 @@ +EXE_INC = \ + -I.. \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I../BCs/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/dynamicMesh/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +EXE_LIBS = \ + -lfiniteVolume \ + -lbasicThermophysicalModels \ + -lspecie \ + -lrhoCentralFoam \ + -ldynamicMesh \ + -lmeshTools diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C new file mode 100644 index 0000000000..274a8e80be --- /dev/null +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralDyMFoam/rhoCentralDyMFoam.C @@ -0,0 +1,245 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 . + +Application + rhoCentralFoam + +Description + Density-based compressible flow solver based on central-upwind schemes of + Kurganov and Tadmor + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "basicPsiThermo.H" +#include "zeroGradientFvPatchFields.H" +#include "fixedRhoFvPatchScalarField.H" +#include "motionSolver.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + #include "setRootCase.H" + + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" + #include "readThermophysicalProperties.H" + #include "readTimeControls.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + #include "readFluxScheme.H" + + dimensionedScalar v_zero("v_zero", dimVolume/dimTime, 0.0); + + Info<< "\nStarting time loop\n" << endl; + + autoPtr motionPtr = motionSolver::New(mesh); + + while (runTime.run()) + { + // --- upwind interpolation of primitive fields on faces + + surfaceScalarField rho_pos = + fvc::interpolate(rho, pos, "reconstruct(rho)"); + surfaceScalarField rho_neg = + fvc::interpolate(rho, neg, "reconstruct(rho)"); + + surfaceVectorField rhoU_pos = + fvc::interpolate(rhoU, pos, "reconstruct(U)"); + surfaceVectorField rhoU_neg = + fvc::interpolate(rhoU, neg, "reconstruct(U)"); + + volScalarField rPsi = 1.0/psi; + surfaceScalarField rPsi_pos = + fvc::interpolate(rPsi, pos, "reconstruct(T)"); + surfaceScalarField rPsi_neg = + fvc::interpolate(rPsi, neg, "reconstruct(T)"); + + surfaceScalarField e_pos = + fvc::interpolate(e, pos, "reconstruct(T)"); + surfaceScalarField e_neg = + fvc::interpolate(e, neg, "reconstruct(T)"); + + surfaceVectorField U_pos = rhoU_pos/rho_pos; + surfaceVectorField U_neg = rhoU_neg/rho_neg; + + surfaceScalarField p_pos = rho_pos*rPsi_pos; + surfaceScalarField p_neg = rho_neg*rPsi_neg; + + surfaceScalarField phiv_pos = U_pos & mesh.Sf(); + surfaceScalarField phiv_neg = U_neg & mesh.Sf(); + + volScalarField c = sqrt(thermo.Cp()/thermo.Cv()*rPsi); + surfaceScalarField cSf_pos = + fvc::interpolate(c, pos, "reconstruct(T)")*mesh.magSf(); + surfaceScalarField cSf_neg = + fvc::interpolate(c, neg, "reconstruct(T)")*mesh.magSf(); + + surfaceScalarField ap = + max(max(phiv_pos + cSf_pos, phiv_neg + cSf_neg), v_zero); + surfaceScalarField am = + min(min(phiv_pos - cSf_pos, phiv_neg - cSf_neg), v_zero); + + surfaceScalarField a_pos = ap/(ap - am); + + surfaceScalarField amaxSf("amaxSf", max(mag(am), mag(ap))); + + surfaceScalarField aSf = am*a_pos; + + if (fluxScheme == "Tadmor") + { + aSf = -0.5*amaxSf; + a_pos = 0.5; + } + + surfaceScalarField a_neg = (1.0 - a_pos); + + phiv_pos *= a_pos; + phiv_neg *= a_neg; + + surfaceScalarField aphiv_pos = phiv_pos - aSf; + surfaceScalarField aphiv_neg = phiv_neg + aSf; + + // Reuse amaxSf for the maximum positive and negative fluxes + // estimated by the central scheme + amaxSf = max(mag(aphiv_pos), mag(aphiv_neg)); + + #include "compressibleCourantNo.H" + #include "readTimeControls.H" + #include "setDeltaT.H" + + runTime++; + + Info<< "Time = " << runTime.timeName() << nl << endl; + + mesh.movePoints(motionPtr->newPoints()); + phiv_pos = U_pos & mesh.Sf(); + phiv_neg = U_neg & mesh.Sf(); + fvc::makeRelative(phiv_pos, U); + fvc::makeRelative(phiv_neg, U); + phiv_neg -= mesh.phi(); + phiv_pos *= a_pos; + phiv_neg *= a_neg; + aphiv_pos = phiv_pos - aSf; + aphiv_neg = phiv_neg + aSf; + + surfaceScalarField phi("phi", aphiv_pos*rho_pos + aphiv_neg*rho_neg); + + surfaceVectorField phiUp = + (aphiv_pos*rhoU_pos + aphiv_neg*rhoU_neg) + + (a_pos*p_pos + a_neg*p_neg)*mesh.Sf(); + + surfaceScalarField phiEp = + aphiv_pos*(rho_pos*(e_pos + 0.5*magSqr(U_pos)) + p_pos) + + aphiv_neg*(rho_neg*(e_neg + 0.5*magSqr(U_neg)) + p_neg) + + aSf*p_pos - aSf*p_neg; + + volTensorField tauMC("tauMC", mu*dev2(fvc::grad(U)().T())); + + // --- Solve density + Info<< max(rho) << " " << min(rho) << endl; + solve(fvm::ddt(rho) + fvc::div(phi)); + Info<< max(rho) << " " << min(rho) << endl; + + // --- Solve momentum + solve(fvm::ddt(rhoU) + fvc::div(phiUp)); + + U.dimensionedInternalField() = + rhoU.dimensionedInternalField() + /rho.dimensionedInternalField(); + U.correctBoundaryConditions(); + rhoU.boundaryField() = rho.boundaryField()*U.boundaryField(); + + if (!inviscid) + { + solve + ( + fvm::ddt(rho, U) - fvc::ddt(rho, U) + - fvm::laplacian(mu, U) + - fvc::div(tauMC) + ); + rhoU = rho*U; + } + + // --- Solve energy + surfaceScalarField sigmaDotU = + ( + ( + fvc::interpolate(mu)*mesh.magSf()*fvc::snGrad(U) + + (mesh.Sf() & fvc::interpolate(tauMC)) + ) + & (a_pos*U_pos + a_neg*U_neg) + ); + + solve + ( + fvm::ddt(rhoE) + + fvc::div(phiEp) + - fvc::div(sigmaDotU) + ); + + e = rhoE/rho - 0.5*magSqr(U); + e.correctBoundaryConditions(); + thermo.correct(); + rhoE.boundaryField() = + rho.boundaryField()* + ( + e.boundaryField() + 0.5*magSqr(U.boundaryField()) + ); + + if (!inviscid) + { + volScalarField k("k", thermo.Cp()*mu/Pr); + solve + ( + fvm::ddt(rho, e) - fvc::ddt(rho, e) + - fvm::laplacian(thermo.alpha(), e) + + fvc::laplacian(thermo.alpha(), e) + - fvc::laplacian(k, T) + ); + thermo.correct(); + rhoE = rho*(e + 0.5*magSqr(U)); + } + + p.dimensionedInternalField() = + rho.dimensionedInternalField() + /psi.dimensionedInternalField(); + p.correctBoundaryConditions(); + rho.boundaryField() = psi.boundaryField()*p.boundaryField(); + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return 0; +} + +// ************************************************************************* // diff --git a/applications/solvers/electromagnetics/magneticFoam/Make/files b/applications/solvers/electromagnetics/magneticFoam/Make/files new file mode 100644 index 0000000000..abc57d5437 --- /dev/null +++ b/applications/solvers/electromagnetics/magneticFoam/Make/files @@ -0,0 +1,3 @@ +magneticFoam.C + +EXE = $(FOAM_APPBIN)/magneticFoam diff --git a/applications/solvers/electromagnetics/magneticFoam/Make/options b/applications/solvers/electromagnetics/magneticFoam/Make/options new file mode 100644 index 0000000000..725122ea1d --- /dev/null +++ b/applications/solvers/electromagnetics/magneticFoam/Make/options @@ -0,0 +1,4 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = -lfiniteVolume diff --git a/applications/solvers/electromagnetics/magneticFoam/createFields.H b/applications/solvers/electromagnetics/magneticFoam/createFields.H new file mode 100644 index 0000000000..1a5b7095a9 --- /dev/null +++ b/applications/solvers/electromagnetics/magneticFoam/createFields.H @@ -0,0 +1,81 @@ + Info<< "Reading field psi\n" << endl; + volScalarField psi + ( + IOobject + ( + "psi", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + Info<< "Reading transportProperties\n" << endl; + + IOdictionary transportProperties + ( + IOobject + ( + "transportProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + List magnets(transportProperties.lookup("magnets")); + + surfaceScalarField murf + ( + IOobject + ( + "murf", + runTime.timeName(), + mesh + ), + mesh, + 1 + ); + + surfaceScalarField Mrf + ( + IOobject + ( + "Mrf", + runTime.timeName(), + mesh + ), + mesh, + dimensionedScalar("Mr", dimensionSet(0, 1, 0, 0, 0, 1, 0), 0) + ); + + forAll(magnets, i) + { + label magnetZonei = mesh.faceZones().findZoneID(magnets[i].name()); + + if (magnetZonei == -1) + { + FatalIOErrorIn(args.executable().c_str(), transportProperties) + << "Cannot find faceZone for magnet " << magnets[i].name() + << exit(FatalIOError); + } + + const labelList& faces = + mesh.faceZones()[magnetZonei]; + + const scalar muri = magnets[i].mur(); + const scalar Mri = magnets[i].Mr().value(); + const vector& orientationi = magnets[i].orientation(); + + const surfaceVectorField& Sf = mesh.Sf(); + + forAll(faces, i) + { + label facei = faces[i]; + murf[facei] = muri; + Mrf[facei] = Mri*(orientationi & Sf[facei]); + } + } diff --git a/applications/solvers/electromagnetics/magneticFoam/magnet.H b/applications/solvers/electromagnetics/magneticFoam/magnet.H new file mode 100644 index 0000000000..765d513a74 --- /dev/null +++ b/applications/solvers/electromagnetics/magneticFoam/magnet.H @@ -0,0 +1,169 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 . + +Class + Foam::magnet + +Description + Class to hold the defining data for a permanent magnet, in particular + the name, relative permeability and remanence. + +SourceFiles + +\*---------------------------------------------------------------------------*/ + +#ifndef magnet_H +#define magnet_H + +#include "dimensionedVector.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class Istream; +class Ostream; + +// Forward declaration of friend functions and operators +class magnet; +Istream& operator>>(Istream&, magnet&); +Ostream& operator<<(Ostream&, const magnet&); + +/*---------------------------------------------------------------------------*\ + Class magnet Declaration +\*---------------------------------------------------------------------------*/ + +class magnet +{ + // Private data + + word name_; + scalar relativePermeability_; + dimensionedScalar remanence_; + vector orientation_; + +public: + + // Constructors + + //- Null constructor for lists + inline magnet() + : + remanence_("Mr", dimensionSet(0, -1, 0, 0, 0, 1, 0), 0), + orientation_(vector::zero) + {} + + //- Construct from components + inline magnet + ( + const word& name, + const scalar mur, + const scalar Mr, + const vector& orientation + ) + : + name_(name), + relativePermeability_(mur), + remanence_("Mr", dimensionSet(0, -1, 0, 0, 0, 1, 0), Mr), + orientation_(orientation) + {} + + //- Construct from Istream + inline magnet(Istream& is) + : + remanence_("Mr", dimensionSet(0, -1, 0, 0, 0, 1, 0), 0), + orientation_(vector::zero) + { + is >> *this; + } + + + // Member Functions + + //- Return name + inline const word& name() const + { + return name_; + } + + //- Return relative permeability + inline scalar mur() const + { + return relativePermeability_; + } + + //- Return remenance + inline const dimensionedScalar& Mr() const + { + return remanence_; + } + + //- Return orientation + inline const vector& orientation() const + { + return orientation_; + } + + + // IOstream operators + + inline friend Istream& operator>>(Istream& is, magnet& m) + { + is.readBegin("magnet"); + is >> m.name_ + >> m.relativePermeability_ + >> m.remanence_.value() + >> m.orientation_; + is.readEnd("magnet"); + + // Check state of Istream + is.check("operator>>(Istream&, magnet&)"); + + return is; + } + + inline friend Ostream& operator<<(Ostream& os, const magnet& m) + { + os << token::BEGIN_LIST + << m.name_ << token::SPACE + << m.relativePermeability_ << token::SPACE + << m.remanence_.value() + << m.orientation_ + << token::END_LIST; + + return os; + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/electromagnetics/magneticFoam/magneticFoam.C b/applications/solvers/electromagnetics/magneticFoam/magneticFoam.C new file mode 100644 index 0000000000..151d17a398 --- /dev/null +++ b/applications/solvers/electromagnetics/magneticFoam/magneticFoam.C @@ -0,0 +1,153 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 . + +Application + magneticFoam + +Description + Solver for the magnetic field generated by permanent magnets. + + A Poisson's equation for the magnetic scalar potential psi is solved + from which the magnetic field intensity H and magnetic flux density B + are obtained. The paramagnetic particle force field (H dot grad(H)) + is optionally available. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "OSspecific.H" +#include "magnet.H" +#include "electromagneticConstants.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + argList::addBoolOption + ( + "noH", + "do not write the magnetic field intensity field" + ); + + argList::addBoolOption + ( + "noB", + "do not write the magnetic flux density field" + ); + + argList::addBoolOption + ( + "HdotGradH", + "write the paramagnetic particle force field" + ); + + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "createFields.H" + #include "readSIMPLEControls.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "Calculating the magnetic field potential" << endl; + + runTime++; + + for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) + { + solve(fvm::laplacian(murf, psi) + fvc::div(murf*Mrf)); + } + + psi.write(); + + if (!args.optionFound("noH") || args.optionFound("HdotGradH")) + { + volVectorField H + ( + IOobject + ( + "H", + runTime.timeName(), + mesh + ), + fvc::reconstruct(fvc::snGrad(psi)*mesh.magSf()) + ); + + if (!args.optionFound("noH")) + { + Info<< nl + << "Creating field H for time " + << runTime.timeName() << endl; + + H.write(); + } + + if (args.optionFound("HdotGradH")) + { + Info<< nl + << "Creating field HdotGradH for time " + << runTime.timeName() << endl; + + volVectorField HdotGradH + ( + IOobject + ( + "HdotGradH", + runTime.timeName(), + mesh + ), + H & fvc::grad(H) + ); + + HdotGradH.write(); + } + } + + if (!args.optionFound("noB")) + { + Info<< nl + << "Creating field B for time " + << runTime.timeName() << endl; + + volVectorField B + ( + IOobject + ( + "B", + runTime.timeName(), + mesh + ), + constant::electromagnetic::mu0 + *fvc::reconstruct(murf*fvc::snGrad(psi)*mesh.magSf() + murf*Mrf) + ); + + B.write(); + } + + Info<< "\nEnd\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C index 12e04eb3e3..6a6e0cfce1 100644 --- a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C +++ b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C @@ -64,13 +64,13 @@ namespace Foam // Hack to do zones which have Lists in them. See above. -bool writeZones(const word& name, Time& runTime) +bool writeZones(const word& name, const fileName& meshDir, Time& runTime) { IOobject io ( name, runTime.timeName(), - polyMesh::meshSubDir, + meshDir, runTime, IOobject::MUST_READ, IOobject::NO_WRITE, @@ -144,8 +144,20 @@ bool writeZones(const word& name, Time& runTime) int main(int argc, char *argv[]) { timeSelector::addOptions(); +# include "addRegionOption.H" # include "setRootCase.H" # include "createTime.H" + + fileName meshDir = polyMesh::meshSubDir; + fileName regionPrefix = ""; + word regionName = polyMesh::defaultRegion; + if (args.optionReadIfPresent("region", regionName)) + { + Info<< "Using region " << regionName << nl << endl; + regionPrefix = regionName; + meshDir = regionName/polyMesh::meshSubDir; + } + Foam::instantList timeDirs = Foam::timeSelector::select0(runTime, args); forAll(timeDirs, timeI) @@ -154,27 +166,32 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << endl; // Convert all the standard mesh files - writeMeshObject("cells", runTime); - writeMeshObject("owner", runTime); - writeMeshObject("neighbour", runTime); - writeMeshObject("faces", runTime); - writeMeshObject("points", runTime); - writeMeshObject("pointProcAddressing", runTime); - writeMeshObject("faceProcAddressing", runTime); - writeMeshObject("cellProcAddressing", runTime); - writeMeshObject("boundaryProcAddressing", runTime); + writeMeshObject("cells", meshDir, runTime); + writeMeshObject("owner", meshDir, runTime); + writeMeshObject("neighbour", meshDir, runTime); + writeMeshObject("faces", meshDir, runTime); + writeMeshObject("points", meshDir, runTime); + writeMeshObject("pointProcAddressing", meshDir, runTime); + writeMeshObject("faceProcAddressing", meshDir, runTime); + writeMeshObject("cellProcAddressing", meshDir, runTime); + writeMeshObject + ( + "boundaryProcAddressing", + meshDir, + runTime + ); if (runTime.writeFormat() == IOstream::ASCII) { // Only do zones when converting from binary to ascii // The other way gives problems since working on dictionary level. - writeZones("cellZones", runTime); - writeZones("faceZones", runTime); - writeZones("pointZones", runTime); + writeZones("cellZones", meshDir, runTime); + writeZones("faceZones", meshDir, runTime); + writeZones("pointZones", meshDir, runTime); } // Get list of objects from the database - IOobjectList objects(runTime, runTime.timeName()); + IOobjectList objects(runTime, runTime.timeName(), regionPrefix); forAllConstIter(IOobjectList, objects, iter) { diff --git a/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H b/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H index 390c76ca03..717f5f4c02 100644 --- a/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H +++ b/applications/utilities/miscellaneous/foamFormatConvert/writeMeshObject.H @@ -40,13 +40,18 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template -inline bool writeMeshObject(const word& name, Time& runTime) +inline bool writeMeshObject +( + const word& name, + const fileName& meshDir, + Time& runTime +) { IOobject io ( name, runTime.timeName(), - polyMesh::meshSubDir, + meshDir, runTime, IOobject::MUST_READ, IOobject::NO_WRITE, diff --git a/etc/settings.csh b/etc/settings.csh index dc70c7fb48..5df50a809a 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -96,7 +96,7 @@ case OpenFOAM: set gcc_version=gcc-4.5.0 set gmp_version=gmp-5.0.1 set mpfr_version=mpfr-2.4.2 - set mpc_version=mpc-2.4.2 + set mpc_version=mpc-0.8.1 breaksw case Gcc44: set gcc_version=gcc-4.4.3 @@ -125,7 +125,6 @@ case OpenFOAM: set mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version endif - # Check that the compiler directory can be found if ( ! -d "$gccDir" ) then echo diff --git a/src/OpenFOAM/global/constants/electromagnetic/electromagneticConstants.C b/src/OpenFOAM/global/constants/electromagnetic/electromagneticConstants.C index ca7a80d19d..fbdd85d32a 100644 --- a/src/OpenFOAM/global/constants/electromagnetic/electromagneticConstants.C +++ b/src/OpenFOAM/global/constants/electromagnetic/electromagneticConstants.C @@ -44,7 +44,7 @@ const Foam::dimensionedScalar Foam::constant::electromagnetic::mu0 dimensionedScalar ( "mu0", - dimless, + dimensionSet(1, 2, -1, 0, 0, -2, 0), 4.0*constant::mathematical::pi*1e-07 ) ) diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C index e8ca39b089..ffa1d2bc6a 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.C @@ -375,6 +375,45 @@ void Foam::MRFZone::relativeVelocity(volVectorField& U) const } +void Foam::MRFZone::absoluteVelocity(volVectorField& U) const +{ + const volVectorField& C = mesh_.C(); + + const vector& origin = origin_.value(); + const vector& Omega = Omega_.value(); + + const labelList& cells = mesh_.cellZones()[cellZoneID_]; + + forAll(cells, i) + { + label celli = cells[i]; + U[celli] += (Omega ^ (C[celli] - origin)); + } + + // Included patches + forAll(includedFaces_, patchi) + { + forAll(includedFaces_[patchi], i) + { + label patchFacei = includedFaces_[patchi][i]; + U.boundaryField()[patchi][patchFacei] = + (Omega ^ (C.boundaryField()[patchi][patchFacei] - origin)); + } + } + + // Excluded patches + forAll(excludedFaces_, patchi) + { + forAll(excludedFaces_[patchi], i) + { + label patchFacei = excludedFaces_[patchi][i]; + U.boundaryField()[patchi][patchFacei] += + (Omega ^ (C.boundaryField()[patchi][patchFacei] - origin)); + } + } +} + + void Foam::MRFZone::relativeFlux(surfaceScalarField& phi) const { relativeRhoFlux(geometricOneField(), phi); diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H index d925f70392..c9b0429951 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZone.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZone.H @@ -175,6 +175,9 @@ public: //- Make the given absolute velocity relative within the MRF region void relativeVelocity(volVectorField& U) const; + //- Make the given relative velocity absolute within the MRF region + void absoluteVelocity(volVectorField& U) const; + //- Make the given absolute flux relative within the MRF region void relativeFlux(surfaceScalarField& phi) const; diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZones.C b/src/finiteVolume/cfdTools/general/MRF/MRFZones.C index d95d20ab0e..5ceb48af51 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZones.C +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZones.C @@ -86,6 +86,15 @@ void Foam::MRFZones::relativeVelocity(volVectorField& U) const } +void Foam::MRFZones::absoluteVelocity(volVectorField& U) const +{ + forAll(*this, i) + { + operator[](i).absoluteVelocity(U); + } +} + + void Foam::MRFZones::relativeFlux(surfaceScalarField& phi) const { forAll(*this, i) diff --git a/src/finiteVolume/cfdTools/general/MRF/MRFZones.H b/src/finiteVolume/cfdTools/general/MRF/MRFZones.H index 53a561a9e8..ae7f4c374f 100644 --- a/src/finiteVolume/cfdTools/general/MRF/MRFZones.H +++ b/src/finiteVolume/cfdTools/general/MRF/MRFZones.H @@ -81,6 +81,9 @@ public: //- Make the given absolute velocity relative within the MRF region void relativeVelocity(volVectorField& U) const; + //- Make the given relative velocity absolute within the MRF region + void absoluteVelocity(volVectorField& U) const; + //- Make the given absolute flux relative within the MRF region void relativeFlux(surfaceScalarField& phi) const; diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H index 6eca153546..06e62423c8 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H @@ -75,7 +75,7 @@ inline Foam::KinematicParcel::KinematicParcel ) : Particle(owner, position, cellI), - active_(false), + active_(true), typeId_(owner.parcelTypeId()), nParticle_(0), d_(0.0), diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C index a541a35bcf..231c61939e 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C @@ -66,10 +66,9 @@ tmp mutUSpaldingWallFunctionFvPatchScalarField::calcUTau forAll(mutw, faceI) { scalar ut = - sqrt((mutw[faceI] + muw[faceI])*magGradU[faceI]/rhow[faceI]) - + ROOTVSMALL; + sqrt((mutw[faceI] + muw[faceI])*magGradU[faceI]/rhow[faceI]); - if (ut > VSMALL) + if (ut > ROOTVSMALL) { int iter = 0; scalar err = GREAT; @@ -93,7 +92,7 @@ tmp mutUSpaldingWallFunctionFvPatchScalarField::calcUTau err = mag((ut - uTauNew)/ut); ut = uTauNew; - } while (ut > VSMALL && err > 0.01 && ++iter < 10); + } while (ut > ROOTVSMALL && err > 0.01 && ++iter < 10); uTau[faceI] = max(0.0, ut); } @@ -109,11 +108,15 @@ tmp mutUSpaldingWallFunctionFvPatchScalarField::calcMut() const const RASModel& rasModel = db().lookupObject("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradU = mag(Uw.snGrad()) + ROOTVSMALL; + const scalarField magGradU = mag(Uw.snGrad()); const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; const scalarField& muw = rasModel.mu().boundaryField()[patchI]; - return max(scalar(0), rhow*sqr(calcUTau(magGradU))/magGradU - muw); + return max + ( + scalar(0), + rhow*sqr(calcUTau(magGradU))/(magGradU + ROOTVSMALL) - muw + ); } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C index 950f8c88a8..0b11e08f2d 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C @@ -46,10 +46,14 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::calcNut() const const RASModel& rasModel = db().lookupObject("RASProperties"); const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; - const scalarField magGradU = mag(Uw.snGrad()) + ROOTVSMALL; + const scalarField magGradU = mag(Uw.snGrad()); const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; - return max(scalar(0), sqr(calcUTau(magGradU))/magGradU - nuw); + return max + ( + scalar(0), + sqr(calcUTau(magGradU))/(magGradU + ROOTVSMALL) - nuw + ); } @@ -73,10 +77,9 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::calcUTau forAll(uTau, facei) { - scalar ut = - sqrt((nutw[facei] + nuw[facei])*magGradU[facei]) + ROOTVSMALL; + scalar ut = sqrt((nutw[facei] + nuw[facei])*magGradU[facei]); - if (ut > VSMALL) + if (ut > ROOTVSMALL) { int iter = 0; scalar err = GREAT; @@ -100,7 +103,7 @@ tmp nutUSpaldingWallFunctionFvPatchScalarField::calcUTau err = mag((ut - uTauNew)/ut); ut = uTauNew; - } while (ut > VSMALL && err > 0.01 && ++iter < 10); + } while (ut > ROOTVSMALL && err > 0.01 && ++iter < 10); uTau[facei] = max(0.0, ut); } diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C index d6e1127b4d..79e9ab8383 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C @@ -48,14 +48,16 @@ tmp nutUTabulatedWallFunctionFvPatchScalarField::calcNut() const const scalarField& y = rasModel.y()[patchI]; const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; const scalarField magUp = mag(Uw.patchInternalField() - Uw); - const scalarField magGradU = mag(Uw.snGrad()) + ROOTVSMALL; + const scalarField magGradU = mag(Uw.snGrad()); const scalarField& nuw = rasModel.nu().boundaryField()[patchI]; return max ( scalar(0), - sqr(magUp/(calcUPlus(magUp*y/nuw) + ROOTVSMALL))/magGradU - nuw + sqr(magUp/(calcUPlus(magUp*y/nuw) + ROOTVSMALL)) + /(magGradU + ROOTVSMALL) + - nuw ); } @@ -190,7 +192,6 @@ tmp nutUTabulatedWallFunctionFvPatchScalarField::yPlus() const void nutUTabulatedWallFunctionFvPatchScalarField::write(Ostream& os) const { fvPatchField::write(os); -// writeLocalEntries(os); // not applicable to this nut BC os.writeKeyword("uPlusTable") << uPlusTableName_ << token::END_STATEMENT << nl; writeEntry("value", os); diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/K b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/K new file mode 100644 index 0000000000..4068676987 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/K @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object K; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 1 -3 -1 0 0 0]; + +internalField uniform 80; + +boundaryField +{ + ".*" + { + type calculated; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/T b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/T new file mode 100644 index 0000000000..c6ae16042a --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/T @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + ".*" + { + type calculated; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/U b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/U new file mode 100644 index 0000000000..42ab6a0a09 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/U @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0.01 0 0); + +boundaryField +{ + ".*" + { + type calculated; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/cp b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/cp new file mode 100644 index 0000000000..84aab72ae1 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/cp @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object cp; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 -1 0 0 0]; + +internalField uniform 450; + +boundaryField +{ + ".*" + { + type calculated; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/epsilon b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/epsilon new file mode 100644 index 0000000000..f5dfd4cc55 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/epsilon @@ -0,0 +1,31 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0.001"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.01; + +boundaryField +{ + ".*" + { + type calculated; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/k b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/k new file mode 100644 index 0000000000..f8bfda5d8e --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/k @@ -0,0 +1,31 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0.001"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.1; + +boundaryField +{ + ".*" + { + type calculated; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/p b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/p new file mode 100644 index 0000000000..0233591ba3 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/p @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 1e5; + +boundaryField +{ + ".*" + { + type calculated; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/rho b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/rho new file mode 100644 index 0000000000..e8c31261f1 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/0/rho @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object rho; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -3 0 0 0 0 0]; + +internalField uniform 8000; + +boundaryField +{ + ".*" + { + type calculated; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/Allclean b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/Allclean new file mode 100755 index 0000000000..01acce5670 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/Allclean @@ -0,0 +1,22 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase +rm -rf VTK +rm -rf constant/cellToRegion constant/polyMesh/sets +rm -rf 0/bottomAir +rm -rf 0/topAir +rm -rf 0/heater +rm -rf 0/leftSolid +rm -rf 0/rightSolid +rm -f 0/cellToRegion +rm -rf constant/bottomAir/polyMesh +rm -rf constant/topAir/polyMesh +rm -rf constant/heater/polyMesh +rm -rf constant/leftSolid/polyMesh +rm -rf constant/rightSolid/polyMesh + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/Allrun b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/Allrun new file mode 100755 index 0000000000..78bae403a8 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/Allrun @@ -0,0 +1,63 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +rm -rf constant/polyMesh/sets + +runApplication blockMesh +runApplication setSet -batch makeCellSets.setSet + +rm -f constant/polyMesh/sets/*_old + +runApplication setsToZones -noFlipMap +runApplication splitMeshRegions -cellZones -overwrite + +# remove fluid fields from solid regions (important for post-processing) +for i in heater leftSolid rightSolid +do + rm -f 0*/$i/{mut,alphat,epsilon,k,p,p,U} +done + +# remove solid fields from fluid regions (important for post-processing) +for i in bottomAir topAir +do + rm -f 0*/$i/{cp,K,rho} +done + +for i in bottomAir topAir heater leftSolid rightSolid +do + changeDictionary -region $i >& log.changeDictionary.$i +done + + +#-- Run on single processor +runApplication chtMultiRegionSimpleFoam + +## Decompose +#for i in bottomAir topAir heater leftSolid rightSolid +#do +# decomposePar -region $i >& log.decomposePar.$i +#done +# +## Run +#runParallel chtMultiRegionSimpleFoam 4 +# +## Reconstruct +#for i in bottomAir topAir heater leftSolid rightSolid +#do +# reconstructPar -region $i >& log.reconstructPar.$i +#done + + +echo +echo "creating files for paraview post-processing" +echo +for i in bottomAir topAir heater leftSolid rightSolid +do + paraFoam -touch -region $i +done + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/README.txt b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/README.txt new file mode 100644 index 0000000000..647f11981d --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/README.txt @@ -0,0 +1,2 @@ +The 0/ field files contain nonsense patchFields. All interesting +work is done using the changeDictionaryDicts. diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/bottomAir/RASProperties b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/bottomAir/RASProperties new file mode 100644 index 0000000000..0d135f28e9 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/bottomAir/RASProperties @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel laminar; + +turbulence on; + +printCoeffs on; + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/bottomAir/g b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/bottomAir/g new file mode 100644 index 0000000000..af6459f97c --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/bottomAir/g @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 -9.81 0); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/bottomAir/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/bottomAir/thermophysicalProperties new file mode 100644 index 0000000000..c2d48ee2b0 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/bottomAir/thermophysicalProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType hPsiThermo>>>>; + +mixture air 1 28.9 1000 0 1.8e-05 0.7; + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/bottomAir/turbulenceProperties b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/bottomAir/turbulenceProperties new file mode 100644 index 0000000000..9edb2bbd94 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/bottomAir/turbulenceProperties @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/polyMesh/blockMeshDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000..06d8984cac --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/polyMesh/blockMeshDict @@ -0,0 +1,72 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + (-0.1 -0.04 -0.05) + ( 0.1 -0.04 -0.05) + ( 0.1 0.04 -0.05) + (-0.1 0.04 -0.05) + (-0.1 -0.04 0.05) + ( 0.1 -0.04 0.05) + ( 0.1 0.04 0.05) + (-0.1 0.04 0.05) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (30 10 10) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + wall maxY + ( + (3 7 6 2) + ) + patch minX + ( + (0 4 7 3) + ) + patch maxX + ( + (2 6 5 1) + ) + wall minY + ( + (1 5 4 0) + ) + wall minZ + ( + (0 3 2 1) + ) + wall maxZ + ( + (4 5 6 7) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/polyMesh/boundary b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/polyMesh/boundary new file mode 100644 index 0000000000..73459cea07 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/polyMesh/boundary @@ -0,0 +1,58 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +6 +( + maxY + { + type wall; + nFaces 300; + startFace 8300; + } + minX + { + type patch; + nFaces 100; + startFace 8600; + } + maxX + { + type patch; + nFaces 100; + startFace 8700; + } + minY + { + type wall; + nFaces 300; + startFace 8800; + } + minZ + { + type wall; + nFaces 300; + startFace 9100; + } + maxZ + { + type wall; + nFaces 300; + startFace 9400; + } +) + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/regionProperties b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/regionProperties new file mode 100644 index 0000000000..2ba326a49b --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/regionProperties @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object regionProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +fluidRegionNames ( bottomAir topAir ); + +solidRegionNames ( heater leftSolid rightSolid ); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/topAir/RASProperties b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/topAir/RASProperties new file mode 100644 index 0000000000..29aa27e237 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/topAir/RASProperties @@ -0,0 +1,24 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel laminar; + +turbulence on; + +printCoeffs on; + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/topAir/g b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/topAir/g new file mode 100644 index 0000000000..6f32e33835 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/topAir/g @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 -9.81 0); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/topAir/thermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/topAir/thermophysicalProperties new file mode 100644 index 0000000000..af8ff6f5eb --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/topAir/thermophysicalProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType hPsiThermo>>>>; + +mixture air 1 28.9 1000 0 1.8e-05 0.7; + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/topAir/turbulenceProperties b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/topAir/turbulenceProperties new file mode 100644 index 0000000000..e009ce86da --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/topAir/turbulenceProperties @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/makeCellSets.setSet b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/makeCellSets.setSet new file mode 100644 index 0000000000..84c52f85b3 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/makeCellSets.setSet @@ -0,0 +1,11 @@ +cellSet heater new boxToCell (-0.01 0 -100 )(0.01 0.01 100) +cellSet heater add boxToCell (-0.01 -100 -0.01)(0.01 0.01 0.01) +cellSet leftSolid new boxToCell (-100 0 -100 )(-0.01 0.01 100) +cellSet rightSolid new boxToCell (0.01 0 -100 )(100 0.01 100) +cellSet topAir new boxToCell (-100 0.01 -100 )(100 100 100) +cellSet bottomAir clear +cellSet bottomAir add cellToCell heater +cellSet bottomAir add cellToCell leftSolid +cellSet bottomAir add cellToCell rightSolid +cellSet bottomAir add cellToCell topAir +cellSet bottomAir invert diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/README b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/README new file mode 100644 index 0000000000..5a81b9a570 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/README @@ -0,0 +1,3 @@ +fvSolution is used for outer correctors specification. +fvSchemes is only so that pre-processing activities can proceed + diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict new file mode 100644 index 0000000000..b9a8773586 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/changeDictionaryDict @@ -0,0 +1,109 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictionaryReplacement +{ + boundary + { + minX + { + type wall; + } + maxX + { + type wall; + } + } + + U + { + internalField uniform (0.01 0 0); + + boundaryField + { + ".*" + { + type fixedValue; + value uniform (0 0 0); + } + } + } + + T + { + internalField uniform 300; + + boundaryField + { + ".*" + { + type zeroGradient; + } + + "bottomAir_to_.*" + { + type compressible::turbulentTemperatureCoupledBaffle; + neighbourFieldName T; + K K; + value uniform 300; + } + } + } + + epsilon + { + internalField uniform 0.01; + + boundaryField + { + ".*" + { + type compressible::epsilonWallFunction; + value uniform 0.01; + } + } + } + + k + { + internalField uniform 0.1; + + boundaryField + { + ".*" + { + type compressible::kqRWallFunction; + value uniform 0.1; + } + } + } + + p + { + internalField uniform 100000; + + boundaryField + { + ".*" + { + type buoyantPressure; + value 1e5; + } + } + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/decomposeParDict new file mode 100644 index 0000000000..aad15ee459 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/decomposeParDict @@ -0,0 +1,86 @@ +/*-------------------------------*- C++ -*---------------------------------*\ +| ========= | +| \\ / OpenFOAM | +| \\ / | +| \\ / The Open Source CFD Toolbox | +| \\/ http://www.OpenFOAM.org | +\*-------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +//- Keep owner and neighbour on same processor for faces in zones: +// preserveFaceZones (heater solid1 solid3); + +method scotch; +// method hierarchical; +// method simple; +// method metis; +// method manual; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + /* + processorWeights + ( + 1 + 1 + 1 + 1 + ); + */ +} + +scotchCoeffs +{ + //processorWeights + //( + // 1 + // 1 + // 1 + // 1 + //); + //writeGraph true; + //strategy "b"; +} + +manualCoeffs +{ + dataFile "decompositionData"; +} + + +//// Is the case distributed +//distributed yes; +//// Per slave (so nProcs-1 entries) the directory above the case. +//roots +//( +// "/tmp" +// "/tmp" +//); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSchemes new file mode 120000 index 0000000000..42d9c49aab --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSchemes @@ -0,0 +1 @@ +../topAir/fvSchemes \ No newline at end of file diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSolution b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSolution new file mode 120000 index 0000000000..5cad6823de --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/bottomAir/fvSolution @@ -0,0 +1 @@ +../topAir/fvSolution \ No newline at end of file diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/controlDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/controlDict new file mode 100644 index 0000000000..ab5ba12ec3 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/controlDict @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +libs ("libOpenFOAM.so" "libcompressibleTurbulenceModel.so" "libcompressibleRASModels.so"); + +application chtMultiRegionSimpleFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1000; + +deltaT 1; + +writeControl timeStep; +writeInterval 100; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 7; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/decomposeParDict new file mode 100644 index 0000000000..aad15ee459 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/decomposeParDict @@ -0,0 +1,86 @@ +/*-------------------------------*- C++ -*---------------------------------*\ +| ========= | +| \\ / OpenFOAM | +| \\ / | +| \\ / The Open Source CFD Toolbox | +| \\/ http://www.OpenFOAM.org | +\*-------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +//- Keep owner and neighbour on same processor for faces in zones: +// preserveFaceZones (heater solid1 solid3); + +method scotch; +// method hierarchical; +// method simple; +// method metis; +// method manual; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + /* + processorWeights + ( + 1 + 1 + 1 + 1 + ); + */ +} + +scotchCoeffs +{ + //processorWeights + //( + // 1 + // 1 + // 1 + // 1 + //); + //writeGraph true; + //strategy "b"; +} + +manualCoeffs +{ + dataFile "decompositionData"; +} + + +//// Is the case distributed +//distributed yes; +//// Per slave (so nProcs-1 entries) the directory above the case. +//roots +//( +// "/tmp" +// "/tmp" +//); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/fvSchemes b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/fvSchemes new file mode 100644 index 0000000000..7662a20c90 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/fvSchemes @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ +} + +gradSchemes +{ +} + +divSchemes +{ +} + +laplacianSchemes +{ +} + +interpolationSchemes +{ +} + +snGradSchemes +{ +} + +fluxRequired +{ +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/fvSolution b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/fvSolution new file mode 100644 index 0000000000..fd0e7cced2 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/fvSolution @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +PIMPLE +{ + nOuterCorrectors 1; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/changeDictionaryDict new file mode 100644 index 0000000000..b2b1284ef3 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/changeDictionaryDict @@ -0,0 +1,104 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictionaryReplacement +{ + boundary + { + minY + { + type patch; + } + minZ + { + type patch; + } + maxZ + { + type patch; + } + } + + T + { + internalField uniform 300; + + boundaryField + { + ".*" + { + type zeroGradient; + value uniform 300; + } + "heater_to_.*" + { + type compressible::turbulentTemperatureCoupledBaffle; + neighbourFieldName T; + K K; + value uniform 300; + } + minY + { + type fixedValue; + value uniform 500; + } + } + } + + rho + { + internalField uniform 8000; + + boundaryField + { + ".*" + { + type calculated; + value uniform 8000; + } + } + } + + K + { + internalField uniform 80; + + boundaryField + { + ".*" + { + type zeroGradient; + value uniform 80; + } + } + } + + cp + { + internalField uniform 450; + + boundaryField + { + ".*" + { + type zeroGradient; + value uniform 450; + } + } + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/decomposeParDict new file mode 100644 index 0000000000..aad15ee459 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/decomposeParDict @@ -0,0 +1,86 @@ +/*-------------------------------*- C++ -*---------------------------------*\ +| ========= | +| \\ / OpenFOAM | +| \\ / | +| \\ / The Open Source CFD Toolbox | +| \\/ http://www.OpenFOAM.org | +\*-------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +//- Keep owner and neighbour on same processor for faces in zones: +// preserveFaceZones (heater solid1 solid3); + +method scotch; +// method hierarchical; +// method simple; +// method metis; +// method manual; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + /* + processorWeights + ( + 1 + 1 + 1 + 1 + ); + */ +} + +scotchCoeffs +{ + //processorWeights + //( + // 1 + // 1 + // 1 + // 1 + //); + //writeGraph true; + //strategy "b"; +} + +manualCoeffs +{ + dataFile "decompositionData"; +} + + +//// Is the case distributed +//distributed yes; +//// Per slave (so nProcs-1 entries) the directory above the case. +//roots +//( +// "/tmp" +// "/tmp" +//); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/fvSchemes b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/fvSchemes new file mode 100644 index 0000000000..74053b0ab3 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/fvSchemes @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; +} + +laplacianSchemes +{ + default none; + laplacian(K,T) Gauss linear limited 0.333; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default limited 0.333; +} + +fluxRequired +{ + default no; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/fvSolution b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/fvSolution new file mode 100644 index 0000000000..761c1632b1 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/heater/fvSolution @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + T + { + solver PCG; + preconditioner DIC; + tolerance 1E-06; + relTol 0; + } +} + +PISO +{ + nNonOrthogonalCorrectors 1; +} + +PIMPLE +{ + nNonOrthogonalCorrectors 1; +} + +SIMPLE +{ + nNonOrthogonalCorrectors 0; + //convergence 0.001; +} + +relaxationFactors +{ + T 0.7; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict new file mode 100644 index 0000000000..05d3011024 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/changeDictionaryDict @@ -0,0 +1,95 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictionaryReplacement +{ + boundary + { + minZ + { + type patch; + } + maxZ + { + type patch; + } + } + + T + { + internalField uniform 300; + + boundaryField + { + ".*" + { + type zeroGradient; + value uniform 300; + } + "leftSolid_to_.*" + { + type compressible::turbulentTemperatureCoupledBaffle; + neighbourFieldName T; + K K; + value uniform 300; + } + } + } + + rho + { + internalField uniform 8000; + + boundaryField + { + ".*" + { + type calculated; + value uniform 8000; + } + } + } + + K + { + internalField uniform 80; + + boundaryField + { + ".*" + { + type zeroGradient; + value uniform 80; + } + } + } + + cp + { + internalField uniform 450; + + boundaryField + { + ".*" + { + type zeroGradient; + value uniform 450; + } + } + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/decomposeParDict new file mode 100644 index 0000000000..aad15ee459 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/decomposeParDict @@ -0,0 +1,86 @@ +/*-------------------------------*- C++ -*---------------------------------*\ +| ========= | +| \\ / OpenFOAM | +| \\ / | +| \\ / The Open Source CFD Toolbox | +| \\/ http://www.OpenFOAM.org | +\*-------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +//- Keep owner and neighbour on same processor for faces in zones: +// preserveFaceZones (heater solid1 solid3); + +method scotch; +// method hierarchical; +// method simple; +// method metis; +// method manual; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + /* + processorWeights + ( + 1 + 1 + 1 + 1 + ); + */ +} + +scotchCoeffs +{ + //processorWeights + //( + // 1 + // 1 + // 1 + // 1 + //); + //writeGraph true; + //strategy "b"; +} + +manualCoeffs +{ + dataFile "decompositionData"; +} + + +//// Is the case distributed +//distributed yes; +//// Per slave (so nProcs-1 entries) the directory above the case. +//roots +//( +// "/tmp" +// "/tmp" +//); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/fvSchemes b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/fvSchemes new file mode 120000 index 0000000000..63236f302c --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/fvSchemes @@ -0,0 +1 @@ +../heater/fvSchemes \ No newline at end of file diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/fvSolution b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/fvSolution new file mode 120000 index 0000000000..0bde0fc62f --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/leftSolid/fvSolution @@ -0,0 +1 @@ +../heater/fvSolution \ No newline at end of file diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict new file mode 100644 index 0000000000..7e1adc24b3 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/changeDictionaryDict @@ -0,0 +1,95 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictionaryReplacement +{ + boundary + { + minZ + { + type patch; + } + maxZ + { + type patch; + } + } + + T + { + internalField uniform 300; + + boundaryField + { + ".*" + { + type zeroGradient; + value uniform 300; + } + "rightSolid_to_.*" + { + type compressible::turbulentTemperatureCoupledBaffle; + neighbourFieldName T; + K K; + value uniform 300; + } + } + } + + rho + { + internalField uniform 8000; + + boundaryField + { + ".*" + { + type calculated; + value uniform 8000; + } + } + } + + K + { + internalField uniform 80; + + boundaryField + { + ".*" + { + type zeroGradient; + value uniform 80; + } + } + } + + cp + { + internalField uniform 450; + + boundaryField + { + ".*" + { + type zeroGradient; + value uniform 450; + } + } + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/decomposeParDict new file mode 100644 index 0000000000..aad15ee459 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/decomposeParDict @@ -0,0 +1,86 @@ +/*-------------------------------*- C++ -*---------------------------------*\ +| ========= | +| \\ / OpenFOAM | +| \\ / | +| \\ / The Open Source CFD Toolbox | +| \\/ http://www.OpenFOAM.org | +\*-------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +//- Keep owner and neighbour on same processor for faces in zones: +// preserveFaceZones (heater solid1 solid3); + +method scotch; +// method hierarchical; +// method simple; +// method metis; +// method manual; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + /* + processorWeights + ( + 1 + 1 + 1 + 1 + ); + */ +} + +scotchCoeffs +{ + //processorWeights + //( + // 1 + // 1 + // 1 + // 1 + //); + //writeGraph true; + //strategy "b"; +} + +manualCoeffs +{ + dataFile "decompositionData"; +} + + +//// Is the case distributed +//distributed yes; +//// Per slave (so nProcs-1 entries) the directory above the case. +//roots +//( +// "/tmp" +// "/tmp" +//); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/fvSchemes b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/fvSchemes new file mode 120000 index 0000000000..63236f302c --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/fvSchemes @@ -0,0 +1 @@ +../heater/fvSchemes \ No newline at end of file diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/fvSolution b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/fvSolution new file mode 120000 index 0000000000..0bde0fc62f --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/rightSolid/fvSolution @@ -0,0 +1 @@ +../heater/fvSolution \ No newline at end of file diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/changeDictionaryDict new file mode 100644 index 0000000000..6e9192301d --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/changeDictionaryDict @@ -0,0 +1,153 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictionaryReplacement +{ + U + { + internalField uniform (0.01 0 0); + + boundaryField + { + ".*" + { + type fixedValue; + value uniform (0 0 0); + } + minX + { + type fixedValue; + value uniform ( 0.01 0 0 ); + } + maxX + { + type inletOutlet; + inletValue uniform ( 0 0 0 ); + value uniform ( 0 0 0 ); + } + } + } + + T + { + internalField uniform 300; + + boundaryField + { + ".*" + { + type zeroGradient; + } + + minX + { + type fixedValue; + value uniform 300; + } + maxX + { + type inletOutlet; + inletValue uniform 300; + value uniform 300; + } + + "topAir_to_.*" + { + type compressible::turbulentTemperatureCoupledBaffle; + neighbourFieldName T; + K K; + value uniform 300; + } + } + } + + epsilon + { + internalField uniform 0.01; + + boundaryField + { + ".*" + { + type compressible::epsilonWallFunction; + value uniform 0.01; + } + + minX + { + type fixedValue; + value uniform 0.01; + } + maxX + { + type inletOutlet; + inletValue uniform 0.01; + value uniform 0.01; + } + } + } + + k + { + internalField uniform 0.1; + + boundaryField + { + ".*" + { + type compressible::kqRWallFunction; + value uniform 0.1; + } + + minX + { + type fixedValue; + value uniform 0.1; + } + maxX + { + type inletOutlet; + inletValue uniform 0.1; + value uniform 0.1; + } + } + } + + p + { + internalField uniform 100000; + + boundaryField + { + ".*" + { + type buoyantPressure; + value 1e5; + } + + maxX + { + type waveTransmissive; + gamma 1.4; + fieldInf 100000; + lInf 0.4; + value uniform 100000; + } + } + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/decomposeParDict new file mode 100644 index 0000000000..aad15ee459 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/decomposeParDict @@ -0,0 +1,86 @@ +/*-------------------------------*- C++ -*---------------------------------*\ +| ========= | +| \\ / OpenFOAM | +| \\ / | +| \\ / The Open Source CFD Toolbox | +| \\/ http://www.OpenFOAM.org | +\*-------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +//- Keep owner and neighbour on same processor for faces in zones: +// preserveFaceZones (heater solid1 solid3); + +method scotch; +// method hierarchical; +// method simple; +// method metis; +// method manual; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (2 2 1); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + /* + processorWeights + ( + 1 + 1 + 1 + 1 + ); + */ +} + +scotchCoeffs +{ + //processorWeights + //( + // 1 + // 1 + // 1 + // 1 + //); + //writeGraph true; + //strategy "b"; +} + +manualCoeffs +{ + dataFile "decompositionData"; +} + + +//// Is the case distributed +//distributed yes; +//// Per slave (so nProcs-1 entries) the directory above the case. +//roots +//( +// "/tmp" +// "/tmp" +//); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSchemes b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSchemes new file mode 100644 index 0000000000..cedcc3c611 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSchemes @@ -0,0 +1,69 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; + //default CoEuler phi rho 0.1; +} + +gradSchemes +{ + default Gauss linear; +// grad(U) cellLimited Gauss linear 1; +} + +divSchemes +{ + default none; + div(phi,U) Gauss upwind; + div(phiU,p) Gauss linear; + div(phi,h) Gauss upwind; + div(phi,k) Gauss upwind; + div(phi,epsilon) Gauss upwind; + div(phi,R) Gauss upwind; + div(R) Gauss linear; + div((muEff*dev2(grad(U).T()))) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(muEff,U) Gauss linear limited 0.333; + laplacian((rho*(1|A(U))),p) Gauss linear limited 0.333; + laplacian(alphaEff,h) Gauss linear limited 0.333; + laplacian(DkEff,k) Gauss linear limited 0.333; + laplacian(DepsilonEff,epsilon) Gauss linear limited 0.333; + laplacian(DREff,R) Gauss linear limited 0.333; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default limited 0.333; +} + +fluxRequired +{ + default no; + p; +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSolution b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSolution new file mode 100644 index 0000000000..7638601aec --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/system/topAir/fvSolution @@ -0,0 +1,109 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + rho + { + solver PCG + preconditioner DIC; + tolerance 1e-8; + relTol 0; + } + + p + { + solver GAMG; + tolerance 1e-8; + relTol 0.01; + + smoother GaussSeidel; + + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + pFinal + { + $p; + tolerance 1e-8; + relTol 0; + } + + U + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-08; + relTol 0; + } + + h + { + $U; + tolerance 1e-08; + relTol 0.1; + } + + "(hFinal|k|epsilon|R)" + { + $U; + } +} + +PISO +{ + momentumPredictor off; + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 1; + pRefPoint (-0.081 -0.0257 8.01); + pRefValue 1e5; +} + + +PIMPLE +{ + momentumPredictor on; + nCorrectors 2; + nNonOrthogonalCorrectors 0; +} + +SIMPLE +{ + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 100000; + + //convergence 0.001; +} + +relaxationFactors +{ + rho 1; + p 0.7; + U 0.3; + h 0.7; + nuTilda 0.7; + k 0.7; + epsilon 0.7; + omega 0.7; + "ILambda.*" 0.7; +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/simpleFoam/pitzDaily/system/controlDict b/tutorials/incompressible/simpleFoam/pitzDaily/system/controlDict index 7f1626172b..688d4bc760 100644 --- a/tutorials/incompressible/simpleFoam/pitzDaily/system/controlDict +++ b/tutorials/incompressible/simpleFoam/pitzDaily/system/controlDict @@ -17,7 +17,7 @@ FoamFile application simpleFoam; -startFrom startTime; +startFrom latestTime; startTime 0; @@ -50,7 +50,7 @@ functions convergenceChecks { type residualControl; - functionObjectLibs ( "libjobControl.so" ); + functionObjectLibs ("libjobControl.so"); outputControl timeStep; outputInterval 1; @@ -67,7 +67,7 @@ functions type streamLine; // Where to load it from (if not already in solver) - functionObjectLibs ("libOpenFOAM.so" "libfieldFunctionObjects.so"); + functionObjectLibs ("libfieldFunctionObjects.so"); // Output every outputControl outputTime;