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/combustion/PDRFoam/Make/files b/applications/solvers/combustion/PDRFoam/Make/files index 889eebc33e..d1b1d5a8f8 100644 --- a/applications/solvers/combustion/PDRFoam/Make/files +++ b/applications/solvers/combustion/PDRFoam/Make/files @@ -1,25 +1,25 @@ XiModels/XiModel/XiModel.C -XiModels/XiModel/newXiModel.C +XiModels/XiModel/XiModelNew.C XiModels/fixed/fixed.C XiModels/algebraic/algebraic.C XiModels/transport/transport.C XiModels/XiEqModels/XiEqModel/XiEqModel.C -XiModels/XiEqModels/XiEqModel/newXiEqModel.C +XiModels/XiEqModels/XiEqModel/XiEqModelNew.C XiModels/XiEqModels/Gulder/Gulder.C XiModels/XiEqModels/instabilityXiEq/instabilityXiEq.C XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.C XiModels/XiEqModels/SCOPEXiEq/SCOPEXiEq.C XiModels/XiGModels/XiGModel/XiGModel.C -XiModels/XiGModels/XiGModel/newXiGModel.C +XiModels/XiGModels/XiGModel/XiGModelNew.C XiModels/XiGModels/KTS/KTS.C XiModels/XiGModels/instabilityG/instabilityG.C PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.C PDRModels/dragModels/PDRDragModel/PDRDragModel.C -PDRModels/dragModels/PDRDragModel/newPDRDragModel.C +PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C PDRModels/dragModels/basic/basic.C PDRModels/XiEqModels/basicXiSubXiEq/basicXiSubXiEq.C diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/newPDRDragModel.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C similarity index 88% rename from applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/newPDRDragModel.C rename to applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C index 3208681241..0c208d44cc 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/newPDRDragModel.C +++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModelNew.C @@ -36,12 +36,12 @@ Foam::autoPtr Foam::PDRDragModel::New const surfaceScalarField& phi ) { - word PDRDragModelTypeName = PDRProperties.lookup("PDRDragModel"); + const word modelType(PDRProperties.lookup("PDRDragModel")); - Info<< "Selecting flame-wrinkling model " << PDRDragModelTypeName << endl; + Info<< "Selecting flame-wrinkling model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(PDRDragModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -49,7 +49,7 @@ Foam::autoPtr Foam::PDRDragModel::New ( "PDRDragModel::New" ) << "Unknown PDRDragModel type " - << PDRDragModelTypeName << endl << endl + << modelType << nl << nl << "Valid PDRDragModels are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/newXiEqModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C similarity index 82% rename from applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/newXiEqModel.C rename to applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C index b785c5b8e0..6f347bbe2d 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/newXiEqModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModelNew.C @@ -29,18 +29,18 @@ License Foam::autoPtr Foam::XiEqModel::New ( - const dictionary& XiEqProperties, + const dictionary& propDict, const hhuCombustionThermo& thermo, const compressible::RASModel& turbulence, const volScalarField& Su ) { - word XiEqModelTypeName = XiEqProperties.lookup("XiEqModel"); + const word modelType(propDict.lookup("XiEqModel")); - Info<< "Selecting flame-wrinkling model " << XiEqModelTypeName << endl; + Info<< "Selecting flame-wrinkling model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(XiEqModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -53,14 +53,13 @@ Foam::autoPtr Foam::XiEqModel::New " const volScalarField& Su" ")" ) << "Unknown XiEqModel type " - << XiEqModelTypeName << endl << endl - << "Valid XiEqModels are : " << endl + << modelType << nl << nl + << "Valid XiEqModels are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } - return autoPtr - (cstrIter()(XiEqProperties, thermo, turbulence, Su)); + return autoPtr(cstrIter()(propDict, thermo, turbulence, Su)); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/newXiGModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C similarity index 82% rename from applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/newXiGModel.C rename to applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C index 728bce124b..b675e7f334 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/newXiGModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModelNew.C @@ -29,18 +29,18 @@ License Foam::autoPtr Foam::XiGModel::New ( - const dictionary& XiGProperties, + const dictionary& propDict, const hhuCombustionThermo& thermo, const compressible::RASModel& turbulence, const volScalarField& Su ) { - word XiGModelTypeName = XiGProperties.lookup("XiGModel"); + const word modelType(propDict.lookup("XiGModel")); - Info<< "Selecting flame-wrinkling model " << XiGModelTypeName << endl; + Info<< "Selecting flame-wrinkling model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(XiGModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -53,14 +53,13 @@ Foam::autoPtr Foam::XiGModel::New " const volScalarField& Su" ")" ) << "Unknown XiGModel type " - << XiGModelTypeName << endl << endl - << "Valid XiGModels are : " << endl + << modelType << nl << nl + << "Valid XiGModels are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } - return autoPtr - (cstrIter()(XiGProperties, thermo, turbulence, Su)); + return autoPtr(cstrIter()(propDict, thermo, turbulence, Su)); } diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/newXiModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C similarity index 82% rename from applications/solvers/combustion/PDRFoam/XiModels/XiModel/newXiModel.C rename to applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C index dfd748265c..a77f8e8a20 100644 --- a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/newXiModel.C +++ b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModelNew.C @@ -29,7 +29,7 @@ License Foam::autoPtr Foam::XiModel::New ( - const dictionary& XiProperties, + const dictionary& propDict, const hhuCombustionThermo& thermo, const compressible::RASModel& turbulence, const volScalarField& Su, @@ -38,12 +38,12 @@ Foam::autoPtr Foam::XiModel::New const surfaceScalarField& phi ) { - word XiModelTypeName = XiProperties.lookup("XiModel"); + const word modelType(propDict.lookup("XiModel")); - Info<< "Selecting flame-wrinkling model " << XiModelTypeName << endl; + Info<< "Selecting flame-wrinkling model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(XiModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -51,14 +51,14 @@ Foam::autoPtr Foam::XiModel::New ( "XiModel::New" ) << "Unknown XiModel type " - << XiModelTypeName << endl << endl - << "Valid XiModels are : " << endl + << modelType << nl << nl + << "Valid XiModels are : " << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } return autoPtr - (cstrIter()(XiProperties, thermo, turbulence, Su, rho, b, phi)); + (cstrIter()(propDict, thermo, turbulence, Su, rho, b, phi)); } diff --git a/applications/solvers/combustion/XiFoam/bEqn.H b/applications/solvers/combustion/XiFoam/bEqn.H index 2b9b50d124..d93311ece1 100644 --- a/applications/solvers/combustion/XiFoam/bEqn.H +++ b/applications/solvers/combustion/XiFoam/bEqn.H @@ -30,7 +30,7 @@ if (ign.ignited()) n /= mgb; -# include "StCorr.H" + #include "StCorr.H" // Calculate turbulent flame speed flux // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -58,7 +58,7 @@ if (ign.ignited()) // Add ignition cell contribution to b-equation // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# include "ignite.H" + #include "ignite.H" // Solve for b @@ -134,7 +134,7 @@ if (ign.ignited()) (sigmas*SuInf*(Su0 - SuInf) + sqr(SuMin)*sigmaExt) /(sqr(Su0 - SuInf) + sqr(SuMin)); - solve + fvScalarMatrix SuEqn ( fvm::ddt(rho, Su) + fvm::div(phi + phiXi, Su, "div(phiXi,Su)") @@ -144,6 +144,9 @@ if (ign.ignited()) - fvm::SuSp(rho*(sigmas + Rc), Su) ); + SuEqn.relax(); + SuEqn.solve(); + // Limit the maximum Su // ~~~~~~~~~~~~~~~~~~~~ Su.min(SuMax); @@ -196,7 +199,7 @@ if (ign.ignited()) // Solve for the flame wrinkling // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - solve + fvScalarMatrix XiEqn ( fvm::ddt(rho, Xi) + fvm::div(phi + phiXi, Xi, "div(phiXi,Xi)") @@ -215,6 +218,8 @@ if (ign.ignited()) ) ); + XiEqn.relax(); + XiEqn.solve(); // Correct boundedness of Xi // ~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/applications/solvers/combustion/dieselEngineFoam/YEqn.H b/applications/solvers/combustion/dieselEngineFoam/YEqn.H index 9d46c0d611..f6251d1c30 100644 --- a/applications/solvers/combustion/dieselEngineFoam/YEqn.H +++ b/applications/solvers/combustion/dieselEngineFoam/YEqn.H @@ -14,7 +14,7 @@ tmp > mvConvection label inertIndex = -1; volScalarField Yt = 0.0*Y[0]; - for (label i=0; i Foam::combustionModel::New ( - const dictionary& combustionProperties, + const dictionary& propDict, const hsCombustionThermo& thermo, const compressible::turbulenceModel& turbulence, const surfaceScalarField& phi, const volScalarField& rho ) { - word combustionModelTypeName = combustionProperties.lookup - ( - "combustionModel" - ); + const word modelType(propDict.lookup("combustionModel")); - Info<< "Selecting combustion model " << combustionModelTypeName << endl; + Info<< "Selecting combustion model " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(combustionModelTypeName); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { @@ -52,14 +49,14 @@ Foam::autoPtr Foam::combustionModel::New ( "combustionModel::New" ) << "Unknown combustionModel type " - << combustionModelTypeName << endl << endl - << "Valid combustionModels are : " << endl + << modelType << nl << nl + << "Valid combustionModels are : " << endl << dictionaryConstructorTablePtr_->toc() << exit(FatalError); } return autoPtr - (cstrIter()(combustionProperties, thermo, turbulence, phi, rho)); + (cstrIter()(propDict, thermo, turbulence, phi, rho)); } diff --git a/applications/solvers/combustion/fireFoam/createFields.H b/applications/solvers/combustion/fireFoam/createFields.H index a399df8536..95bda05606 100644 --- a/applications/solvers/combustion/fireFoam/createFields.H +++ b/applications/solvers/combustion/fireFoam/createFields.H @@ -71,9 +71,9 @@ IOdictionary combustionProperties ); Info<< "Creating combustion model\n" << endl; -autoPtr combustion +autoPtr combustion ( - combustionModel::combustionModel::New + combustionModel::New ( combustionProperties, thermo, diff --git a/applications/solvers/combustion/reactingFoam/YEqn.H b/applications/solvers/combustion/reactingFoam/YEqn.H index cda24ec2f7..76d8253795 100644 --- a/applications/solvers/combustion/reactingFoam/YEqn.H +++ b/applications/solvers/combustion/reactingFoam/YEqn.H @@ -13,7 +13,7 @@ tmp > mvConvection label inertIndex = -1; volScalarField Yt = 0.0*Y[0]; - for (label i=0; i > mvConvection label inertIndex = -1; volScalarField Yt = 0.0*Y[0]; - for (label i=0; i. + +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/compressible/rhoSimplecFoam/rhoSimplecFoam.C b/applications/solvers/compressible/rhoSimplecFoam/rhoSimplecFoam.C index dd05bf88aa..30a5f6fb1a 100644 --- a/applications/solvers/compressible/rhoSimplecFoam/rhoSimplecFoam.C +++ b/applications/solvers/compressible/rhoSimplecFoam/rhoSimplecFoam.C @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; diff --git a/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C b/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C index 4bd0cdc61f..312952bcbf 100644 --- a/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C +++ b/applications/solvers/compressible/sonicDyMFoam/sonicDyMFoam.C @@ -49,7 +49,7 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - autoPtr motionPtr = motionSolver::New(mesh); + autoPtr motionPtr = motionSolver::New(mesh); while (runTime.loop()) { diff --git a/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C b/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C index f2ddf13741..c3ae69847d 100644 --- a/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C +++ b/applications/solvers/discreteMethods/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C @@ -39,6 +39,20 @@ int main(int argc, char *argv[]) # include "createTime.H" # include "createMesh.H" + Info<< "\nReading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + potential pot(mesh); moleculeCloud molecules(mesh, pot); diff --git a/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C b/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C index 3aa2532c3e..ade0895a2a 100644 --- a/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C +++ b/applications/solvers/discreteMethods/molecularDynamics/mdFoam/mdFoam.C @@ -39,6 +39,20 @@ int main(int argc, char *argv[]) # include "createTime.H" # include "createMesh.H" + Info<< "\nReading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + potential pot(mesh); moleculeCloud molecules(mesh, pot); 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..a3712c19aa --- /dev/null +++ b/applications/solvers/electromagnetics/magneticFoam/createFields.H @@ -0,0 +1,80 @@ + 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/solvers/heatTransfer/chtMultiRegionFoam/Allwclean b/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwclean new file mode 100755 index 0000000000..c583a8de0a --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwclean @@ -0,0 +1,8 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +set -x + +wclean +wclean chtMultiRegionSimpleFoam + +# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwmake b/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwmake new file mode 100755 index 0000000000..f65ba1181b --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Allwmake @@ -0,0 +1,8 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory +set -x + +wmake +wmake chtMultiRegionSimpleFoam + +# ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/files b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/files new file mode 100644 index 0000000000..d604fafb22 --- /dev/null +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/files @@ -0,0 +1,4 @@ +chtMultiRegionSimpleFoam.C + +EXE = $(FOAM_APPBIN)/chtMultiRegionSimpleFoam + diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options similarity index 91% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/Make/options rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options index 34be199596..a97ce0aae4 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/Make/options +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options @@ -1,5 +1,7 @@ EXE_INC = \ /* -DFULLDEBUG -O0 -g */ \ + -I.. \ + -I../derivedFvPatchFields \ -Ifluid \ -Isolid \ -I$(LIB_SRC)/finiteVolume/lnInclude \ diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/chtMultiRegionSimpleFoam.C diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/UEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/UEqn.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/UEqn.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/UEqn.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/compressibleContinuityErrors.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/compressibleContinuityErrors.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/compressibleContinuityErrors.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/compressibleContinuityErrors.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/compressibleCourantNo.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/compressibleCourantNo.C similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/compressibleCourantNo.C rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/compressibleCourantNo.C diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/compressibleCourantNo.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/compressibleCourantNo.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/compressibleCourantNo.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/compressibleCourantNo.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/compressibleMultiRegionCourantNo.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/compressibleMultiRegionCourantNo.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/compressibleMultiRegionCourantNo.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/compressibleMultiRegionCourantNo.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/createFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/createFluidFields.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/createFluidFields.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/createFluidFields.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/createFluidMeshes.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/createFluidMeshes.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/createFluidMeshes.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/createFluidMeshes.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/hEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/hEqn.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/hEqn.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/hEqn.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/pEqn.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/readFluidMultiRegionSIMPLEControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/readFluidMultiRegionSIMPLEControls.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/readFluidMultiRegionSIMPLEControls.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/readFluidMultiRegionSIMPLEControls.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/setRegionFluidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/setRegionFluidFields.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/setRegionFluidFields.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/setRegionFluidFields.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/solveFluid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/solveFluid.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/fluid/solveFluid.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/solveFluid.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/createSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/createSolidFields.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/createSolidFields.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/createSolidFields.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/createSolidMeshes.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/createSolidMeshes.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/createSolidMeshes.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/createSolidMeshes.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/readSolidMultiRegionSIMPLEControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/readSolidMultiRegionSIMPLEControls.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/readSolidMultiRegionSIMPLEControls.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/readSolidMultiRegionSIMPLEControls.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/setRegionSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/setRegionSolidFields.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/setRegionSolidFields.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/setRegionSolidFields.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/solveSolid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/solveSolid.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/solveSolid.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/solveSolid.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C index e2b1d536d2..50d8cde2fd 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C @@ -124,6 +124,41 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::rmap } +Foam::tmp +Foam::solidWallHeatFluxTemperatureFvPatchScalarField::K() const +{ + const fvMesh& mesh = patch().boundaryMesh().mesh(); + + if (mesh.objectRegistry::foundObject(KName_)) + { + return patch().lookupPatchField(KName_); + } + else if (mesh.objectRegistry::foundObject(KName_)) + { + const symmTensorField& KWall = + patch().lookupPatchField(KName_); + + vectorField n = patch().nf(); + + return n & KWall & n; + } + else + { + FatalErrorIn + ( + "solidWallHeatFluxTemperatureFvPatchScalarField::K()" + " const" + ) << "Did not find field " << KName_ + << " on mesh " << mesh.name() << " patch " << patch().name() + << endl + << "Please set 'K' to a valid volScalarField" + << " or a valid volSymmTensorField." << exit(FatalError); + + return scalarField(0); + } +} + + void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() { if (updated()) @@ -131,14 +166,24 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() return; } - const scalarField& Kw = patch().lookupPatchField - ( - KName_ - ); - - gradient() = q_/Kw; + gradient() = q_/K(); fixedGradientFvPatchScalarField::updateCoeffs(); + + if (debug) + { + scalar Q = gSum(K()*patch().magSf()*snGrad()); + + Info<< patch().boundaryMesh().mesh().name() << ':' + << patch().name() << ':' + << this->dimensionedInternalField().name() << " :" + << " heatFlux:" << Q + << " walltemperature " + << " min:" << gMin(*this) + << " max:" << gMax(*this) + << " avg:" << gAverage(*this) + << endl; + } } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H index ffbcf52ed5..0544b2bffa 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H @@ -31,9 +31,10 @@ Description myWallPatch { type solidWallHeatFluxTemperature; - K K; // Name of K field - q uniform 1000; // Heat flux / [W/m2] - value 300.0; // Initial temperature / [K] + K K; // Name of K field + q uniform 1000; // Heat flux / [W/m2] + value uniform 300.0; // Initial temperature / [K] + gradient uniform 0.0; // Initial gradient / [K/m] } @@ -140,6 +141,11 @@ public: // Member functions + // Helper + + //- Get K field on this patch + tmp K() const; + // Evaluation functions //- Update the coefficients associated with the patch field diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/Make/files b/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/Make/files deleted file mode 100644 index e5f536ca09..0000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/Make/files +++ /dev/null @@ -1,5 +0,0 @@ -derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C -chtMultiRegionSimpleFoam.C - -EXE = $(FOAM_APPBIN)/chtMultiRegionSimpleFoam - diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C deleted file mode 100644 index e2b1d536d2..0000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C +++ /dev/null @@ -1,168 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / 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 . - -\*---------------------------------------------------------------------------*/ - -#include "solidWallHeatFluxTemperatureFvPatchScalarField.H" -#include "addToRunTimeSelectionTable.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::solidWallHeatFluxTemperatureFvPatchScalarField:: -solidWallHeatFluxTemperatureFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF -) -: - fixedGradientFvPatchScalarField(p, iF), - q_(p.size(), 0.0), - KName_("undefined-K") -{} - - -Foam::solidWallHeatFluxTemperatureFvPatchScalarField:: -solidWallHeatFluxTemperatureFvPatchScalarField -( - const solidWallHeatFluxTemperatureFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - fixedGradientFvPatchScalarField(ptf, p, iF, mapper), - q_(ptf.q_, mapper), - KName_(ptf.KName_) -{} - - -Foam::solidWallHeatFluxTemperatureFvPatchScalarField:: -solidWallHeatFluxTemperatureFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedGradientFvPatchScalarField(p, iF, dict), - q_("q", dict, p.size()), - KName_(dict.lookup("K")) -{} - - -Foam::solidWallHeatFluxTemperatureFvPatchScalarField:: -solidWallHeatFluxTemperatureFvPatchScalarField -( - const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf -) -: - fixedGradientFvPatchScalarField(tppsf), - q_(tppsf.q_), - KName_(tppsf.KName_) -{} - - -Foam::solidWallHeatFluxTemperatureFvPatchScalarField:: -solidWallHeatFluxTemperatureFvPatchScalarField -( - const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf, - const DimensionedField& iF -) -: - fixedGradientFvPatchScalarField(tppsf, iF), - q_(tppsf.q_), - KName_(tppsf.KName_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedGradientFvPatchScalarField::autoMap(m); - q_.autoMap(m); -} - - -void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::rmap -( - const fvPatchScalarField& ptf, - const labelList& addr -) -{ - fixedGradientFvPatchScalarField::rmap(ptf, addr); - - const solidWallHeatFluxTemperatureFvPatchScalarField& hfptf = - refCast(ptf); - - q_.rmap(hfptf.q_, addr); -} - - -void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const scalarField& Kw = patch().lookupPatchField - ( - KName_ - ); - - gradient() = q_/Kw; - - fixedGradientFvPatchScalarField::updateCoeffs(); -} - - -void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::write -( - Ostream& os -) const -{ - fixedGradientFvPatchScalarField::write(os); - q_.writeEntry("q", os); - os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl; - this->writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makePatchTypeField - ( - fvPatchScalarField, - solidWallHeatFluxTemperatureFvPatchScalarField - ); -} - -// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H b/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H deleted file mode 100644 index ffbcf52ed5..0000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H +++ /dev/null @@ -1,180 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / 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 . - -Class - solidWallHeatFluxTemperatureFvPatchScalarField - -Description - Heat flux boundary condition for temperature on solid region - - Example usage: - myWallPatch - { - type solidWallHeatFluxTemperature; - K K; // Name of K field - q uniform 1000; // Heat flux / [W/m2] - value 300.0; // Initial temperature / [K] - } - - -SourceFiles - solidWallHeatFluxTemperatureFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H -#define solidWallHeatFluxTemperatureFvPatchScalarField_H - -#include "fixedGradientFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class solidWallHeatFluxTemperatureFvPatchScalarField Declaration -\*---------------------------------------------------------------------------*/ - -class solidWallHeatFluxTemperatureFvPatchScalarField -: - public fixedGradientFvPatchScalarField -{ - // Private data - - //- Heat flux / [W/m2] - scalarField q_; - - //- Name of thermal conductivity field - word KName_; - - -public: - - //- Runtime type information - TypeName("solidWallHeatFluxTemperature"); - - - // Constructors - - //- Construct from patch and internal field - solidWallHeatFluxTemperatureFvPatchScalarField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - solidWallHeatFluxTemperatureFvPatchScalarField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given - // solidWallHeatFluxTemperatureFvPatchScalarField - // onto a new patch - solidWallHeatFluxTemperatureFvPatchScalarField - ( - const solidWallHeatFluxTemperatureFvPatchScalarField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - solidWallHeatFluxTemperatureFvPatchScalarField - ( - const solidWallHeatFluxTemperatureFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new solidWallHeatFluxTemperatureFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - solidWallHeatFluxTemperatureFvPatchScalarField - ( - const solidWallHeatFluxTemperatureFvPatchScalarField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new solidWallHeatFluxTemperatureFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - - // Mapping functions - - //- Map (and resize as needed) from self given a mapping object - virtual void autoMap - ( - const fvPatchFieldMapper& - ); - - //- Reverse map the given fvPatchField onto this fvPatchField - virtual void rmap - ( - const fvPatchScalarField&, - const labelList& - ); - - - // I-O - - //- Write - void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C index 97992e8192..a18298f826 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointShapeOptimizationFoam.C @@ -78,7 +78,7 @@ int main(int argc, char *argv[]) Info<< "\nStarting time loop\n" << endl; - for (runTime++; !runTime.end(); runTime++) + while (runTime.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H b/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H index dd2f6416ee..0c8c1bd115 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H @@ -1,4 +1,4 @@ - Info << "Reading field p\n" << endl; + Info<< "Reading field p\n" << endl; volScalarField p ( IOobject @@ -12,7 +12,7 @@ mesh ); - Info << "Reading field U\n" << endl; + Info<< "Reading field U\n" << endl; volVectorField U ( IOobject @@ -34,7 +34,7 @@ setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue); - Info << "Reading field pa\n" << endl; + Info<< "Reading field pa\n" << endl; volScalarField pa ( IOobject @@ -48,7 +48,7 @@ mesh ); - Info << "Reading field Ua\n" << endl; + Info<< "Reading field Ua\n" << endl; volVectorField Ua ( IOobject @@ -84,10 +84,8 @@ dimensionedScalar lambda(laminarTransport.lookup("lambda")); dimensionedScalar alphaMax(laminarTransport.lookup("alphaMax")); - const labelList& inletCells = - mesh.boundary()[mesh.boundaryMesh().findPatchID("inlet")].faceCells(); - //const labelList& outletCells = - // mesh.boundary()[mesh.boundaryMesh().findPatchID("outlet")].faceCells(); + const labelList& inletCells = mesh.boundary()["inlet"].faceCells(); + //const labelList& outletCells = mesh.boundary()["outlet"].faceCells(); volScalarField alpha ( diff --git a/applications/solvers/incompressible/boundaryFoam/makeGraphs.H b/applications/solvers/incompressible/boundaryFoam/makeGraphs.H index 7367dc7c7d..2f24e8924b 100644 --- a/applications/solvers/incompressible/boundaryFoam/makeGraphs.H +++ b/applications/solvers/incompressible/boundaryFoam/makeGraphs.H @@ -25,9 +25,9 @@ makeGraph(y, flowDirection & R & flowDirection, "Rff", gFormat); makeGraph(y, wallNormal & R & wallNormal, "Rww", gFormat); makeGraph(y, flowDirection & R & wallNormal, "Rfw", gFormat); -makeGraph(y, sqrt(mag(R.component(tensor::XX))), "u", gFormat); -makeGraph(y, sqrt(mag(R.component(tensor::YY))), "v", gFormat); -makeGraph(y, sqrt(mag(R.component(tensor::ZZ))), "w", gFormat); -makeGraph(y, R.component(tensor::XY), "uv", gFormat); +makeGraph(y, sqrt(mag(R.component(symmTensor::XX))), "u", gFormat); +makeGraph(y, sqrt(mag(R.component(symmTensor::YY))), "v", gFormat); +makeGraph(y, sqrt(mag(R.component(symmTensor::ZZ))), "w", gFormat); +makeGraph(y, R.component(symmTensor::XY), "uv", gFormat); makeGraph(y, mag(fvc::grad(U)), "gammaDot", gFormat); diff --git a/applications/solvers/incompressible/pimpleDyMFoam/correctPhi.H b/applications/solvers/incompressible/pimpleDyMFoam/correctPhi.H index f1651d8df3..f137c0027f 100644 --- a/applications/solvers/incompressible/pimpleDyMFoam/correctPhi.H +++ b/applications/solvers/incompressible/pimpleDyMFoam/correctPhi.H @@ -27,7 +27,7 @@ zeroGradientFvPatchScalarField::typeName ); - for (label i=0; icorrect(); + turbulence->correct(); + } runTime.write(); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H index 65be09775c..ea325dabe0 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H @@ -11,7 +11,7 @@ basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); - word inertSpecie(thermo.lookup("inertSpecie")); + const word inertSpecie(thermo.lookup("inertSpecie")); if (!composition.contains(inertSpecie)) { diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/Make/files b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/Make/files new file mode 100644 index 0000000000..7a27f008c8 --- /dev/null +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/Make/files @@ -0,0 +1,3 @@ +incompressibleUncoupledKinematicParcelFoam.C + +EXE = $(FOAM_APPBIN)/incompressibleUncoupledKinematicParcelFoam diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/Make/options b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/Make/options new file mode 100644 index 0000000000..1ad3529232 --- /dev/null +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/Make/options @@ -0,0 +1,27 @@ +EXE_INC = \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ + -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/surfaceFilmModels/lnInclude + +EXE_LIBS = \ + -llagrangian \ + -llagrangianIntermediate \ + -lthermophysicalFunctions \ + -lbasicThermophysicalModels \ + -lspecie \ + -lradiation \ + -lincompressibleRASModels \ + -lincompressibleLESModels \ + -lincompressibleTransportModels \ + -lfiniteVolume \ + -lmeshTools \ + -lsurfaceFilmModels diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H new file mode 100644 index 0000000000..d98e9369b8 --- /dev/null +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/createFields.H @@ -0,0 +1,147 @@ + Info<< "Reading transportProperties\n" << endl; + + IOdictionary transportProperties + ( + IOobject + ( + "transportProperties", + runTime.constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ); + + dimensionedScalar rhoInfValue + ( + transportProperties.lookup("rhoInf") + ); + + volScalarField rhoInf + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + rhoInfValue + ); + + Info<< "\nReading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + #include "createPhi.H" + + Info<< "Creating turbulence model\n" << endl; + + singlePhaseTransportModel laminarTransport(U, phi); + + const volScalarField nu = laminarTransport.nu(); + + autoPtr turbulence + ( + incompressible::turbulenceModel::New(U, phi, laminarTransport) + ); + + volScalarField mu + ( + IOobject + ( + "mu", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + nu*rhoInfValue + ); + + word kinematicCloudName("kinematicCloud"); + args.optionReadIfPresent("cloudName", kinematicCloudName); + + Info<< "Constructing kinematicCloud " << kinematicCloudName << endl; + basicKinematicCloud kinematicCloud + ( + kinematicCloudName, + rhoInf, + U, + mu, + g + ); + + IOobject Hheader + ( + "H", + runTime.timeName(), + mesh, + IOobject::NO_READ + ); + + autoPtr HPtr_; + + if (Hheader.headerOk()) + { + Info<< "\nReading field H\n" << endl; + + HPtr_.reset + ( + new volVectorField + ( + IOobject + ( + "H", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ) + ); + } + + IOobject HdotGradHheader + ( + "HdotGradH", + runTime.timeName(), + mesh, + IOobject::NO_READ + ); + + autoPtr HdotGradHPtr_; + + if (HdotGradHheader.headerOk()) + { + Info<< "\nReading field HdotGradH\n" << endl; + + HdotGradHPtr_.reset + ( + new volVectorField + ( + IOobject + ( + "HdotGradH", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ) + ); + } diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/incompressibleUncoupledKinematicParcelFoam.C b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/incompressibleUncoupledKinematicParcelFoam.C new file mode 100644 index 0000000000..8d3f2279bc --- /dev/null +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/incompressibleUncoupledKinematicParcelFoam.C @@ -0,0 +1,86 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + uncoupledKinematicParcelFoam + +Description + Transient solver for the passive transport of a single kinematic + particle could. + + Uses a pre-calculated velocity field to evolve the cloud. + +\*---------------------------------------------------------------------------*/ + +#include "fvCFD.H" +#include "singlePhaseTransportModel.H" +#include "turbulenceModel.H" +#include "basicKinematicCloud.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +int main(int argc, char *argv[]) +{ + argList::addOption + ( + "cloudName", + "name", + "specify alternative cloud name. default is 'kinematicCloud'" + ); + + #include "setRootCase.H" + #include "createTime.H" + #include "createMesh.H" + #include "readGravitationalAcceleration.H" + #include "createFields.H" + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + Info<< "\nStarting time loop\n" << endl; + + while (runTime.loop()) + { + Info<< "Time = " << runTime.timeName() << nl << endl; + + Info<< "Evolving " << kinematicCloud.name() << endl; + + laminarTransport.correct(); + + mu = nu*rhoInfValue; + + kinematicCloud.evolve(); + + runTime.write(); + + Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" + << " ClockTime = " << runTime.elapsedClockTime() << " s" + << nl << endl; + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H index cf3f484bdb..3ad06c22b3 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H @@ -11,7 +11,7 @@ basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); - word inertSpecie(thermo.lookup("inertSpecie")); + const word inertSpecie(thermo.lookup("inertSpecie")); if (!composition.contains(inertSpecie)) { diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H index 5cf44cb09f..c687f2035b 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H @@ -14,7 +14,7 @@ tmp > mvConvection label inertIndex = -1; volScalarField Yt = 0.0*Y[0]; - for (label i=0; i& Y = composition.Y(); - word inertSpecie(thermo.lookup("inertSpecie")); + const word inertSpecie(thermo.lookup("inertSpecie")); volScalarField& p = thermo.p(); volScalarField& hs = thermo.hs(); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H index e071ac8b3d..0fd631fb7f 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H @@ -11,7 +11,7 @@ basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); - word inertSpecie(thermo.lookup("inertSpecie")); + const word inertSpecie(thermo.lookup("inertSpecie")); if (!composition.contains(inertSpecie)) { diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C index 13757df7ba..1fdc783a4f 100644 --- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C +++ b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/uncoupledKinematicParcelFoam.C @@ -41,7 +41,12 @@ Description int main(int argc, char *argv[]) { - argList::addOption("cloudName", "cloud name"); + argList::addOption + ( + "cloudName", + "name", + "specify alternative cloud name. default is 'kinematicCloud'" + ); #include "setRootCase.H" #include "createTime.H" diff --git a/applications/solvers/multiphase/bubbleFoam/createPhia.H b/applications/solvers/multiphase/bubbleFoam/createPhia.H index 703587bfd5..ac0418c5dc 100644 --- a/applications/solvers/multiphase/bubbleFoam/createPhia.H +++ b/applications/solvers/multiphase/bubbleFoam/createPhia.H @@ -36,7 +36,7 @@ calculatedFvPatchScalarField::typeName ); - for (label i=0; i(Ua.boundaryField()[i])) { diff --git a/applications/solvers/multiphase/bubbleFoam/createPhib.H b/applications/solvers/multiphase/bubbleFoam/createPhib.H index 77bb467063..bdf4c46bcc 100644 --- a/applications/solvers/multiphase/bubbleFoam/createPhib.H +++ b/applications/solvers/multiphase/bubbleFoam/createPhib.H @@ -36,7 +36,7 @@ calculatedFvPatchScalarField::typeName ); - for (label i=0; i(Ub.boundaryField()[i])) { diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H b/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H index 3da1b5e9c1..9d3be93d0e 100644 --- a/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H @@ -135,7 +135,7 @@ zeroGradientFvPatchScalarField::typeName ); - for (label i=0; ifind(phaseChangeTwoPhaseMixtureTypeName); + componentsConstructorTablePtr_->find(mixtureType); if (cstrIter == componentsConstructorTablePtr_->end()) { @@ -67,8 +64,8 @@ Foam::phaseChangeTwoPhaseMixture::New ( "phaseChangeTwoPhaseMixture::New" ) << "Unknown phaseChangeTwoPhaseMixture type " - << phaseChangeTwoPhaseMixtureTypeName << endl << endl - << "Valid phaseChangeTwoPhaseMixtures are : " << endl + << mixtureType << nl << nl + << "Valid phaseChangeTwoPhaseMixture types are : " << endl << componentsConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C index 990db1cda3..3cf76bab1b 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C @@ -50,7 +50,7 @@ Istream& operator>> alphaContactAngleFvPatchScalarField::interfaceThetaProps& tp ) { - is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_; + is >> tp.theta0_ >> tp.uTheta_ >> tp.thetaA_ >> tp.thetaR_; return is; } diff --git a/applications/solvers/multiphase/settlingFoam/createFields.H b/applications/solvers/multiphase/settlingFoam/createFields.H index 6833c90ec9..c8e05c4209 100644 --- a/applications/solvers/multiphase/settlingFoam/createFields.H +++ b/applications/solvers/multiphase/settlingFoam/createFields.H @@ -159,7 +159,7 @@ Info<< "Selecting Drift-Flux model " << endl; - word VdjModel(transportProperties.lookup("VdjModel")); + const word VdjModel(transportProperties.lookup("VdjModel")); Info<< tab << VdjModel << " selected\n" << endl; diff --git a/applications/solvers/multiphase/settlingFoam/pmhEqn.H b/applications/solvers/multiphase/settlingFoam/pmhEqn.H index 5a9b01a6f2..642479b8d0 100644 --- a/applications/solvers/multiphase/settlingFoam/pmhEqn.H +++ b/applications/solvers/multiphase/settlingFoam/pmhEqn.H @@ -17,7 +17,7 @@ phi = surfaceScalarField phiU("phiU", phi); phi -= ghf*fvc::snGrad(rho)*rUAf*mesh.magSf(); -for(int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) +for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { fvScalarMatrix pmhEqn ( diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files index 8d23cb9550..cf4603e1f8 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files @@ -1,5 +1,5 @@ dragModels/dragModel/dragModel.C -dragModels/dragModel/newDragModel.C +dragModels/dragModel/dragModelNew.C dragModels/Ergun/Ergun.C dragModels/GidaspowErgunWenYu/GidaspowErgunWenYu.C dragModels/GidaspowSchillerNaumann/GidaspowSchillerNaumann.C diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H index 4dbcbe86e6..7e05bcb464 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModel.H @@ -28,7 +28,7 @@ Description SourceFiles dragModel.C - newDragModel.C + dragModelNew.C \*---------------------------------------------------------------------------*/ diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C similarity index 72% rename from applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C rename to applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C index 2f147a0dee..d916f84693 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/newDragModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/dragModel/dragModelNew.C @@ -35,28 +35,24 @@ Foam::autoPtr Foam::dragModel::New const phaseModel& phaseb ) { - word dragModelType - ( - interfaceDict.lookup("dragModel" + phasea.name()) - ); + const word modelType(interfaceDict.lookup("dragModel" + phasea.name())); - Info<< "Selecting dragModel for phase " - << phasea.name() - << ": " - << dragModelType << endl; + Info<< "Selecting dragModel for phase " << phasea.name() + << ": " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(dragModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "dragModel::New : " << endl - << " unknown dragModelType type " - << dragModelType - << ", constructor not in hash table" << endl << endl - << " Valid dragModel types are : " << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "dragModel::New(...)" + ) << "Unknown dragModel type " + << modelType << nl << nl + << "Valid dragModel types are : " << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return cstrIter()(interfaceDict, alpha, phasea, phaseb); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/Make/files b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/Make/files index a6ff2ca0f0..43c2f6df9d 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/Make/files +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/Make/files @@ -1,32 +1,32 @@ kineticTheoryModel/kineticTheoryModel.C viscosityModel/viscosityModel/viscosityModel.C -viscosityModel/viscosityModel/newViscosityModel.C +viscosityModel/viscosityModel/viscosityModelNew.C viscosityModel/Gidaspow/GidaspowViscosity.C viscosityModel/Syamlal/SyamlalViscosity.C viscosityModel/HrenyaSinclair/HrenyaSinclairViscosity.C viscosityModel/none/noneViscosity.C conductivityModel/conductivityModel/conductivityModel.C -conductivityModel/conductivityModel/newConductivityModel.C +conductivityModel/conductivityModel/conductivityModelNew.C conductivityModel/Gidaspow/GidaspowConductivity.C conductivityModel/Syamlal/SyamlalConductivity.C conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C radialModel/radialModel/radialModel.C -radialModel/radialModel/newRadialModel.C +radialModel/radialModel/radialModelNew.C radialModel/CarnahanStarling/CarnahanStarlingRadial.C radialModel/Gidaspow/GidaspowRadial.C radialModel/LunSavage/LunSavageRadial.C radialModel/SinclairJackson/SinclairJacksonRadial.C granularPressureModel/granularPressureModel/granularPressureModel.C -granularPressureModel/granularPressureModel/newGranularPressureModel.C +granularPressureModel/granularPressureModel/granularPressureModelNew.C granularPressureModel/Lun/LunPressure.C granularPressureModel/SyamlalRogersOBrien/SyamlalRogersOBrienPressure.C frictionalStressModel/frictionalStressModel/frictionalStressModel.C -frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C +frictionalStressModel/frictionalStressModel/frictionalStressModelNew.C frictionalStressModel/JohnsonJackson/JohnsonJacksonFrictionalStress.C frictionalStressModel/Schaeffer/SchaefferFrictionalStress.C diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModelNew.C similarity index 72% rename from applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C rename to applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModelNew.C index 74b2a1fbcc..8b29862356 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/newConductivityModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/conductivityModel/conductivityModel/conductivityModelNew.C @@ -32,23 +32,23 @@ Foam::autoPtr Foam::conductivityModel::New const dictionary& dict ) { - word conductivityModelType(dict.lookup("conductivityModel")); + const word modelType(dict.lookup("conductivityModel")); - Info<< "Selecting conductivityModel " - << conductivityModelType << endl; + Info<< "Selecting conductivityModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(conductivityModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "conductivityModel::New(const dictionary&) : " << endl - << " unknown conductivityModelType type " - << conductivityModelType - << ", constructor not in hash table" << endl << endl - << " Valid conductivityModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "conductivityModel::New(const dictionary&)" + ) << "Unknown conductivityModel type " + << modelType << nl << nl + << "Valid conductivityModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModelNew.C similarity index 71% rename from applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C rename to applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModelNew.C index 391737f16b..447298e219 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/newFrictionalStressModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/frictionalStressModel/frictionalStressModel/frictionalStressModelNew.C @@ -32,23 +32,24 @@ Foam::autoPtr Foam::frictionalStressModel::New const dictionary& dict ) { - word frictionalStressModelType(dict.lookup("frictionalStressModel")); + const word modelType(dict.lookup("frictionalStressModel")); - Info<< "Selecting frictionalStressModel " - << frictionalStressModelType << endl; + Info<< "Selecting frictionalStressModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(frictionalStressModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "frictionalStressModel::New(const dictionary&) : " << endl - << " unknown frictionalStressModelType type " - << frictionalStressModelType - << ", constructor not in hash table" << endl << endl - << " Valid frictionalStressModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "frictionalStressModel::New(const dictionary&)" + ) + << "Unknown frictionalStressModel type " + << modelType << nl << nl + << "Valid frictionalStressModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModelNew.C similarity index 71% rename from applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C rename to applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModelNew.C index f9697eca51..682ce1781a 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/newGranularPressureModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/granularPressureModel/granularPressureModel/granularPressureModelNew.C @@ -32,23 +32,23 @@ Foam::autoPtr Foam::granularPressureModel::New const dictionary& dict ) { - word granularPressureModelType(dict.lookup("granularPressureModel")); + const word modelType(dict.lookup("granularPressureModel")); - Info<< "Selecting granularPressureModel " - << granularPressureModelType << endl; + Info<< "Selecting granularPressureModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(granularPressureModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "granularPressureModel::New(const dictionary&) : " << endl - << " unknown granularPressureModelType type " - << granularPressureModelType - << ", constructor not in hash table" << endl << endl - << " Valid granularPressureModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "granularPressureModel::New(const dictionary&)" + ) << "Unknown granularPressureModel type " + << modelType << nl << nl + << "Valid granularPressureModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModelNew.C similarity index 74% rename from applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C rename to applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModelNew.C index f2a46d79c4..14bd1a52e8 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/newRadialModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/radialModel/radialModel/radialModelNew.C @@ -32,23 +32,24 @@ Foam::autoPtr Foam::radialModel::New const dictionary& dict ) { - word radialModelType(dict.lookup("radialModel")); + const word modelType(dict.lookup("radialModel")); - Info<< "Selecting radialModel " - << radialModelType << endl; + Info<< "Selecting radialModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(radialModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "radialModel::New(const dictionary&) : " << endl - << " unknown radialModelType type " - << radialModelType - << ", constructor not in hash table" << endl << endl - << " Valid radialModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "radialModel::New(const dictionary&)" + ) + << "Unknown radialModel type " + << modelType << nl << nl + << "Valid radialModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModelNew.C similarity index 73% rename from applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C rename to applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModelNew.C index 8998c45053..35b9684509 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/newViscosityModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/kineticTheoryModels/viscosityModel/viscosityModel/viscosityModelNew.C @@ -33,23 +33,23 @@ Foam::kineticTheoryModels::viscosityModel::New const dictionary& dict ) { - word viscosityModelType(dict.lookup("viscosityModel")); + const word modelType(dict.lookup("viscosityModel")); - Info<< "Selecting viscosityModel " - << viscosityModelType << endl; + Info<< "Selecting viscosityModel " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(viscosityModelType); + dictionaryConstructorTablePtr_->find(modelType); if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalError - << "viscosityModel::New(const dictionary&) : " << endl - << " unknown viscosityModelType type " - << viscosityModelType - << ", constructor not in hash table" << endl << endl - << " Valid viscosityModelType types are :" << endl; - Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError); + FatalErrorIn + ( + "viscosityModel::New(const dictionary&)" + ) << "Unknown viscosityModel type " + << modelType << nl << nl + << "Valid viscosityModel types are :" << endl + << dictionaryConstructorTablePtr_->sortedToc() + << abort(FatalError); } return autoPtr(cstrIter()(dict)); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C index 805cd23845..4d6025a256 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseModel/phaseModel/phaseModel.C @@ -106,7 +106,7 @@ Foam::phaseModel::phaseModel calculatedFvPatchScalarField::typeName ); - for (label i=0; i(U_.boundaryField()[i])) { diff --git a/applications/test/Dictionary/DictionaryTest.C b/applications/test/Dictionary/DictionaryTest.C index 2844489f72..db4bc1ce75 100644 --- a/applications/test/Dictionary/DictionaryTest.C +++ b/applications/test/Dictionary/DictionaryTest.C @@ -59,7 +59,7 @@ public: friend Ostream& operator<<(Ostream& os, const ent& e) { - os << e.keyword_ << ' ' << e.i_ << endl; + os << e.keyword_ << ' ' << e.i_ << endl; return os; } }; @@ -88,7 +88,7 @@ public: friend Ostream& operator<<(Ostream& os, const Scalar& val) { - os << val.data_; + os << val.data_; return os; } }; diff --git a/applications/test/DynamicList/DynamicListTest.C b/applications/test/DynamicList/DynamicListTest.C index be04a87c67..822ee3cacb 100644 --- a/applications/test/DynamicList/DynamicListTest.C +++ b/applications/test/DynamicList/DynamicListTest.C @@ -27,6 +27,7 @@ Description #include "DynamicList.H" #include "IOstreams.H" +#include "ListOps.H" using namespace Foam; @@ -185,6 +186,9 @@ int main(int argc, char *argv[]) dlE3 = dlE2; // assign identical Info<< "" << dlE3 << "" << endl; + DynamicList