diff --git a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H index 6c64056be2e8e2e11a00c5286515b93e277fa085..4d7334c5f8640b44f31a06802f845a7d7c730407 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/pEqn.H @@ -1,98 +1,102 @@ -rho = thermo.rho(); -rho = max(rho, rhoMin); -rho = min(rho, rhoMax); -rho.relax(); - -volScalarField rAU(1.0/UEqn().A()); -volVectorField HbyA("HbyA", U); -HbyA = rAU*UEqn().H(); +{ + rho = thermo.rho(); + rho = max(rho, rhoMin); + rho = min(rho, rhoMax); + rho.relax(); -UEqn.clear(); + volScalarField rAU(1.0/UEqn().A()); + volVectorField HbyA("HbyA", U); + HbyA = rAU*UEqn().H(); -bool closedVolume = false; + UEqn.clear(); -if (simple.transonic()) -{ - surfaceScalarField phid - ( - "phid", - fvc::interpolate(psi)*(fvc::interpolate(HbyA) & mesh.Sf()) - ); + bool closedVolume = false; - while (simple.correctNonOrthogonal()) + if (simple.transonic()) { - fvScalarMatrix pEqn + surfaceScalarField phid ( - fvm::div(phid, p) - - fvm::laplacian(rho*rAU, p) + "phid", + fvc::interpolate(psi)*(fvc::interpolate(HbyA) & mesh.Sf()) ); - // Relax the pressure equation to ensure diagonal-dominance - pEqn.relax(); + while (simple.correctNonOrthogonal()) + { + fvScalarMatrix pEqn + ( + fvm::div(phid, p) + - fvm::laplacian(rho*rAU, p) + ); - pEqn.setReference(pRefCell, pRefValue); + // Relax the pressure equation to ensure diagonal-dominance + pEqn.relax(); - pEqn.solve(); + pEqn.setReference(pRefCell, pRefValue); - if (simple.finalNonOrthogonalIter()) - { - phi == pEqn.flux(); + pEqn.solve(); + + if (simple.finalNonOrthogonalIter()) + { + phi == pEqn.flux(); + } } } -} -else -{ - surfaceScalarField phiHbyA - ( - "phiHbyA", - fvc::interpolate(rho)*(fvc::interpolate(HbyA) & mesh.Sf()) - ); - - closedVolume = adjustPhi(phiHbyA, U, p); - - while (simple.correctNonOrthogonal()) + else { - fvScalarMatrix pEqn + surfaceScalarField phiHbyA ( - fvc::div(phiHbyA) - - fvm::laplacian(rho*rAU, p) + "phiHbyA", + fvc::interpolate(rho)*(fvc::interpolate(HbyA) & mesh.Sf()) ); - pEqn.setReference(pRefCell, pRefValue); - - pEqn.solve(); + closedVolume = adjustPhi(phiHbyA, U, p); - if (simple.finalNonOrthogonalIter()) + while (simple.correctNonOrthogonal()) { - phi = phiHbyA + pEqn.flux(); + fvScalarMatrix pEqn + ( + fvc::div(phiHbyA) + - fvm::laplacian(rho*rAU, p) + ); + + pEqn.setReference(pRefCell, pRefValue); + + pEqn.solve(); + + if (simple.finalNonOrthogonalIter()) + { + phi = phiHbyA + pEqn.flux(); + } } } -} -#include "incompressible/continuityErrs.H" + #include "incompressible/continuityErrs.H" -// Explicitly relax pressure for momentum corrector -p.relax(); + // Explicitly relax pressure for momentum corrector + p.relax(); -U = HbyA - rAU*fvc::grad(p); -U.correctBoundaryConditions(); + U = HbyA - rAU*fvc::grad(p); + U.correctBoundaryConditions(); -// For closed-volume cases adjust the pressure and density levels -// to obey overall mass continuity -if (closedVolume) -{ - p += (initialMass - fvc::domainIntegrate(psi*p)) - /fvc::domainIntegrate(psi); -} + // For closed-volume cases adjust the pressure and density levels + // to obey overall mass continuity + if (closedVolume) + { + p += (initialMass - fvc::domainIntegrate(psi*p)) + /fvc::domainIntegrate(psi); + } -rho = thermo.rho(); -rho = max(rho, rhoMin); -rho = min(rho, rhoMax); + rho = thermo.rho(); + rho = max(rho, rhoMin); + rho = min(rho, rhoMax); -if (!simple.transonic()) -{ - rho.relax(); -} + if (!simple.transonic()) + { + rho.relax(); + } -Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; + Info<< "rho max/min : " + << max(rho).value() << " " + << min(rho).value() << endl; +} diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/createFields.H b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/createFields.H new file mode 100644 index 0000000000000000000000000000000000000000..96bdb2a122b0b346cb7f0602e90d0dfef6e2612b --- /dev/null +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/createFields.H @@ -0,0 +1,61 @@ + Info<< "Reading thermophysical properties\n" << endl; + + autoPtr<rhoThermo> pThermo + ( + rhoThermo::New(mesh) + ); + rhoThermo& thermo = pThermo(); + + volScalarField rho + ( + IOobject + ( + "rho", + runTime.timeName(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE + ), + thermo.rho() + ); + + volScalarField& p = thermo.p(); + volScalarField& e = thermo.he(); + + Info<< "Reading field U\n" << endl; + volVectorField U + ( + IOobject + ( + "U", + runTime.timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ); + + #include "compressibleCreatePhi.H" + + + label pRefCell = 0; + scalar pRefValue = 0.0; + setRefCell(p, simple.dict(), pRefCell, pRefValue); + + dimensionedScalar rhoMax(simple.dict().lookup("rhoMax")); + dimensionedScalar rhoMin(simple.dict().lookup("rhoMin")); + + Info<< "Creating turbulence model\n" << endl; + autoPtr<compressible::RASModel> turbulence + ( + compressible::RASModel::New + ( + rho, + U, + phi, + thermo + ) + ); + + dimensionedScalar initialMass = fvc::domainIntegrate(rho); diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/eEqn.H b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/eEqn.H index 4791062d35ac4c8031951ca123e2d215c9b6695f..5d0f174623b04cd20f8d643792d07dcf04ab3a25 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/eEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/eEqn.H @@ -1,4 +1,5 @@ { + // Kinetic + pressure energy volScalarField Ekp("Ekp", 0.5*magSqr(U) + p/rho); fvScalarMatrix eEqn @@ -10,7 +11,7 @@ fvc::div(phi)*Ekp - fvc::div(phi, Ekp) ); - //pZones.addEnergySource(thermo, rho, eEqn); + pZones.addEnergySource(thermo, rho, eEqn); eEqn.relax(); eEqn.solve(); diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/pEqn.H b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/pEqn.H index c3e0a43a15a419bd2e40d8727b8b3095f1289096..81b194823cb3c22012db5117ce7b7f7f5382b604 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/pEqn.H @@ -1,52 +1,24 @@ -volVectorField HbyA("HbyA", U); - -if (pressureImplicitPorosity) -{ - HbyA = trTU() & UEqn().H(); -} -else { - HbyA = trAU()*UEqn().H(); -} - -UEqn.clear(); + rho = thermo.rho(); + rho = max(rho, rhoMin); + rho = min(rho, rhoMax); + rho.relax(); -bool closedVolume = false; + volVectorField HbyA("HbyA", U); -if (simple.transonic()) -{ - surfaceScalarField phid - ( - "phid", - fvc::interpolate(psi)*(fvc::interpolate(HbyA) & mesh.Sf()) - ); - mrfZones.relativeFlux(fvc::interpolate(psi), phid); - - while (simple.correctNonOrthogonal()) + if (pressureImplicitPorosity) { - tmp<fvScalarMatrix> tpEqn; + HbyA = trTU() & UEqn().H(); + } + else + { + HbyA = trAU()*UEqn().H(); + } - if (pressureImplicitPorosity) - { - tpEqn = (fvc::div(phid, p) - fvm::laplacian(rho*trTU(), p)); - } - else - { - tpEqn = (fvc::div(phid, p) - fvm::laplacian(rho*trAU(), p)); - } + UEqn.clear(); - tpEqn().setReference(pRefCell, pRefValue); + bool closedVolume = false; - tpEqn().solve(); - - if (simple.finalNonOrthogonalIter()) - { - phi == tpEqn().flux(); - } - } -} -else -{ surfaceScalarField phiHbyA ( "phiHbyA", @@ -79,34 +51,37 @@ else phi = phiHbyA - tpEqn().flux(); } } -} -#include "incompressible/continuityErrs.H" + #include "incompressible/continuityErrs.H" -// Explicitly relax pressure for momentum corrector -p.relax(); + // Explicitly relax pressure for momentum corrector + p.relax(); -if (pressureImplicitPorosity) -{ - U = HbyA - (trTU() & fvc::grad(p)); -} -else -{ - U = HbyA - trAU()*fvc::grad(p); -} + if (pressureImplicitPorosity) + { + U = HbyA - (trTU() & fvc::grad(p)); + } + else + { + U = HbyA - trAU()*fvc::grad(p); + } -U.correctBoundaryConditions(); + U.correctBoundaryConditions(); -// For closed-volume cases adjust the pressure and density levels -// to obey overall mass continuity -if (closedVolume) -{ - p += (initialMass - fvc::domainIntegrate(psi*p)) - /fvc::domainIntegrate(psi); -} + // For closed-volume cases adjust the pressure and density levels + // to obey overall mass continuity + if (closedVolume) + { + const volScalarField& psi = thermo.psi(); + p += (initialMass - fvc::domainIntegrate(psi*p)) + /fvc::domainIntegrate(psi); + } -rho = thermo.rho(); -rho = max(rho, rhoMin); -rho = min(rho, rhoMax); -rho.relax(); -Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl; + rho = thermo.rho(); + rho = max(rho, rhoMin); + rho = min(rho, rhoMax); + rho.relax(); + Info<< "rho max/min : " + << max(rho).value() << " " + << min(rho).value() << endl; +} diff --git a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/rhoPorousMRFSimpleFoam.C b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/rhoPorousMRFSimpleFoam.C index 9238106885dd66fc94689acc7de1b5cb82435db3..22a58da1cc85f2fb159e7bcd7874ab34b6f6786a 100644 --- a/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/rhoPorousMRFSimpleFoam.C +++ b/applications/solvers/compressible/rhoSimpleFoam/rhoPorousMRFSimpleFoam/rhoPorousMRFSimpleFoam.C @@ -32,7 +32,7 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" -#include "psiThermo.H" +#include "rhoThermo.H" #include "RASModel.H" #include "MRFZones.H" #include "thermalPorousZones.H" diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/porousFluid/pPorousFluidEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/porousFluid/pPorousFluidEqn.H index ca338975fb1e3f1f7ec353d22e654f0efdecdf6f..9051805b87d2ef3ac383200a1d7940fcd800f4cc 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/porousFluid/pPorousFluidEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/porousFluid/pPorousFluidEqn.H @@ -16,7 +16,6 @@ porousPhi = for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { - fvScalarMatrix pEqn ( fvm::laplacian(porousRho*rAUPorous, porousP) == fvc::div(porousPhi) diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C index 35b18aaf69949cf53961d34f47c944dd31dfffe0..6223661b8152764404bc518226f6be127a5bc17c 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,33 +58,25 @@ void Foam::wedgePolyPatch::initTransforms() ); centreNormal_ /= mag(centreNormal_); - if - ( - mag(centreNormal_.x() + centreNormal_.y() + centreNormal_.z()) - < (1 - SMALL) - ) + const scalar cnCmptSum = + centreNormal_.x() + centreNormal_.y() + centreNormal_.z(); + + if (mag(cnCmptSum) < (1 - SMALL)) { - FatalErrorIn - ( - "wedgePolyPatch::wedgePolyPatch(const polyPatch&, " - "const fvBoundaryMesh&)" - ) << "wedge " << name() + FatalErrorIn("wedgePolyPatch::initTransforms()") + << "wedge " << name() << " centre plane does not align with a coordinate plane by " - << 1 - - mag(centreNormal_.x()+centreNormal_.y()+centreNormal_.z()) + << 1 - mag(cnCmptSum) << exit(FatalError); } axis_ = centreNormal_ ^ patchNormal_; scalar magAxis = mag(axis_); - axis_ /= magAxis; if (magAxis < SMALL) { - FatalErrorIn - ( - "wedgePolyPatch::initTransforms()" - ) << "wedge " << name() + FatalErrorIn("wedgePolyPatch::initTransforms()") + << "wedge " << name() << " plane aligns with a coordinate plane." << nl << " The wedge plane should make a small angle (~2.5deg)" " with the coordinate plane" << nl @@ -95,6 +87,8 @@ void Foam::wedgePolyPatch::initTransforms() << exit(FatalError); } + axis_ /= magAxis; + faceT_ = rotationTensor(centreNormal_, patchNormal_); cellT_ = faceT_ & faceT_; } diff --git a/src/OpenFOAM/primitives/quaternion/quaternion.C b/src/OpenFOAM/primitives/quaternion/quaternion.C index f7ff1904c90fb31ad33b72541ed17ee9a25014a7..cedbb56c32d81791f761dbfd759aa4039c71810e 100644 --- a/src/OpenFOAM/primitives/quaternion/quaternion.C +++ b/src/OpenFOAM/primitives/quaternion/quaternion.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,6 +51,31 @@ Foam::word Foam::name(const quaternion& q) } +Foam::quaternion Foam::slerp +( + const quaternion& qa, + const quaternion& qb, + const scalar t +) +{ + // Calculate angle between the quaternions + scalar cosHalfTheta = qa & qb; + + if (mag(cosHalfTheta) >= 1) + { + return qa; + } + + scalar halfTheta = acos(cosHalfTheta); + scalar sinHalfTheta = sqrt(1.0 - sqr(cosHalfTheta)); + + scalar wa = sin((1 - t)*halfTheta)/sinHalfTheta; + scalar wb = sin(t*halfTheta)/sinHalfTheta; + + return wa*qa + wb*qb; +} + + // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // Foam::Istream& Foam::operator>>(Istream& is, quaternion& q) diff --git a/src/OpenFOAM/primitives/quaternion/quaternion.H b/src/OpenFOAM/primitives/quaternion/quaternion.H index 730e86d68df316b0a31fb5848d5d4534f54818f3..dbe7ad15b524edd0b36fcf1ba0953734887e21e0 100644 --- a/src/OpenFOAM/primitives/quaternion/quaternion.H +++ b/src/OpenFOAM/primitives/quaternion/quaternion.H @@ -106,6 +106,15 @@ public: // and angle theta inline quaternion(const vector& d, const scalar theta); + //- Construct a rotation quaternion given the direction d + // and cosine angle cosTheta and a if d is normalized + inline quaternion + ( + const vector& d, + const scalar cosTheta, + const bool normalized + ); + //- Construct given scalar part, the vector part = vector::zero inline explicit quaternion(const scalar w); @@ -209,6 +218,14 @@ inline quaternion inv(const quaternion& q); //- Return a string representation of a quaternion word name(const quaternion&); +//- Spherical linear interpolation of quaternions +quaternion slerp +( + const quaternion& qa, + const quaternion& qb, + const scalar t +); + //- Data associated with quaternion type are contiguous template<> inline bool contiguous<quaternion>() {return true;} diff --git a/src/OpenFOAM/primitives/quaternion/quaternionI.H b/src/OpenFOAM/primitives/quaternion/quaternionI.H index 709ee52b6d9ac7ddcdad5cf6a82f2d2ed65fd082..1582f5c7337abc70d46777dc0241b0614ed94606 100644 --- a/src/OpenFOAM/primitives/quaternion/quaternionI.H +++ b/src/OpenFOAM/primitives/quaternion/quaternionI.H @@ -40,6 +40,26 @@ inline Foam::quaternion::quaternion(const vector& d, const scalar theta) v_((sin(0.5*theta)/mag(d))*d) {} +inline Foam::quaternion::quaternion +( + const vector& d, + const scalar cosTheta, + const bool normalized +) +{ + scalar cosHalfTheta2 = 0.5*(cosTheta + 1); + w_ = sqrt(cosHalfTheta2); + + if (normalized) + { + v_ = sqrt(1 - cosHalfTheta2)*d; + } + else + { + v_ = (sqrt(1 - cosHalfTheta2)/mag(d))*d; + } +} + inline Foam::quaternion::quaternion(const scalar w) : w_(w), @@ -69,9 +89,10 @@ inline Foam::quaternion::quaternion const tensor& rotationTensor ) { - scalar trace = rotationTensor.xx() - + rotationTensor.yy() - + rotationTensor.zz(); + scalar trace = + rotationTensor.xx() + + rotationTensor.yy() + + rotationTensor.zz(); if (trace > 0) { diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C index 475430bd83e4eed47cc5e86b9ee7befafcd338a9..97b84a6049f5a51924769e9b25162e41a45056b4 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C @@ -216,7 +216,7 @@ Foam::scalar Foam::LiquidEvaporation<CloudType>::dh } case (parent::etEnthalpyDifference): { - scalar hc = this->owner().composition().carrier().Hs(idc, p, T); + scalar hc = this->owner().composition().carrier().Ha(idc, p, T); scalar hp = liquids_.properties()[idl].h(p, T); dh = hc - hp; diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C index 32821f896620cdfdbdf1dda5b53cac365ba9b293..803b849fa43d9da8a5a766541eeb3ffade6e8855 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C @@ -171,8 +171,8 @@ void Foam::LiquidEvaporationBoil<CloudType>::calculate forAll(this->owner().thermo().carrier().Y(), i) { scalar Yc = this->owner().thermo().carrier().Y()[i][cellI]; - Hc += Yc*this->owner().thermo().carrier().Hs(i, pc, Tc); - Hsc += Yc*this->owner().thermo().carrier().Hs(i, ps, Ts); + Hc += Yc*this->owner().thermo().carrier().Ha(i, pc, Tc); + Hsc += Yc*this->owner().thermo().carrier().Ha(i, ps, Ts); Cpc += Yc*this->owner().thermo().carrier().Cp(i, ps, Ts); kappac += Yc*this->owner().thermo().carrier().kappa(i, ps, Ts); } @@ -315,7 +315,7 @@ Foam::scalar Foam::LiquidEvaporationBoil<CloudType>::dh } case (parent::etEnthalpyDifference): { - scalar hc = this->owner().composition().carrier().Hs(idc, p, TDash); + scalar hc = this->owner().composition().carrier().Ha(idc, p, TDash); scalar hp = liquids_.properties()[idl].h(p, TDash); dh = hc - hp; diff --git a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C index bb09e15803f2f21523c91e773c63da8a4d394905..248bbed9fe36d8e1e832ddd28c5b19f9a13731fb 100644 --- a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C +++ b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C @@ -65,8 +65,8 @@ makeBasicMixture ( pureMixture, constTransport, - sensibleInternalEnergy, - eConstThermo, + sensibleEnthalpy, + hConstThermo, perfectGas ); @@ -74,8 +74,17 @@ makeBasicMixture ( pureMixture, sutherlandTransport, - sensibleInternalEnergy, - eConstThermo, + sensibleEnthalpy, + hConstThermo, + perfectGas +); + +makeBasicMixture +( + pureMixture, + sutherlandTransport, + sensibleEnthalpy, + janafThermo, perfectGas ); @@ -83,34 +92,61 @@ makeBasicMixture ( pureMixture, constTransport, - sensibleInternalEnergy, + sensibleEnthalpy, hConstThermo, - perfectGas + incompressible +); + +makeBasicPolyMixture +( + pureMixture, + 3, + sensibleEnthalpy +); + +makeBasicPolyMixture +( + pureMixture, + 8, + sensibleEnthalpy +); + + +makeBasicMixture +( + pureMixture, + constTransport, + sensibleEnthalpy, + hConstThermo, + isobaricPerfectGas ); makeBasicMixture ( pureMixture, sutherlandTransport, - sensibleInternalEnergy, + sensibleEnthalpy, hConstThermo, - perfectGas + isobaricPerfectGas ); makeBasicMixture ( pureMixture, sutherlandTransport, - sensibleInternalEnergy, + sensibleEnthalpy, janafThermo, - perfectGas + isobaricPerfectGas ); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + makeBasicMixture ( pureMixture, constTransport, - sensibleEnthalpy, + sensibleInternalEnergy, hConstThermo, perfectGas ); @@ -119,7 +155,7 @@ makeBasicMixture ( pureMixture, sutherlandTransport, - sensibleEnthalpy, + sensibleInternalEnergy, hConstThermo, perfectGas ); @@ -128,7 +164,7 @@ makeBasicMixture ( pureMixture, sutherlandTransport, - sensibleEnthalpy, + sensibleInternalEnergy, janafThermo, perfectGas ); @@ -137,7 +173,7 @@ makeBasicMixture ( pureMixture, constTransport, - sensibleEnthalpy, + sensibleInternalEnergy, hConstThermo, incompressible ); @@ -146,14 +182,14 @@ makeBasicPolyMixture ( pureMixture, 3, - sensibleEnthalpy + sensibleInternalEnergy ); makeBasicPolyMixture ( pureMixture, 8, - sensibleEnthalpy + sensibleInternalEnergy ); @@ -161,7 +197,7 @@ makeBasicMixture ( pureMixture, constTransport, - sensibleEnthalpy, + sensibleInternalEnergy, hConstThermo, isobaricPerfectGas ); @@ -170,7 +206,7 @@ makeBasicMixture ( pureMixture, sutherlandTransport, - sensibleEnthalpy, + sensibleInternalEnergy, hConstThermo, isobaricPerfectGas ); @@ -179,7 +215,7 @@ makeBasicMixture ( pureMixture, sutherlandTransport, - sensibleEnthalpy, + sensibleInternalEnergy, janafThermo, isobaricPerfectGas ); diff --git a/src/thermophysicalModels/basic/psiThermo/hePsiThermo/hePsiThermos.C b/src/thermophysicalModels/basic/psiThermo/hePsiThermo/hePsiThermos.C index b5a48fc315479656918a4a463f52a721a69e4e08..56baf3fa0bea99de957b70977791e37d3d17172a 100644 --- a/src/thermophysicalModels/basic/psiThermo/hePsiThermo/hePsiThermos.C +++ b/src/thermophysicalModels/basic/psiThermo/hePsiThermo/hePsiThermos.C @@ -84,27 +84,27 @@ makeThermo /* * * * * * * * * * * * * * Internal-energy-based * * * * * * * * * * * * * */ -makeThermo -( - psiThermo, - hePsiThermo, - pureMixture, - constTransport, - sensibleInternalEnergy, - eConstThermo, - perfectGas -); - -makeThermo -( - psiThermo, - hePsiThermo, - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - eConstThermo, - perfectGas -); +// makeThermo +// ( +// psiThermo, +// hePsiThermo, +// pureMixture, +// constTransport, +// sensibleInternalEnergy, +// eConstThermo, +// perfectGas +// ); + +// makeThermo +// ( +// psiThermo, +// hePsiThermo, +// pureMixture, +// sutherlandTransport, +// sensibleInternalEnergy, +// eConstThermo, +// perfectGas +// ); makeThermo ( diff --git a/src/thermophysicalModels/basic/rhoThermo/heRhoThermo/heRhoThermos.C b/src/thermophysicalModels/basic/rhoThermo/heRhoThermo/heRhoThermos.C index c4045c70db2a02915f13f80e35acddad84fac928..e9272e97b84c679fb5d083409620530d2c4b0474 100644 --- a/src/thermophysicalModels/basic/rhoThermo/heRhoThermo/heRhoThermos.C +++ b/src/thermophysicalModels/basic/rhoThermo/heRhoThermo/heRhoThermos.C @@ -149,6 +149,104 @@ makeThermo ); +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeThermo +( + rhoThermo, + heRhoThermo, + pureMixture, + constTransport, + sensibleInternalEnergy, + hConstThermo, + perfectGas +); + +makeThermo +( + rhoThermo, + heRhoThermo, + pureMixture, + sutherlandTransport, + sensibleInternalEnergy, + hConstThermo, + perfectGas +); + +makeThermo +( + rhoThermo, + heRhoThermo, + pureMixture, + sutherlandTransport, + sensibleInternalEnergy, + janafThermo, + perfectGas +); + +makeThermo +( + rhoThermo, + heRhoThermo, + pureMixture, + constTransport, + sensibleInternalEnergy, + hConstThermo, + incompressible +); + +makePolyThermo +( + rhoThermo, + heRhoThermo, + pureMixture, + 3, + sensibleInternalEnergy +); + +makePolyThermo +( + rhoThermo, + heRhoThermo, + pureMixture, + 8, + sensibleInternalEnergy +); + +makeThermo +( + rhoThermo, + heRhoThermo, + pureMixture, + constTransport, + sensibleInternalEnergy, + hConstThermo, + isobaricPerfectGas +); + +makeThermo +( + rhoThermo, + heRhoThermo, + pureMixture, + sutherlandTransport, + sensibleInternalEnergy, + hConstThermo, + isobaricPerfectGas +); + +makeThermo +( + rhoThermo, + heRhoThermo, + pureMixture, + sutherlandTransport, + sensibleInternalEnergy, + janafThermo, + isobaricPerfectGas +); + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C b/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C index 152c075bfef99d5a99a95d45c791fc6bebf90d37..47cfe67dcd489b6e6dfe4177b3cd45b77ae840ed 100644 --- a/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C +++ b/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.C @@ -64,7 +64,7 @@ Foam::porousMedia::fixedTemperature::~fixedTemperature() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::porousMedia::fixedTemperature::addEnthalpySource +void Foam::porousMedia::fixedTemperature::addEnergySource ( const basicThermo& thermo, const volScalarField& rho, diff --git a/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.H b/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.H index a09e9eae89d2d9e28244f09911177b300d5a1045..b8932dd2e496ee08dab06d01b760edd915e390d8 100644 --- a/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.H +++ b/src/thermophysicalModels/thermalPorousZone/thermalModel/fixedTemperature/fixedTemperature.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,7 +78,7 @@ public: // Member Functions //- Add the thermal source to the enthalpy equation - virtual void addEnthalpySource + virtual void addEnergySource ( const basicThermo&, const volScalarField& rho, @@ -100,4 +100,3 @@ public: #endif // ************************************************************************* // - diff --git a/src/thermophysicalModels/thermalPorousZone/thermalModel/noThermalModel/noThermalModel.C b/src/thermophysicalModels/thermalPorousZone/thermalModel/noThermalModel/noThermalModel.C index 3f172395cfc8dceb4efb60d4b8dff8baf63d5b1e..7a5a1be53e3594ddf7ad00e333a35f6dcc0833a0 100644 --- a/src/thermophysicalModels/thermalPorousZone/thermalModel/noThermalModel/noThermalModel.C +++ b/src/thermophysicalModels/thermalPorousZone/thermalModel/noThermalModel/noThermalModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -63,7 +63,7 @@ Foam::porousMedia::noThermalModel::~noThermalModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::porousMedia::noThermalModel::addEnthalpySource +void Foam::porousMedia::noThermalModel::addEnergySource ( const basicThermo&, const volScalarField&, diff --git a/src/thermophysicalModels/thermalPorousZone/thermalModel/noThermalModel/noThermalModel.H b/src/thermophysicalModels/thermalPorousZone/thermalModel/noThermalModel/noThermalModel.H index 5fec230046126456592f03b9fa3a0e1ae4c58a40..bad8b4dae011c969b7a4aa29c2d56f8344b0f709 100644 --- a/src/thermophysicalModels/thermalPorousZone/thermalModel/noThermalModel/noThermalModel.H +++ b/src/thermophysicalModels/thermalPorousZone/thermalModel/noThermalModel/noThermalModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,7 +70,7 @@ public: // Member Functions //- Add the thermal source to the enthalpy equation - virtual void addEnthalpySource + virtual void addEnergySource ( const basicThermo&, const volScalarField& rho, @@ -92,4 +92,3 @@ public: #endif // ************************************************************************* // - diff --git a/src/thermophysicalModels/thermalPorousZone/thermalModel/thermalModel/thermalModel.H b/src/thermophysicalModels/thermalPorousZone/thermalModel/thermalModel/thermalModel.H index b4ededc4522f10b56cf928dd8979ab7aaf864cab..35d2965a7a3120a952645f2b816aabdfffc3922c 100644 --- a/src/thermophysicalModels/thermalPorousZone/thermalModel/thermalModel/thermalModel.H +++ b/src/thermophysicalModels/thermalPorousZone/thermalModel/thermalModel/thermalModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,7 +105,7 @@ public: // Member Functions //- Add the thermal source to the enthalpy equation - virtual void addEnthalpySource + virtual void addEnergySource ( const basicThermo&, const volScalarField& rho, @@ -127,4 +127,3 @@ public: #endif // ************************************************************************* // - diff --git a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.C b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.C index 79bdea0b4ca3be87f15fadf3d470311a7eb715bc..befa29b013c5daf7ef22884483ef0abcded23b5a 100644 --- a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.C +++ b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,7 +44,7 @@ Foam::thermalPorousZone::thermalPorousZone // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::thermalPorousZone::addEnthalpySource +void Foam::thermalPorousZone::addEnergySource ( const basicThermo& thermo, const volScalarField& rho, @@ -53,7 +53,7 @@ void Foam::thermalPorousZone::addEnthalpySource { if (model_.valid()) { - model_->addEnthalpySource(thermo, rho, hEqn); + model_->addEnergySource(thermo, rho, hEqn); } } diff --git a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.H b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.H index 1ebf6d0f7d587ec2da4039a930eb1e30e199c808..4356f87cdfc8bb29ab69261b950f278fe4c811a2 100644 --- a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.H +++ b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -125,7 +125,7 @@ public: // Member Functions //- Add the thermal source to the enthalpy equation - void addEnthalpySource + void addEnergySource ( const basicThermo&, const volScalarField& rho, diff --git a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.C b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.C index cb7d1f5902c247d0556eb37cddd54a777f5573bb..1e0da4b7a6f3b70418c2f4e5f4f6b74fc37000a5 100644 --- a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.C +++ b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,7 +46,7 @@ Foam::thermalPorousZones::thermalPorousZones // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::thermalPorousZones::addEnthalpySource +void Foam::thermalPorousZones::addEnergySource ( const basicThermo& thermo, const volScalarField& rho, @@ -55,7 +55,7 @@ void Foam::thermalPorousZones::addEnthalpySource { forAll(*this, i) { - operator[](i).addEnthalpySource(thermo, rho, hEqn); + operator[](i).addEnergySource(thermo, rho, hEqn); } } diff --git a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.H b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.H index dacd4458303d31915d28f30157722dcffc25ac63..d30a38b29937ca5b6f6517cdf0aa3d56442ff74e 100644 --- a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.H +++ b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -93,7 +93,7 @@ public: // Member Functions //- Add the thermal source to the enthalpy equation - void addEnthalpySource + void addEnergySource ( const basicThermo&, const volScalarField& rho, diff --git a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.H b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.H index aa00969499aacb503e55d1c7cdedf6cd06f8bb63..0b463fb5c997439ebc7bc3ea51088ee34c050863 100644 --- a/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.H +++ b/src/turbulenceModels/compressible/LES/oneEqEddy/oneEqEddy.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,14 +25,14 @@ Class Foam::compressible::LESModels::oneEqEddy Description - One Equation Eddy Viscosity Model for incompressible flows + One Equation Eddy Viscosity Model for compressible flows Eddy viscosity SGS model using a modeled balance equation to simulate the behaviour of k, hence, \verbatim d/dt(rho*k) + div(rho*U*k) - div(muEff*grad(k)) = - -rho*D:B - ce*rho*k^3/2/delta + -rho*D:B - ce*rho*k^(3/2)/delta and @@ -41,10 +41,11 @@ Description where D = symm(grad(U)); - muSgs = ck*rho*sqrt(k)*delta + nuSgs = ck*sqrt(k)*delta + muSgs = rho*nuSgs + muEff = muSgs + mu \endverbatim - SourceFiles oneEqEddy.C diff --git a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C index 45b2ec34fe390290595f84dcc76829474ecb7028..5e6890d016c39d8877241dba11a5076c4947af79 100644 --- a/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C +++ b/src/turbulenceModels/incompressible/LES/kOmegaSSTSAS/kOmegaSSTSAS.C @@ -353,7 +353,7 @@ void kOmegaSSTSAS::correct(const tmp<volTensorField>& gradU) volScalarField L(sqrt(k_)/(pow025(Cmu_)*omega_)); volScalarField CDkOmega((2.0*alphaOmega2_)*(gradK & gradOmega)/omega_); volScalarField F1(this->F1(CDkOmega)); - volScalarField G(nuSgs_*0.5*S2); + volScalarField G(nuSgs_*S2); // Turbulent kinetic energy equation { diff --git a/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.H b/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.H index 0f040d829a3cdc7164a7ec8600fa016cc79892ee..143329c8c62a37131450b3c9f6f76ed9f1a35540 100644 --- a/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.H +++ b/src/turbulenceModels/incompressible/LES/oneEqEddy/oneEqEddy.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,7 +32,7 @@ Description \verbatim d/dt(k) + div(U*k) - div(nuEff*grad(k)) = - -B*L - ce*k^3/2/delta + -D:B - ce*k^(3/2)/delta and diff --git a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/system/controlDict b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/system/controlDict index 70776c56ae29f69e23e986d46fe0ae450b340296..8ead0df1cea37ddf76fca610d51b4d84f91e2fc9 100644 --- a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/system/controlDict +++ b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/system/controlDict @@ -45,7 +45,7 @@ timePrecision 6; adjustTimeStep yes; -maxCo 0.4; +maxCo 0.3; maxDeltaT 1; diff --git a/tutorials/multiphase/interFoam/ras/Allclean b/tutorials/multiphase/interFoam/ras/Allclean index bd5bed38568db41b9be00630aa8024cadc663f68..63a607fe3ff4fb453f418822baa3668ffb9142f8 100755 --- a/tutorials/multiphase/interFoam/ras/Allclean +++ b/tutorials/multiphase/interFoam/ras/Allclean @@ -4,7 +4,7 @@ cd ${0%/*} || exit 1 # run from this directory # Source tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions -keepCases="damBreak damBreakPorousBaffle weirOverflow" +keepCases="damBreak damBreakPorousBaffle weirOverflow waterChannel" loseCases="damBreakFine" for case in $keepCases diff --git a/tutorials/multiphase/interFoam/ras/Allrun b/tutorials/multiphase/interFoam/ras/Allrun index 85cfa0fbfb1355189d2c6c23ae7fec241045daa2..f130490987bcf628f17a315903240224eca57679 100755 --- a/tutorials/multiphase/interFoam/ras/Allrun +++ b/tutorials/multiphase/interFoam/ras/Allrun @@ -52,4 +52,7 @@ cloneCase damBreak damBreakFine # Do weirOverflow (cd weirOverflow && foamRunTutorials) +# Do waterChannel +(cd waterChannel && foamRunTutorials) + # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/0/U b/tutorials/multiphase/interFoam/ras/waterChannel/0/U new file mode 100644 index 0000000000000000000000000000000000000000..526fadc34444c886d69c5e2bf11feaa56f9ff8bf --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/0/U @@ -0,0 +1,51 @@ +/*--------------------------------*- 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 volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (2 0 0); + +boundaryField +{ + inlet + { + type flowRateInletVelocity; + flowRate constant 50; + value uniform (0 0 0); + } + + walls + { + type fixedValue; + value uniform (0 0 0); + } + + atmosphere + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } + + outlet + { + type inletOutlet; + inletValue uniform (0 0 0); + value $internalField; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/0/alpha1.org b/tutorials/multiphase/interFoam/ras/waterChannel/0/alpha1.org new file mode 100644 index 0000000000000000000000000000000000000000..914cb9ee1a0007ac0f19318ff30d93baeb6f8e75 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/0/alpha1.org @@ -0,0 +1,48 @@ +/*--------------------------------*- 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 volScalarField; + object alpha; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 1; + } + + walls + { + type zeroGradient; + } + + outlet + { + type zeroGradient; + value uniform 0; + } + + atmosphere + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/0/k b/tutorials/multiphase/interFoam/ras/waterChannel/0/k new file mode 100644 index 0000000000000000000000000000000000000000..8025412250e1f59dcbd8d0543461243a3127eeb1 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/0/k @@ -0,0 +1,44 @@ +/*--------------------------------*- 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 volScalarField; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.0001; + +boundaryField +{ + inlet + { + type fixedValue; + intensity 0.05; + value $internalField; + } + + walls + { + type kqRWallFunction; + value $internalField; + } + + ".*" + { + type inletOutlet; + inletValue $internalField; + value $internalField ; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/0/nut b/tutorials/multiphase/interFoam/ras/waterChannel/0/nut new file mode 100644 index 0000000000000000000000000000000000000000..2498d72cf1fe627bd7b381fb3f206ddd13356d0f --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/0/nut @@ -0,0 +1,38 @@ +/*--------------------------------*- 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 volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + walls + { + type nutkWallFunction; + value uniform 0; + } + + ".*" + { + type calculated; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/0/omega b/tutorials/multiphase/interFoam/ras/waterChannel/0/omega new file mode 100644 index 0000000000000000000000000000000000000000..1db5db7122cf25b3da157e3c507151581ced69a9 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/0/omega @@ -0,0 +1,43 @@ +/*--------------------------------*- 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 volScalarField; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 -1 0 0 0 0]; + +internalField uniform 0.003; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + + walls + { + type omegaWallFunction; + value $internalField; + } + + ".*" + { + type inletOutlet; + inletValue $internalField; + value $internalField; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/0/p_rgh b/tutorials/multiphase/interFoam/ras/waterChannel/0/p_rgh new file mode 100644 index 0000000000000000000000000000000000000000..d30fb854876908815e5272d4b9383431b9a65684 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/0/p_rgh @@ -0,0 +1,42 @@ +/*--------------------------------*- 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 volScalarField; + object p_rgh; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + atmosphere + { + type totalPressure; + p0 uniform 0; + U U; + phi phi; + rho rho; + psi none; + gamma 1; + value uniform 0; + } + + ".*" + { + type buoyantPressure; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/Allclean b/tutorials/multiphase/interFoam/ras/waterChannel/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..0c04649fe1b38c22a88d63a4fb65f147166cbaa9 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/Allclean @@ -0,0 +1,10 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +rm 0/alpha1.gz 0/alpha1 2>/dev/null +rm -rf *Flux + +cleanCase diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/Allrun b/tutorials/multiphase/interFoam/ras/waterChannel/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..813ad03d7930c652bd4f8f760ded0e305561c2bb --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/Allrun @@ -0,0 +1,25 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +application=`getApplication` + +runApplication blockMesh + +echo "Creating channel" +i=1 +while [ "$i" -lt 3 ] ; do + cp system/extrudeMeshDict.${i} system/extrudeMeshDict + echo "Running extrudeMesh, instance" ${i} + extrudeMesh > log.extrudeMesh.${i} + i=`expr $i + 1` +done + +cp 0/alpha1.org 0/alpha1 +runApplication setFields + +runApplication $application + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/controlDict b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..64eae52fe0c8adca928d5ac57ed83e84597d78ff --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/controlDict @@ -0,0 +1,86 @@ +/*--------------------------------*- 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 dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application LTSInterFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 5000; + +deltaT 1; + +writeControl timeStep; + +writeInterval 200; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression compressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; +maxCo 0.5; +maxAlphaCo 0.5; +maxDeltaT 1; + +functions +{ + inletFlux + { + type faceSource; + functionObjectLibs ("libfieldFunctionObjects.so"); + outputControl timeStep; + log true; + // Output field values as well + valueOutput false; + source patch; + sourceName inlet; + operation sum; + + fields + ( + rho*phi + ); + } + + outletFlux + { + $inletFlux; + sourceName outlet; + } + + atmosphereFlux + { + $inletFlux; + sourceName atmosphere; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSchemes b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..22366f437b7bcaa5224b1effab5efdaeb66d0ba5 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSchemes @@ -0,0 +1,61 @@ +/*--------------------------------*- 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 dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default localEuler rDeltaT; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + div(rho*phi,U) Gauss linearUpwind grad(U); + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss interfaceCompression; + div(phi,k) Gauss upwind; + div(phi,omega) Gauss upwind; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p_rgh; + pcorr; + alpha1; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSolution b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..7a6ad628f6c69e159b6b4997898f85cf4de756c2 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/fvSolution @@ -0,0 +1,106 @@ +/*--------------------------------*- 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 dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + pcorr + { + solver PCG; + preconditioner + { + preconditioner GAMG; + tolerance 1e-05; + relTol 0; + smoother DICGaussSeidel; + nPreSweeps 0; + nPostSweeps 2; + nFinestSweeps 2; + cacheAgglomeration false; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + tolerance 1e-05; + relTol 0; + maxIter 100; + } + +/* pcorr + { + solver PCG; + preconditioner DIC; + tolerance 1e-10; + relTol 0; + }; +*/ + p_rgh + { + $pcorr; + tolerance 1e-6; + relTol 0.01; + }; + + p_rghFinal + { + $p_rgh; + tolerance 1e-6; + relTol 0; + } + + "(U|k|omega).*" + { + solver smoothSolver; + + smoother GaussSeidel; + nSweeps 1; + + tolerance 1e-7; + relTol 0.1; + }; +} + +PIMPLE +{ + momentumPredictor no; + nCorrectors 2; + nNonOrthogonalCorrectors 0; + + nAlphaCorr 1; + nAlphaSubCycles 3; + cAlpha 1; + + maxCo 0.5; + maxAlphaCo 0.2; + nAlphaSweepIter 1; + + rDeltaTSmoothingCoeff 0.1; + rDeltaTDampingCoeff 1; + maxDeltaT 100; +} + +relaxationFactors +{ + fields + { + } + equations + { + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/setFieldsDict b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/setFieldsDict new file mode 100644 index 0000000000000000000000000000000000000000..468fd9778bab7aad0f7f082dfc8b49868749ffe6 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/LTSInterFoam/system/setFieldsDict @@ -0,0 +1,45 @@ +/*--------------------------------*- 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 dictionary; + location "system"; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue alpha1 0 +); + +regions +( + boxToCell + { + box (0 0 0) (50 130 27); + fieldValues + ( + volScalarFieldValue alpha1 1 + ); + } + + boxToFace + { + box (0 0 0) (50 10.0001 24); + fieldValues + ( + volScalarFieldValue alpha1 1 + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/README b/tutorials/multiphase/interFoam/ras/waterChannel/README new file mode 100644 index 0000000000000000000000000000000000000000..965538a764ce59b3a28740db8368d6b0938528cd --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/README @@ -0,0 +1,6 @@ +- This case uses blockMesh and extrudeMesh to create a channel geometry. + - See Allrun script to generate geometry. +- The case is set up to run with interFoam. +- For running with LTSInterFoam, an alternative set of main files from + system directory (controlDict, etc) are included in LTSInterFoam + subdirectory to replace the existing files set up for interFoam. \ No newline at end of file diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/constant/RASProperties b/tutorials/multiphase/interFoam/ras/waterChannel/constant/RASProperties new file mode 100644 index 0000000000000000000000000000000000000000..e0e6b776a2718fb18c8fb279b523831255e7b3b3 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/constant/RASProperties @@ -0,0 +1,25 @@ +/*--------------------------------*- 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 dictionary; + location "constant"; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kOmegaSST; + +turbulence on; + +printCoeffs on; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/constant/g b/tutorials/multiphase/interFoam/ras/waterChannel/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..a0d7102656fb1a552f8a774ef0ae0e1807a3024f --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/constant/g @@ -0,0 +1,21 @@ +/*--------------------------------*- 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; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value (0 0 -9.81); + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interFoam/ras/waterChannel/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..ccbeabfc9869a9b7aefa61e81887b70b91681381 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/constant/polyMesh/blockMeshDict @@ -0,0 +1,101 @@ +/*--------------------------------*- 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 dictionary; + object blockMeshDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + ( 0 -10 2) // 0 + (20 -10 2) // 1 + ( 0 -3 2) // 2 + (20 -3 2) // 3 + ( 0 3 2) // 4 + (20 3 2) // 5 + ( 0 10 2) // 6 + (20 10 2) // 7 + + ( 0 -10 8) // 8 + (20 -10 8) // 9 + ( 0 -4 8) // 10 + (20 -4 8) // 11 + ( 0 4 8) // 12 + (20 4 8) // 13 + ( 0 10 8) // 14 + (20 10 8) // 15 +); + +blocks +( + hex (0 1 3 2 8 9 11 10) (20 5 20) simpleGrading (1 1 1) + hex (2 3 5 4 10 11 13 12) (20 10 20) simpleGrading (1 1 1) + hex (4 5 7 6 12 13 15 14) (20 5 20) simpleGrading (1 1 1) +); + +edges +( +); + +boundary +( + inlet + { + type patch; + faces + ( + (0 1 3 2) + (4 5 7 6) + ); + } + + walls + { + type wall; + faces + ( + (2 3 5 4) + (0 1 9 8) + (0 2 10 8) + (1 3 11 9) + (2 4 12 10) + (5 7 15 13) + (6 7 15 14) + (4 6 14 12) + ); + } + + outlet + { + type patch; + faces + ( + (3 5 13 11) + ); + } + + atmosphere + { + type patch; + faces + ( + (8 9 11 10) + (10 11 13 12) + (12 13 15 14) + ); + } +); + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/constant/polyMesh/boundary b/tutorials/multiphase/interFoam/ras/waterChannel/constant/polyMesh/boundary new file mode 100644 index 0000000000000000000000000000000000000000..eed322680a7bfc5e8c752e6eca20226367283966 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/constant/polyMesh/boundary @@ -0,0 +1,46 @@ +/*--------------------------------*- 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; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +4 +( + inlet + { + type patch; + nFaces 200; + startFace 79800; + } + walls + { + type wall; + nFaces 6600; + startFace 80000; + } + outlet + { + type patch; + nFaces 200; + startFace 86600; + } + atmosphere + { + type patch; + nFaces 1400; + startFace 86800; + } +) + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/constant/transportProperties b/tutorials/multiphase/interFoam/ras/waterChannel/constant/transportProperties new file mode 100644 index 0000000000000000000000000000000000000000..c90677dd56faefb3a99142061a847481f36e2c00 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/constant/transportProperties @@ -0,0 +1,35 @@ +/*--------------------------------*- 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 dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +phase1 +{ + transportModel Newtonian; + nu nu [ 0 2 -1 0 0 0 0 ] 1e-06; + rho rho [ 1 -3 0 0 0 0 0 ] 1000; +} + +phase2 +{ + transportModel Newtonian; + nu nu [ 0 2 -1 0 0 0 0 ] 1.48e-05; + rho rho [ 1 -3 0 0 0 0 0 ] 1; +} + +sigma sigma [ 1 0 -2 0 0 0 0 ] 0.07; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/constant/turbulenceProperties b/tutorials/multiphase/interFoam/ras/waterChannel/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..3721a46a2ead37eb2bf10434bcde59afa9fe9bf6 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- 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 dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/system/controlDict b/tutorials/multiphase/interFoam/ras/waterChannel/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..be315b40aceac6e99721857ec3b1f36b0585c46d --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/system/controlDict @@ -0,0 +1,86 @@ +/*--------------------------------*- 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 dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application interFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 100; + +deltaT 0.01; + +writeControl adjustableRunTime; + +writeInterval 5; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression compressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; +maxCo 0.5; +maxAlphaCo 0.5; +maxDeltaT 1; + +functions +{ + inletFlux + { + type faceSource; + functionObjectLibs ("libfieldFunctionObjects.so"); + outputControl timeStep; + log true; + // Output field values as well + valueOutput false; + source patch; + sourceName inlet; + operation sum; + + fields + ( + rho*phi + ); + } + + outletFlux + { + $inletFlux; + sourceName outlet; + } + + atmosphereFlux + { + $inletFlux; + sourceName atmosphere; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict b/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..ffa39b334a4e13be9d407933f7e6b4d616b483d5 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict @@ -0,0 +1,37 @@ +/*--------------------------------*- 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 dictionary; + object extrudeProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +constructFrom mesh; +sourceCase "$FOAM_CASE"; +sourcePatches (outlet); + +flipNormals false; + +extrudeModel linearDirection; + +nLayers 40; +expansionRatio 1.0; + +linearDirectionCoeffs +{ + axisPt (0 0 0); + direction (1 -0.2 -0.02); + thickness 40; +} + +mergeFaces false; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict.1 b/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict.1 new file mode 100644 index 0000000000000000000000000000000000000000..8204a892dd8ca3fa910a5da45d068e35d04b6e47 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict.1 @@ -0,0 +1,37 @@ +/*--------------------------------*- 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 dictionary; + object extrudeProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +constructFrom mesh; +sourceCase "$FOAM_CASE"; +sourcePatches (outlet); + +flipNormals false; + +extrudeModel linearDirection; + +nLayers 60; +expansionRatio 1.0; + +linearDirectionCoeffs +{ + axisPt (0 0 0); + direction (1 0.2 -0.02); + thickness 60; +} + +mergeFaces false; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict.2 b/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict.2 new file mode 100644 index 0000000000000000000000000000000000000000..ffa39b334a4e13be9d407933f7e6b4d616b483d5 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/system/extrudeMeshDict.2 @@ -0,0 +1,37 @@ +/*--------------------------------*- 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 dictionary; + object extrudeProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +constructFrom mesh; +sourceCase "$FOAM_CASE"; +sourcePatches (outlet); + +flipNormals false; + +extrudeModel linearDirection; + +nLayers 40; +expansionRatio 1.0; + +linearDirectionCoeffs +{ + axisPt (0 0 0); + direction (1 -0.2 -0.02); + thickness 40; +} + +mergeFaces false; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSchemes b/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..43847dd8414adf639354202fa7159ef5620866ee --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSchemes @@ -0,0 +1,62 @@ +/*--------------------------------*- 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 dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + div(rho*phi,U) Gauss linearUpwind grad(U); + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss interfaceCompression; + + div(phi,k) Gauss upwind; + div(phi,omega) $div(phi,k); +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p_rgh; + pcorr; + alpha1; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSolution b/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..8b86c656c8faba7ef608611e75efa34a06d04365 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/system/fvSolution @@ -0,0 +1,88 @@ +/*--------------------------------*- 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 dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + pcorr + { + solver PCG; + preconditioner + { + preconditioner GAMG; + tolerance 1e-05; + relTol 0; + smoother DICGaussSeidel; + nPreSweeps 0; + nPostSweeps 2; + nFinestSweeps 2; + cacheAgglomeration false; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + tolerance 1e-10; + relTol 0; + maxIter 100; + } + + p_rgh + { + $pcorr; + tolerance 1e-6; + relTol 0.01; + }; + + p_rghFinal + { + $p_rgh; + tolerance 1e-6; + relTol 0; + } + + "(U|k|omega).*" + { + solver smoothSolver; + smoother GaussSeidel; + nSweeps 1; + tolerance 1e-7; + relTol 0.1; + }; +} + +PIMPLE +{ + momentumPredictor no; + nCorrectors 2; + nNonOrthogonalCorrectors 0; + + nAlphaCorr 1; + nAlphaSubCycles 3; + cAlpha 1; +} + +relaxationFactors +{ + fields + { + } + equations + { + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/waterChannel/system/setFieldsDict b/tutorials/multiphase/interFoam/ras/waterChannel/system/setFieldsDict new file mode 100644 index 0000000000000000000000000000000000000000..f4f1c444762ef3cf54207ef2f8630408f861e1d3 --- /dev/null +++ b/tutorials/multiphase/interFoam/ras/waterChannel/system/setFieldsDict @@ -0,0 +1,36 @@ +/*--------------------------------*- 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 dictionary; + location "system"; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue alpha1 0 +); + +regions +( + boxToCell + { + box (-10 -20 -10) (200 20 4); + fieldValues + ( + volScalarFieldValue alpha1 1 + ); + } +); + + +// ************************************************************************* //