diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C index 063aaa4fb58dcfb1803a87c05e25d7f04cb9d8ed..84a122d0ddc44b8ca73ea4ec0034ac7c1bd83438 100644 --- a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C +++ b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C @@ -228,13 +228,10 @@ int main(int argc, char *argv[]) if (!inviscid) { - volScalarField k("k", thermo.Cp()*muEff/Pr); solve ( fvm::ddt(rho, e) - fvc::ddt(rho, e) - fvm::laplacian(turbulence->alphaEff(), e) - + fvc::laplacian(turbulence->alpha(), e) - - fvc::laplacian(k, T) ); thermo.correct(); rhoE = rho*(e + 0.5*magSqr(U)); diff --git a/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H index 2d70a5bab5932cb23837cdd0138fad6e9e81d28f..be34ab52ed0638ee53e17931059e32e0b0159389 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H +++ b/applications/solvers/multiphase/compressibleInterFoam/alphaEqnsSubCycle.H @@ -6,7 +6,7 @@ surfaceScalarField phic(mag(phi/mesh.magSf())); phic = min(interface.cAlpha()*phic, max(phic)); - volScalarField divU(fvc::div(phi)); + volScalarField divU(fvc::div(fvc::absolute(phi, U))); if (nAlphaSubCycles > 1) { @@ -29,10 +29,4 @@ { #include "alphaEqns.H" } - - // correct interface on first PIMPLE corrector - if (pimple.corr() == 1) - { - interface.correct(); - } } diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H deleted file mode 100644 index ade8af00817fe065a03aeeb70a6b32f1980a4a77..0000000000000000000000000000000000000000 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/alphaEqnsSubCycle.H +++ /dev/null @@ -1,40 +0,0 @@ -{ - label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr"))); - - label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles"))); - - surfaceScalarField phic(mag(phi/mesh.magSf())); - phic = min(interface.cAlpha()*phic, max(phic)); - - fvc::makeAbsolute(phi, U); - volScalarField divU(fvc::div(phi)); - fvc::makeRelative(phi, U); - - if (nAlphaSubCycles > 1) - { - dimensionedScalar totalDeltaT = runTime.deltaT(); - surfaceScalarField rhoPhiSum(0.0*rhoPhi); - - for - ( - subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles); - !(++alphaSubCycle).end(); - ) - { - #include "alphaEqns.H" - rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi; - } - - rhoPhi = rhoPhiSum; - } - else - { - #include "alphaEqns.H" - } - - // correct interface on first PIMPLE corrector - if (pimple.corr() == 1) - { - interface.correct(); - } -} diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C index b9f52944e84e453b1876b7afa368e516e1174d27..acf563fc8e2d4e1591a93c184eab5f40b86ee96e 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterDyMFoam/compressibleInterDyMFoam.C @@ -122,6 +122,12 @@ int main(int argc, char *argv[]) { #include "alphaEqnsSubCycle.H" + // correct interface on first PIMPLE corrector + if (pimple.corr() == 1) + { + interface.correct(); + } + solve(fvm::ddt(rho) + fvc::div(rhoPhi)); #include "UEqn.H" diff --git a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C index 7c24e05a1afbbcb4774a9934657cecb013e1ae03..54c246f203b5f5ed9083d192fa3d0013ee01af3a 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C +++ b/applications/solvers/multiphase/compressibleInterFoam/compressibleInterFoam.C @@ -80,6 +80,12 @@ int main(int argc, char *argv[]) { #include "alphaEqnsSubCycle.H" + // correct interface on first PIMPLE corrector + if (pimple.corr() == 1) + { + interface.correct(); + } + solve(fvm::ddt(rho) + fvc::div(rhoPhi)); #include "UEqn.H" diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C b/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C index 06811c219195d9a5f4f8ea22eb3e25da9a35348b..9d221b5ca93b98f9525f016ad1c07efa191d2bc3 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.C +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/LTSInterFoam.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 @@ -77,6 +77,7 @@ int main(int argc, char *argv[]) twoPhaseProperties.correct(); #include "alphaEqnSubCycle.H" + interface.correct(); turbulence->correct(); diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H index 0c2cf71e4edf3d00e5695a7be322c3f7ba423917..5f5ac824b8aacfdd77227f03bdcba07026870939 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqn.H @@ -30,8 +30,8 @@ rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2; } - Info<< "Liquid phase volume fraction = " - << alpha1.weightedAverage(mesh.V()).value() + Info<< "Phase-1 volume fraction = " + << alpha1.weightedAverage(mesh.Vsc()).value() << " Min(alpha1) = " << min(alpha1).value() << " Max(alpha1) = " << max(alpha1).value() << endl; diff --git a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H index b59b0ae5fe29d683bc325f2d9b9f4be1106dca9c..6c82f940499ea39567db1e400274832dfa354b0f 100644 --- a/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interFoam/LTSInterFoam/alphaEqnSubCycle.H @@ -1,8 +1,5 @@ -const dictionary& pimpleDict = pimple.dict(); - -label nAlphaCorr(readLabel(pimpleDict.lookup("nAlphaCorr"))); - -label nAlphaSubCycles(readLabel(pimpleDict.lookup("nAlphaSubCycles"))); +label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr"))); +label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles"))); if (nAlphaSubCycles > 1) { @@ -26,6 +23,4 @@ else #include "alphaEqn.H" } -interface.correct(); - rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; diff --git a/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C b/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C index 042a17e1f3cf7c127dc7221006ca9d4caefccd7d..5cbbc0b3abe2a8c9c0a18c40c2e8bfc96b08a19f 100644 --- a/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.C +++ b/applications/solvers/multiphase/interFoam/MRFInterFoam/MRFInterFoam.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 @@ -81,6 +81,7 @@ int main(int argc, char *argv[]) twoPhaseProperties.correct(); #include "alphaEqnSubCycle.H" + interface.correct(); #include "zonePhaseVolumes.H" // --- Pressure-velocity PIMPLE corrector loop diff --git a/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H index fa56de00bb40474dc995a83b92f6a8e2a7997894..6c82f940499ea39567db1e400274832dfa354b0f 100644 --- a/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interFoam/alphaEqnSubCycle.H @@ -23,6 +23,4 @@ else #include "alphaEqn.H" } -interface.correct(); - rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; diff --git a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C index 3d450a3917041df6158dbd163358552f415ddfc8..ee927345097f187f019731bb06933517ef6b1782 100644 --- a/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.C +++ b/applications/solvers/multiphase/interFoam/interDyMFoam/interDyMFoam.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 @@ -114,6 +114,7 @@ int main(int argc, char *argv[]) twoPhaseProperties.correct(); #include "alphaEqnSubCycle.H" + interface.correct(); // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) diff --git a/applications/solvers/multiphase/interFoam/interFoam.C b/applications/solvers/multiphase/interFoam/interFoam.C index 559916f2ce3e313f9c946b4d0e832d7a673fe5a5..69eb0964ceabe41911c0593daead4271b68a341f 100644 --- a/applications/solvers/multiphase/interFoam/interFoam.C +++ b/applications/solvers/multiphase/interFoam/interFoam.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 @@ -43,7 +43,6 @@ Description #include "interfaceProperties.H" #include "twoPhaseMixture.H" #include "turbulenceModel.H" -#include "interpolationTable.H" #include "pimpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -82,6 +81,7 @@ int main(int argc, char *argv[]) twoPhaseProperties.correct(); #include "alphaEqnSubCycle.H" + interface.correct(); // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) diff --git a/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C b/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C index 244ea75faef0e11ab52aaa6f4c40a42ef6db4004..795b7c14a1f42b47372a48fe029222e4a853f134 100644 --- a/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C +++ b/applications/solvers/multiphase/interFoam/porousInterFoam/porousInterFoam.C @@ -83,6 +83,7 @@ int main(int argc, char *argv[]) twoPhaseProperties.correct(); #include "alphaEqnSubCycle.H" + interface.correct(); // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) diff --git a/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H b/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H index d816f8acedf88815eb09aaaad7e234faf6508edf..97a09ce017d3b753ddf4a91c7dc37d06e41e46c3 100644 --- a/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H +++ b/applications/solvers/multiphase/interMixingFoam/alphaEqnsSubCycle.H @@ -24,8 +24,6 @@ else #include "alphaEqns.H" } -interface.correct(); - { volScalarField rhoNew(alpha1*rho1 + alpha2*rho2 + alpha3*rho3); diff --git a/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C b/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C index d4b1194ba11a52e523e1a1700723aeeb93ac4308..33647cd28d13ba19070dd86158ccd7f8dff2853d 100644 --- a/applications/solvers/multiphase/interMixingFoam/interMixingFoam.C +++ b/applications/solvers/multiphase/interMixingFoam/interMixingFoam.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 @@ -74,6 +74,7 @@ int main(int argc, char *argv[]) threePhaseProperties.correct(); #include "alphaEqnsSubCycle.H" + interface.correct(); #define twoPhaseProperties threePhaseProperties diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H index 6e02524e26232e3495d4cab10796cc6091231650..ad2cf243d2bae2459a62370bf468e335af8c9d04 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/alphaEqnSubCycle.H @@ -40,10 +40,5 @@ surfaceScalarField rhoPhi #include "alphaEqn.H" } - if (pimple.nCorrPIMPLE() == 1) - { - interface.correct(); - } - rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; } diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C index 5ed807bbad45965dc8b018005214b76d07bb171d..00a7976a2edae65d6b23b11d0b2b733062392876 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.C +++ b/applications/solvers/multiphase/interPhaseChangeFoam/interPhaseChangeFoam.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 @@ -82,6 +82,11 @@ int main(int argc, char *argv[]) #include "alphaEqnSubCycle.H" + if (pimple.nCorrPIMPLE() == 1) + { + interface.correct(); + } + turbulence->correct(); // --- Pressure-velocity PIMPLE corrector loop diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options index c8ce69c074b6f87f924a391ae8778b3f19e946ee..6e20519ec98d90ae8f38ba26587a05c72e39374c 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options @@ -1,4 +1,5 @@ EXE_INC = \ + -I../interFoam \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \ diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaDiffusionEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaDiffusionEqn.H new file mode 100644 index 0000000000000000000000000000000000000000..139646e43c6023c1486e3ee53dfdb0a14c63e158 --- /dev/null +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaDiffusionEqn.H @@ -0,0 +1,18 @@ +{ + fvScalarMatrix alpha1Eqn + ( + fvm::ddt(alpha1) + - fvc::ddt(alpha1) + - fvm::laplacian + ( + volScalarField("Dab", Dab + alphatab*turbulence->nut()), + alpha1 + ) + ); + + alpha1Eqn.solve(); + + rhoPhi += alpha1Eqn.flux()*(rho1 - rho2); +} + +rho = alpha1*rho1 + (scalar(1) - alpha1)*rho2; diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H index d152baba0bb44a1f2cd042596f94030157e0f713..c68a0e56c5c794542ad1925514cef31ce555d4ec 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqn.H @@ -1,22 +1,22 @@ { - fvScalarMatrix alpha1Eqn + word alphaScheme("div(phi,alpha1)"); + + surfaceScalarField phiAlpha ( - fvm::ddt(alpha1) - + fvm::div(phi, alpha1) - - fvm::laplacian + fvc::flux ( - Dab + alphatab*turbulence->nut(), alpha1, - "laplacian(Dab,alpha1)" + phi, + alpha1, + alphaScheme ) ); - alpha1Eqn.solve(); + MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0); - rhoPhi = alpha1Eqn.flux()*(rho1 - rho2) + phi*rho2; - rho = alpha1*rho1 + (scalar(1) - alpha1)*rho2; + rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2; - Info<< "Phase 1 volume fraction = " - << alpha1.weightedAverage(mesh.V()).value() + Info<< "Phase-1 volume fraction = " + << alpha1.weightedAverage(mesh.Vsc()).value() << " Min(alpha1) = " << min(alpha1).value() << " Max(alpha1) = " << max(alpha1).value() << endl; diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqnSubCycle.H b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqnSubCycle.H new file mode 100644 index 0000000000000000000000000000000000000000..6c82f940499ea39567db1e400274832dfa354b0f --- /dev/null +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/alphaEqnSubCycle.H @@ -0,0 +1,26 @@ +label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr"))); +label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles"))); + +if (nAlphaSubCycles > 1) +{ + dimensionedScalar totalDeltaT = runTime.deltaT(); + surfaceScalarField rhoPhiSum(0.0*rhoPhi); + + for + ( + subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles); + !(++alphaSubCycle).end(); + ) + { + #include "alphaEqn.H" + rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi; + } + + rhoPhi = rhoPhiSum; +} +else +{ + #include "alphaEqn.H" +} + +rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2; diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C index 8a2b20e153be50b07fd86ae745f5b4e7776503f4..6113aba01f1b42c4cda46109d3724f93fa4fdbda 100644 --- a/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.C +++ b/applications/solvers/multiphase/twoLiquidMixingFoam/twoLiquidMixingFoam.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 @@ -32,6 +32,8 @@ Description \*---------------------------------------------------------------------------*/ #include "fvCFD.H" +#include "MULES.H" +#include "subCycle.H" #include "twoPhaseMixture.H" #include "turbulenceModel.H" #include "pimpleControl.H" @@ -60,19 +62,21 @@ int main(int argc, char *argv[]) { #include "readTimeControls.H" #include "CourantNo.H" + #include "alphaCourantNo.H" #include "setDeltaT.H" runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; + twoPhaseProperties.correct(); + + #include "alphaEqnSubCycle.H" + #include "alphaDiffusionEqn.H" + // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { - twoPhaseProperties.correct(); - - #include "alphaEqn.H" - #include "UEqn.H" // --- Pressure corrector loop diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index d13d0124687f353e9987288d01d812a726195e9b..eee3fd6894de4f6bde53846973c0a223103a5eea 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -102,6 +102,7 @@ $(constraintFvPatchFields)/cyclicAMI/cyclicAMIFvPatchFields.C $(constraintFvPatchFields)/cyclicSlip/cyclicSlipFvPatchFields.C $(constraintFvPatchFields)/empty/emptyFvPatchFields.C $(constraintFvPatchFields)/jumpCyclic/jumpCyclicFvPatchFields.C +$(constraintFvPatchFields)/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.C $(constraintFvPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatchFields.C $(constraintFvPatchFields)/processor/processorFvPatchFields.C $(constraintFvPatchFields)/processor/processorFvPatchScalarField.C @@ -114,66 +115,69 @@ derivedFvPatchFields = $(fvPatchFields)/derived $(derivedFvPatchFields)/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C $(derivedFvPatchFields)/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C $(derivedFvPatchFields)/advective/advectiveFvPatchFields.C -$(derivedFvPatchFields)/codedMixed/codedMixedFvPatchFields.C +$(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C $(derivedFvPatchFields)/codedFixedValue/codedFixedValueFvPatchFields.C -$(derivedFvPatchFields)/mappedField/mappedFieldFvPatchFields.C -$(derivedFvPatchFields)/mappedFixedInternalValue/mappedFixedInternalValueFvPatchFields.C -$(derivedFvPatchFields)/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchFields.C -$(derivedFvPatchFields)/mappedFixedValue/mappedFixedValueFvPatchFields.C -$(derivedFvPatchFields)/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C -$(derivedFvPatchFields)/mappedFlowRate/mappedFlowRateFvPatchVectorField.C -$(derivedFvPatchFields)/fixedMean/fixedMeanFvPatchFields.C +$(derivedFvPatchFields)/codedMixed/codedMixedFvPatchFields.C +$(derivedFvPatchFields)/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/fan/fanFvPatchFields.C $(derivedFvPatchFields)/fanPressure/fanPressureFvPatchScalarField.C -$(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C -$(derivedFvPatchFields)/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C $(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C +$(derivedFvPatchFields)/fixedJump/fixedJumpFvPatchFields.C +$(derivedFvPatchFields)/fixedJumpAMI/fixedJumpAMIFvPatchFields.C +$(derivedFvPatchFields)/fixedMean/fixedMeanFvPatchFields.C $(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C $(derivedFvPatchFields)/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C +$(derivedFvPatchFields)/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C $(derivedFvPatchFields)/freestream/freestreamFvPatchFields.C $(derivedFvPatchFields)/freestreamPressure/freestreamPressureFvPatchScalarField.C $(derivedFvPatchFields)/inletOutlet/inletOutletFvPatchFields.C $(derivedFvPatchFields)/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C -$(derivedFvPatchFields)/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +$(derivedFvPatchFields)/mappedField/mappedFieldFvPatchFields.C +$(derivedFvPatchFields)/mappedFixedInternalValue/mappedFixedInternalValueFvPatchFields.C +$(derivedFvPatchFields)/mappedFixedPushedInternalValue/mappedFixedPushedInternalValueFvPatchFields.C +$(derivedFvPatchFields)/mappedFixedValue/mappedFixedValueFvPatchFields.C +$(derivedFvPatchFields)/mappedFlowRate/mappedFlowRateFvPatchVectorField.C +$(derivedFvPatchFields)/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C $(derivedFvPatchFields)/movingWallVelocity/movingWallVelocityFvPatchVectorField.C -$(derivedFvPatchFields)/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C -$(derivedFvPatchFields)/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C +$(derivedFvPatchFields)/multiphaseFixedFluxPressure/multiphaseFixedFluxPressureFvPatchScalarField.C $(derivedFvPatchFields)/oscillatingFixedValue/oscillatingFixedValueFvPatchFields.C $(derivedFvPatchFields)/outletInlet/outletInletFvPatchFields.C +$(derivedFvPatchFields)/outletMappedUniformInlet/outletMappedUniformInletFvPatchFields.C $(derivedFvPatchFields)/partialSlip/partialSlipFvPatchFields.C +$(derivedFvPatchFields)/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C $(derivedFvPatchFields)/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C -$(derivedFvPatchFields)/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C -$(derivedFvPatchFields)/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/pressureInletOutletParSlipVelocity/pressureInletOutletParSlipVelocityFvPatchVectorField.C +$(derivedFvPatchFields)/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C $(derivedFvPatchFields)/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C +$(derivedFvPatchFields)/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C +$(derivedFvPatchFields)/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C $(derivedFvPatchFields)/slip/slipFvPatchFields.C $(derivedFvPatchFields)/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C $(derivedFvPatchFields)/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C +$(derivedFvPatchFields)/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/syringePressure/syringePressureFvPatchScalarField.C $(derivedFvPatchFields)/timeVaryingMappedFixedValue/AverageIOFields.C $(derivedFvPatchFields)/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchFields.C $(derivedFvPatchFields)/totalPressure/totalPressureFvPatchScalarField.C $(derivedFvPatchFields)/totalTemperature/totalTemperatureFvPatchScalarField.C +$(derivedFvPatchFields)/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C $(derivedFvPatchFields)/turbulentInlet/turbulentInletFvPatchFields.C $(derivedFvPatchFields)/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C +$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C $(derivedFvPatchFields)/uniformFixedValue/uniformFixedValueFvPatchFields.C +$(derivedFvPatchFields)/uniformJump/uniformJumpFvPatchFields.C +$(derivedFvPatchFields)/uniformJumpAMI/uniformJumpAMIFvPatchFields.C $(derivedFvPatchFields)/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.C -$(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C -$(derivedFvPatchFields)/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C -$(derivedFvPatchFields)/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C -$(derivedFvPatchFields)/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C -$(derivedFvPatchFields)/outletMappedUniformInlet/outletMappedUniformInletFvPatchFields.C -$(derivedFvPatchFields)/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C -$(derivedFvPatchFields)/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C $(derivedFvPatchFields)/variableHeightFlowRate/variableHeightFlowRateFvPatchField.C $(derivedFvPatchFields)/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C -$(derivedFvPatchFields)/temperatureJump/temperatureJumpFvPatchScalarField.C +$(derivedFvPatchFields)/waveTransmissive/waveTransmissiveFvPatchFields.C +$(derivedFvPatchFields)/waveSurfacePressure/waveSurfacePressureFvPatchScalarField.C fvsPatchFields = fields/fvsPatchFields $(fvsPatchFields)/fvsPatchField/fvsPatchFields.C diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C index 193008daffc3aa07cba17a13113b16bb56f0144e..67bc7f96dbcd2a033becd28596419fd2c3270d93 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C @@ -105,12 +105,12 @@ tmp<Field<Type> > jumpCyclicFvPatchField<Type>::patchNeighbourField() const tmp<Field<Type> > tpnf(new Field<Type>(this->size())); Field<Type>& pnf = tpnf(); - tmp<Field<scalar> > tjf = jump(); + tmp<Field<Type> > tjf = jump(); if (!this->cyclicPatch().owner()) { tjf = -tjf; } - const Field<scalar>& jf = tjf(); + const Field<Type>& jf = tjf(); if (this->doTransform()) { @@ -149,7 +149,8 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix const labelUList& nbrFaceCells = this->cyclicPatch().neighbFvPatch().faceCells(); - if (&psiInternal == &this->internalField()) + // for AMG solve - only apply jump to finest level + if (psiInternal.size() == this->internalField().size()) { tmp<Field<scalar> > tjf = jump()().component(cmpt); if (!this->cyclicPatch().owner()) @@ -197,7 +198,8 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix const labelUList& nbrFaceCells = this->cyclicPatch().neighbFvPatch().faceCells(); - if (&psiInternal == &this->internalField()) + // for AMG solve - only apply jump to finest level + if (psiInternal.size() == this->internalField().size()) { tmp<Field<Type> > tjf = jump(); if (!this->cyclicPatch().owner()) diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.C new file mode 100644 index 0000000000000000000000000000000000000000..87d7c20efd5ba6f36d52eb22b8596efd211eb1bc --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.C @@ -0,0 +1,201 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "jumpCyclicAMIFvPatchField.H" +#include "transformField.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Type> +Foam::jumpCyclicAMIFvPatchField<Type>::jumpCyclicAMIFvPatchField +( + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF +) +: + cyclicAMIFvPatchField<Type>(p, iF) +{} + + +template<class Type> +Foam::jumpCyclicAMIFvPatchField<Type>::jumpCyclicAMIFvPatchField +( + const jumpCyclicAMIFvPatchField<Type>& ptf, + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + cyclicAMIFvPatchField<Type>(ptf, p, iF, mapper) +{} + + +template<class Type> +Foam::jumpCyclicAMIFvPatchField<Type>::jumpCyclicAMIFvPatchField +( + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF, + const dictionary& dict +) +: + cyclicAMIFvPatchField<Type>(p, iF, dict) +{ + // Call this evaluation in derived classes + //this->evaluate(Pstream::blocking); +} + + +template<class Type> +Foam::jumpCyclicAMIFvPatchField<Type>::jumpCyclicAMIFvPatchField +( + const jumpCyclicAMIFvPatchField<Type>& ptf +) +: + cyclicAMIFvPatchField<Type>(ptf) +{} + + +template<class Type> +Foam::jumpCyclicAMIFvPatchField<Type>::jumpCyclicAMIFvPatchField +( + const jumpCyclicAMIFvPatchField<Type>& ptf, + const DimensionedField<Type, volMesh>& iF +) +: + cyclicAMIFvPatchField<Type>(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +Foam::tmp<Foam::Field<Type> > +Foam::jumpCyclicAMIFvPatchField<Type>::patchNeighbourField() const +{ + const Field<Type>& iField = this->internalField(); + const labelUList& nbrFaceCells = + this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells(); + + Field<Type> pnf(iField, nbrFaceCells); + tmp<Field<Type> > tpnf + ( + new Field<Type>(this->cyclicAMIPatch().interpolate(pnf)) + ); + + if (this->doTransform()) + { + tpnf = transform(this->forwardT(), tpnf); + } + + tmp<Field<Type> > tjf = jump(); + if (!this->cyclicAMIPatch().owner()) + { + tjf = -tjf; + } + + return tpnf - tjf; +} + + +template<class Type> +void Foam::jumpCyclicAMIFvPatchField<Type>::updateInterfaceMatrix +( + scalarField& result, + const scalarField& psiInternal, + const scalarField& coeffs, + const direction cmpt, + const Pstream::commsTypes +) const +{ + const labelUList& nbrFaceCells = + this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells(); + + scalarField pnf(psiInternal, nbrFaceCells); + + pnf = this->cyclicAMIPatch().interpolate(pnf); + + // for AMG solve - only apply jump to finest level + if (psiInternal.size() == this->internalField().size()) + { + tmp<Field<scalar> > tjf = jump()().component(cmpt); + if (!this->cyclicAMIPatch().owner()) + { + tjf = -tjf; + } + pnf -= tjf; + } + + // Transform according to the transformation tensors + this->transformCoupleField(pnf, cmpt); + + // Multiply the field by coefficients and add into the result + const labelUList& faceCells = this->cyclicAMIPatch().faceCells(); + forAll(faceCells, elemI) + { + result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI]; + } +} + + +template<class Type> +void Foam::jumpCyclicAMIFvPatchField<Type>::updateInterfaceMatrix +( + Field<Type>& result, + const Field<Type>& psiInternal, + const scalarField& coeffs, + const Pstream::commsTypes +) const +{ + const labelUList& nbrFaceCells = + this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells(); + + Field<Type> pnf(psiInternal, nbrFaceCells); + + pnf = this->cyclicAMIPatch().interpolate(pnf); + + // for AMG solve - only apply jump to finest level + if (psiInternal.size() == this->internalField().size()) + { + tmp<Field<Type> > tjf = jump(); + if (!this->cyclicAMIPatch().owner()) + { + tjf = -tjf; + } + pnf -= tjf; + } + + // Transform according to the transformation tensors + this->transformCoupleField(pnf); + + // Multiply the field by coefficients and add into the result + const labelUList& faceCells = this->cyclicAMIPatch().faceCells(); + forAll(faceCells, elemI) + { + result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI]; + } +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.H new file mode 100644 index 0000000000000000000000000000000000000000..6759b09a36c57ba5a49b75d48147e216f010126e --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.H @@ -0,0 +1,165 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::jumpCyclicAMIFvPatchField + +Group + grpCoupledBoundaryConditions + +Description + This boundary condition provides a base class that enforces a cyclic + condition with a specified 'jump' (or offset) between a pair of boundaries, + whereby communication between the patches is performed using an arbitrary + mesh interface (AMI) interpolation. + +SeeAlso + Foam::cyclicAMIFvPatchField + +SourceFiles + jumpCyclicAMIFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef jumpCyclicAMIFvPatchField_H +#define jumpCyclicAMIFvPatchField_H + +#include "cyclicAMIFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class jumpCyclicAMIFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template<class Type> +class jumpCyclicAMIFvPatchField +: + public cyclicAMIFvPatchField<Type> +{ + +public: + + //- Runtime type information + TypeName("jumpCyclicAMI"); + + + // Constructors + + //- Construct from patch and internal field + jumpCyclicAMIFvPatchField + ( + const fvPatch&, + const DimensionedField<Type, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + jumpCyclicAMIFvPatchField + ( + const fvPatch&, + const DimensionedField<Type, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given jumpCyclicAMIFvPatchField onto a + // new patch + jumpCyclicAMIFvPatchField + ( + const jumpCyclicAMIFvPatchField<Type>&, + const fvPatch&, + const DimensionedField<Type, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + jumpCyclicAMIFvPatchField + ( + const jumpCyclicAMIFvPatchField<Type>& + ); + + //- Construct as copy setting internal field reference + jumpCyclicAMIFvPatchField + ( + const jumpCyclicAMIFvPatchField<Type>&, + const DimensionedField<Type, volMesh>& + ); + + + // Member functions + + // Access + + //- Return the interface type + virtual const word& interfaceFieldType() const + { + return cyclicAMIFvPatchField<Type>::type(); + } + + //- Return the "jump" across the patch as a "half" field + virtual tmp<Field<Type> > jump() const = 0; + + + // Evaluation functions + + //- Return neighbour coupled given internal cell data + tmp<Field<Type> > patchNeighbourField() const; + + //- Update result field based on interface functionality + virtual void updateInterfaceMatrix + ( + scalarField& result, + const scalarField& psiInternal, + const scalarField& coeffs, + const direction cmpt, + const Pstream::commsTypes commsType + ) const; + + //- Update result field based on interface functionality + virtual void updateInterfaceMatrix + ( + Field<Type>&, + const Field<Type>&, + const scalarField&, + const Pstream::commsTypes commsType + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "jumpCyclicAMIFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.C new file mode 100644 index 0000000000000000000000000000000000000000..323f460d9f7d99139c13f5d878c6b6e2094a9c05 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "jumpCyclicAMIFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFieldsTypeName(jumpCyclicAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.H new file mode 100644 index 0000000000000000000000000000000000000000..6f5039e0bc7db0be77e9cba6638b8134102a6c0a --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#ifndef jumpCyclicAMIFvPatchFields_H +#define jumpCyclicAMIFvPatchFields_H + +#include "jumpCyclicAMIFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(jumpCyclicAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFieldsFwd.H new file mode 100644 index 0000000000000000000000000000000000000000..c4bc6547b06c39a51dc11e001ebbe2da50b8945d --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchFieldsFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#ifndef jumpCyclicAMIFvPatchFieldsFwd_H +#define jumpCyclicAMIFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template<class Type> class jumpCyclicAMIFvPatchField; + +makePatchTypeFieldTypedefs(jumpCyclicAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C index 477b242b76a0973b587c158780c0b199fda55568..3a150c6f70792102426a0c851279fe19c0838c66 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.C @@ -34,8 +34,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField const DimensionedField<Type, volMesh>& iF ) : - fixedJumpFvPatchField<Type>(p, iF), - jumpTable_(0) + uniformJumpFvPatchField<Type>(p, iF) {} @@ -48,8 +47,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField const fvPatchFieldMapper& mapper ) : - fixedJumpFvPatchField<Type>(ptf, p, iF, mapper), - jumpTable_(ptf.jumpTable_().clone().ptr()) + uniformJumpFvPatchField<Type>(ptf, p, iF, mapper) {} @@ -61,8 +59,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField const dictionary& dict ) : - fixedJumpFvPatchField<Type>(p, iF), - jumpTable_(DataEntry<Type>::New("jumpTable", dict)) + uniformJumpFvPatchField<Type>(p, iF, dict) {} @@ -72,9 +69,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField const fanFvPatchField<Type>& ptf ) : - cyclicLduInterfaceField(), - fixedJumpFvPatchField<Type>(ptf), - jumpTable_(ptf.jumpTable_().clone().ptr()) + uniformJumpFvPatchField<Type>(ptf) {} @@ -85,25 +80,8 @@ Foam::fanFvPatchField<Type>::fanFvPatchField const DimensionedField<Type, volMesh>& iF ) : - fixedJumpFvPatchField<Type>(ptf, iF), - jumpTable_(ptf.jumpTable_().clone().ptr()) + uniformJumpFvPatchField<Type>(ptf, iF) {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - - -template<class Type> -void Foam::fanFvPatchField<Type>::write(Ostream& os) const -{ - - fixedJumpFvPatchField<Type>::write(os); - if (this->cyclicPatch().owner()) - { - jumpTable_->writeData(os); - } - this->writeEntry("value", os); -} - - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H index 3eea1382f39400ec5f98a6b1ed4e3109459d87df..463ebeb543602d0a1dd0e4291b626b6ef1101307 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H @@ -83,7 +83,7 @@ SourceFiles #ifndef fanFvPatchField_H #define fanFvPatchField_H -#include "fixedJumpFvPatchField.H" +#include "uniformJumpFvPatchField.H" #include "DataEntry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -98,13 +98,8 @@ namespace Foam template<class Type> class fanFvPatchField : - public fixedJumpFvPatchField<Type> + public uniformJumpFvPatchField<Type> { - // Private data - - //- Interpolation table - autoPtr<DataEntry<Type> > jumpTable_; - public: @@ -179,10 +174,6 @@ public: //- Update the coefficients associated with the patch field virtual void updateCoeffs(); - - - //- Write - virtual void write(Ostream&) const; }; diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C index 1b291d500cc548e71adc183e198c97c364b2822e..1c8e93489266109997ab2f8f8458f06bf4b48d5b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C @@ -53,8 +53,7 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField const dictionary& dict ) : - fixedJumpFvPatchField<scalar>(p, iF), - jumpTable_(new DataEntry<scalar>("jumpTable")) + uniformJumpFvPatchField<scalar>(p, iF) { if (this->cyclicPatch().owner()) { @@ -83,7 +82,7 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField } } - jumpTable_.reset + this->jumpTable_.reset ( new polynomial("jumpTable", coeffs) ); @@ -91,9 +90,14 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField else { // Generic input constructed from dictionary - jumpTable_ = DataEntry<scalar>::New("jumpTable", dict); + this->jumpTable_ = DataEntry<scalar>::New("jumpTable", dict); } } + else + { + // Generic input constructed from dictionary + this->jumpTable_.reset(new DataEntry<scalar>("jumpTable")); + } if (dict.found("value")) @@ -136,10 +140,10 @@ void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs() Un /= patch().lookupPatchField<volScalarField, scalar>("rho"); } - jump_ = jumpTable_->value(Un); + this->jump_ = this->jumpTable_->value(Un); } - fixedJumpFvPatchField<scalar>::updateCoeffs(); + uniformJumpFvPatchField<scalar>::updateCoeffs(); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C index fd2050ffcc0d6cb6c005bfdbe354f2bf0bbcea2f..eb997abf365e11a954afce3fc65ee13f645b6a75 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C @@ -92,6 +92,23 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class Type> +Foam::tmp<Foam::Field<Type> > Foam::fixedJumpFvPatchField<Type>::jump() const +{ + if (this->cyclicPatch().owner()) + { + return jump_; + } + else + { + return refCast<const fixedJumpFvPatchField<Type> > + ( + this->neighbourPatchField() + ).jump(); + } +} + + template<class Type> void Foam::fixedJumpFvPatchField<Type>::autoMap ( @@ -124,6 +141,7 @@ void Foam::fixedJumpFvPatchField<Type>::write(Ostream& os) const fvPatchField<Type>::write(os); os.writeKeyword("patchType") << "cyclic" << token::END_STATEMENT << nl; jump_.writeEntry("jump", os); + this->writeEntry("value", os); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H index 30ec57fc54eb35c11df20a7f18fcfdde72f659be..ede9fea8af48fca9c9901037f61b5dbd3669f695 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.H @@ -28,14 +28,37 @@ Group grpCoupledBoundaryConditions Description - Base class for "jump" of a field<type> + This boundary condition provides a jump condition, using the \c cyclic + condition as a base. + + The jump is specified as a fixed value field, applied as an offset to the + 'owner' patch. + + \heading Patch usage + + \table + Property | Description | Required | Default value + patchType | underlying patch type should be \c cyclic| yes | + jump | current jump value | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type fixedJump; + patchType cyclic; + jump uniform 10; + } + \endverbatim + + The above example shows the use of a fixed jump of '10'. Note - not used directly + The underlying \c patchType should be set to \c cyclic SeeAlso - Foam::fanFvPatchScalarField - Foam::fanPressureFvPatchScalarField + Foam::jumpCyclicFvPatchField SourceFiles fixedJumpFvPatchField.C @@ -72,6 +95,9 @@ protected: public: + //- Runtime type information + TypeName("fixedJump"); + // Constructors //- Construct from patch and internal field @@ -138,21 +164,8 @@ public: // Access - //- Return the "jump" across the patch. - virtual tmp<Field<Type> > jump() const - { - if (this->cyclicPatch().owner()) - { - return jump_; - } - else - { - return refCast<const fixedJumpFvPatchField<Type> > - ( - this->neighbourPatchField() - ).jump(); - } - } + //- Return the "jump" across the patch + virtual tmp<Field<Type> > jump() const; // Mapping functions diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFields.C new file mode 100644 index 0000000000000000000000000000000000000000..b06849691a0cba40004f7305fa4bcb6980d71993 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFields.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "fixedJumpFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFields(fixedJump); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFields.H new file mode 100644 index 0000000000000000000000000000000000000000..444d3259bdc05c879b8943ca4c10521e99e142ab --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedJumpFvPatchFields_H +#define fixedJumpFvPatchFields_H + +#include "fixedJumpFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(fixedJump); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFieldsFwd.H new file mode 100644 index 0000000000000000000000000000000000000000..97a42cfa465e344103daff0064c13b5d56deae4a --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchFieldsFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedJumpFvPatchFieldsFwd_H +#define fixedJumpFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template<class Type> class fixedJumpFvPatchField; + +makePatchTypeFieldTypedefs(fixedJump); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C new file mode 100644 index 0000000000000000000000000000000000000000..d9cdc383a3f56c64518e87484ee8a442e27eae72 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C @@ -0,0 +1,150 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "fixedJumpAMIFvPatchField.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Type> +Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField +( + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF +) +: + jumpCyclicAMIFvPatchField<Type>(p, iF), + jump_(this->size(), pTraits<Type>::zero) +{} + + +template<class Type> +Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField +( + const fixedJumpAMIFvPatchField<Type>& ptf, + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + jumpCyclicAMIFvPatchField<Type>(ptf, p, iF, mapper), + jump_(ptf.jump_, mapper) +{} + + +template<class Type> +Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField +( + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF, + const dictionary& dict +) +: + jumpCyclicAMIFvPatchField<Type>(p, iF), + jump_("jump", dict, p.size()) +{} + + +template<class Type> +Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField +( + const fixedJumpAMIFvPatchField<Type>& ptf +) +: + jumpCyclicAMIFvPatchField<Type>(ptf), + jump_(ptf.jump_) +{} + + +template<class Type> +Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField +( + const fixedJumpAMIFvPatchField<Type>& ptf, + const DimensionedField<Type, volMesh>& iF +) +: + jumpCyclicAMIFvPatchField<Type>(ptf, iF), + jump_(ptf.jump_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +Foam::tmp<Foam::Field<Type> > Foam::fixedJumpAMIFvPatchField<Type>::jump() const +{ + if (this->cyclicAMIPatch().owner()) + { + return jump_; + } + else + { + const fixedJumpAMIFvPatchField& nbrPatch = + refCast<const fixedJumpAMIFvPatchField<Type> > + ( + this->neighbourPatchField() + ); + + return this->cyclicAMIPatch().interpolate(nbrPatch.jump()); + } +} + + +template<class Type> +void Foam::fixedJumpAMIFvPatchField<Type>::autoMap +( + const fvPatchFieldMapper& m +) +{ + jumpCyclicAMIFvPatchField<Type>::autoMap(m); + jump_.autoMap(m); +} + + +template<class Type> +void Foam::fixedJumpAMIFvPatchField<Type>::rmap +( + const fvPatchField<Type>& ptf, + const labelList& addr +) +{ + jumpCyclicAMIFvPatchField<Type>::rmap(ptf, addr); + + const fixedJumpAMIFvPatchField<Type>& tiptf = + refCast<const fixedJumpAMIFvPatchField<Type> >(ptf); + jump_.rmap(tiptf.jump_, addr); +} + + +template<class Type> +void Foam::fixedJumpAMIFvPatchField<Type>::write(Ostream& os) const +{ + fvPatchField<Type>::write(os); + os.writeKeyword("patchType") << "cyclicAMI" << token::END_STATEMENT << nl; + jump_.writeEntry("jump", os); + this->writeEntry("value", os); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H new file mode 100644 index 0000000000000000000000000000000000000000..9a0c4bf52048c20f0a67d1b9054f763f020b417b --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.H @@ -0,0 +1,200 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::fixedJumpAMIFvPatchField + +Group + grpCoupledBoundaryConditions + +Description + This boundary condition provides a jump condition, across non-conformal + cyclic path-pairs, employing an arbitraryMeshInterface (AMI). + + The jump is specified as a fixed value field, applied as an offset to the + 'owner' patch. + + \heading Patch usage + + \table + Property | Description | Required | Default value + patchType | underlying patch type should be \c cyclic| yes | + jump | current jump value | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type fixedJumpAMI; + patchType cyclic; + jump uniform 10; + } + \endverbatim + + The above example shows the use of a fixed jump of '10'. + +Note + The underlying \c patchType should be set to \c cyclicAMI + +SeeAlso + Foam::jumpCyclicAMIFvPatchField + +SourceFiles + fixedJumpAMIFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedJumpAMIFvPatchField_H +#define fixedJumpAMIFvPatchField_H + +#include "jumpCyclicAMIFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class fixedJumpAMIFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template<class Type> +class fixedJumpAMIFvPatchField +: + public jumpCyclicAMIFvPatchField<Type> +{ + +protected: + + // Protected data + + //- "jump" field + Field<Type> jump_; + + +public: + + //- Runtime type information + TypeName("fixedJumpAMI"); + + + // Constructors + + //- Construct from patch and internal field + fixedJumpAMIFvPatchField + ( + const fvPatch&, + const DimensionedField<Type, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + fixedJumpAMIFvPatchField + ( + const fvPatch&, + const DimensionedField<Type, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given fixedJumpAMIFvPatchField onto a + // new patch + fixedJumpAMIFvPatchField + ( + const fixedJumpAMIFvPatchField<Type>&, + const fvPatch&, + const DimensionedField<Type, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + fixedJumpAMIFvPatchField + ( + const fixedJumpAMIFvPatchField<Type>& + ); + + //- Construct and return a clone + virtual tmp<fvPatchField<Type> > clone() const + { + return tmp<fvPatchField<Type> > + ( + new fixedJumpAMIFvPatchField<Type>(*this) + ); + } + + //- Construct as copy setting internal field reference + fixedJumpAMIFvPatchField + ( + const fixedJumpAMIFvPatchField<Type>&, + const DimensionedField<Type, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchField<Type> > clone + ( + const DimensionedField<Type, volMesh>& iF + ) const + { + return tmp<fvPatchField<Type> > + ( + new fixedJumpAMIFvPatchField<Type>(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return the "jump" across the patch + virtual tmp<Field<Type> > jump() const; + + + // 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 fvPatchField<Type>&, const labelList&); + + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "fixedJumpAMIFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFields.C new file mode 100644 index 0000000000000000000000000000000000000000..c28877d601aa85ce02bc08c5c0aa3b6286339a2d --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFields.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "fixedJumpAMIFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFields(fixedJumpAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFields.H new file mode 100644 index 0000000000000000000000000000000000000000..b0da67335a32fe3ecee0ec0692390f137ef9d7d9 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedJumpAMIFvPatchFields_H +#define fixedJumpAMIFvPatchFields_H + +#include "fixedJumpAMIFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(fixedJumpAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFieldsFwd.H new file mode 100644 index 0000000000000000000000000000000000000000..9231539cf3e8f07816685ac0270732a918b01c9d --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchFieldsFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedJumpAMIFvPatchFieldsFwd_H +#define fixedJumpAMIFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template<class Type> class fixedJumpAMIFvPatchField; + +makePatchTypeFieldTypedefs(fixedJumpAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C new file mode 100644 index 0000000000000000000000000000000000000000..88e75781415a900cec40d906281e07db994eb439 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.C @@ -0,0 +1,141 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "uniformJumpFvPatchField.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Type> +Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField +( + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF +) +: + fixedJumpFvPatchField<Type>(p, iF), + jumpTable_(0) +{} + + +template<class Type> +Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField +( + const uniformJumpFvPatchField<Type>& ptf, + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedJumpFvPatchField<Type>(ptf, p, iF, mapper), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +template<class Type> +Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField +( + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF, + const dictionary& dict +) +: + fixedJumpFvPatchField<Type>(p, iF), + jumpTable_(new DataEntry<Type>("jumpTable")) +{ + if (this->cyclicPatch().owner()) + { + jumpTable_ = DataEntry<Type>::New("jumpTable", dict); + } + + if (dict.found("value")) + { + fvPatchField<Type>::operator= + ( + Field<Type>("value", dict, p.size()) + ); + } +} + + +template<class Type> +Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField +( + const uniformJumpFvPatchField<Type>& ptf +) +: + fixedJumpFvPatchField<Type>(ptf), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +template<class Type> +Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField +( + const uniformJumpFvPatchField<Type>& ptf, + const DimensionedField<Type, volMesh>& iF +) +: + fixedJumpFvPatchField<Type>(ptf, iF), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +Foam::tmp<Foam::Field<Type> > Foam::uniformJumpFvPatchField<Type>::jump() const +{ + if (this->cyclicPatch().owner()) + { + Type j = jumpTable_->value(this->db().time().value()); + + return tmp<Field<Type> >(new Field<Type>(this->size(), j)); + } + else + { + const uniformJumpFvPatchField& nbrPatch = + refCast<const uniformJumpFvPatchField<Type> > + ( + this->neighbourPatchField() + ); + + return nbrPatch.jump(); + } +} + + +template<class Type> +void Foam::uniformJumpFvPatchField<Type>::write(Ostream& os) const +{ + fixedJumpFvPatchField<Type>::write(os); + if (this->cyclicPatch().owner()) + { + jumpTable_->writeData(os); + } + this->writeEntry("value", os); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H new file mode 100644 index 0000000000000000000000000000000000000000..633dc1752e932bc92a6f646b8b73be79cf268623 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchField.H @@ -0,0 +1,193 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::uniformJumpFvPatchField + +Group + grpCoupledBoundaryConditions + +Description + This boundary condition provides a jump condition, using the \c cyclic + condition as a base. The jump is specified as a time-varying uniform + value across the patch. + + \heading Patch usage + + \table + Property | Description | Required | Default value + patchType | underlying patch type should be \c cyclic| yes | + jumpTable | jump value | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type uniformJump; + patchType cyclic; + jumpTable constant 10; + } + \endverbatim + + The above example shows the use of a fixed jump of '10'. + +Note + The uniformValue entry is a DataEntry type, able to describe time + varying functions. The example above gives the usage for supplying a + constant value. + + The underlying \c patchType should be set to \c cyclic + +SeeAlso + Foam::fixedJumpFvPatchField + +SourceFiles + uniformJumpFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformJumpFvPatchField_H +#define uniformJumpFvPatchField_H + +#include "fixedJumpFvPatchField.H" +#include "DataEntry.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class uniformJumpFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template<class Type> +class uniformJumpFvPatchField +: + public fixedJumpFvPatchField<Type> +{ + +protected: + + // Protected data + + //- "jump" table + autoPtr<DataEntry<Type> > jumpTable_; + + +public: + + //- Runtime type information + TypeName("uniformJump"); + + // Constructors + + //- Construct from patch and internal field + uniformJumpFvPatchField + ( + const fvPatch&, + const DimensionedField<Type, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + uniformJumpFvPatchField + ( + const fvPatch&, + const DimensionedField<Type, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given uniformJumpFvPatchField onto a + // new patch + uniformJumpFvPatchField + ( + const uniformJumpFvPatchField<Type>&, + const fvPatch&, + const DimensionedField<Type, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + uniformJumpFvPatchField + ( + const uniformJumpFvPatchField<Type>& + ); + + //- Construct and return a clone + virtual tmp<fvPatchField<Type> > clone() const + { + return tmp<fvPatchField<Type> > + ( + new uniformJumpFvPatchField<Type>(*this) + ); + } + + //- Construct as copy setting internal field reference + uniformJumpFvPatchField + ( + const uniformJumpFvPatchField<Type>&, + const DimensionedField<Type, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchField<Type> > clone + ( + const DimensionedField<Type, volMesh>& iF + ) const + { + return tmp<fvPatchField<Type> > + ( + new uniformJumpFvPatchField<Type>(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return the "jump" across the patch. + virtual tmp<Field<Type> > jump() const; + + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "uniformJumpFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFields.C new file mode 100644 index 0000000000000000000000000000000000000000..489ab5f6332a0eddfa53716dbdea008e89021e03 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFields.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "uniformJumpFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFields(uniformJump); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFields.H new file mode 100644 index 0000000000000000000000000000000000000000..e28916c3835fd490182dd760827c3a777f90c940 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformJumpFvPatchFields_H +#define uniformJumpFvPatchFields_H + +#include "uniformJumpFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(uniformJump); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFieldsFwd.H new file mode 100644 index 0000000000000000000000000000000000000000..e9bcac0bbaa0e24b51e088229a78bae417de357b --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJump/uniformJumpFvPatchFieldsFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformJumpFvPatchFieldsFwd_H +#define uniformJumpFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template<class Type> class uniformJumpFvPatchField; + +makePatchTypeFieldTypedefs(uniformJump); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C new file mode 100644 index 0000000000000000000000000000000000000000..cb9ff6cd901488524a46d53fe322cdbf67519e40 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.C @@ -0,0 +1,139 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "uniformJumpAMIFvPatchField.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Type> +Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField +( + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF +) +: + fixedJumpAMIFvPatchField<Type>(p, iF), + jumpTable_(0) +{} + + +template<class Type> +Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField +( + const uniformJumpAMIFvPatchField<Type>& ptf, + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedJumpAMIFvPatchField<Type>(ptf, p, iF, mapper), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +template<class Type> +Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField +( + const fvPatch& p, + const DimensionedField<Type, volMesh>& iF, + const dictionary& dict +) +: + fixedJumpAMIFvPatchField<Type>(p, iF), + jumpTable_(new DataEntry<Type>("jumpTable")) +{ + if (this->cyclicAMIPatch().owner()) + { + jumpTable_ = DataEntry<Type>::New("jumpTable", dict); + } + + if (dict.found("value")) + { + fvPatchField<Type>::operator=(Field<Type>("value", dict, p.size())); + } +} + + +template<class Type> +Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField +( + const uniformJumpAMIFvPatchField<Type>& ptf +) +: + fixedJumpAMIFvPatchField<Type>(ptf), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +template<class Type> +Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField +( + const uniformJumpAMIFvPatchField<Type>& ptf, + const DimensionedField<Type, volMesh>& iF +) +: + fixedJumpAMIFvPatchField<Type>(ptf, iF), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +Foam::tmp<Foam::Field<Type> > +Foam::uniformJumpAMIFvPatchField<Type>::jump() const +{ + if (this->cyclicAMIPatch().owner()) + { + Type j = jumpTable_->value(this->db().time().value()); + + return tmp<Field<Type> >(new Field<Type>(this->size(), j)); + } + else + { + const uniformJumpAMIFvPatchField& nbrPatch = + refCast<const uniformJumpAMIFvPatchField<Type> > + ( + this->neighbourPatchField() + ); + + return this->cyclicAMIPatch().interpolate(nbrPatch.jump()); + } +} + + +template<class Type> +void Foam::uniformJumpAMIFvPatchField<Type>::write(Ostream& os) const +{ + fixedJumpAMIFvPatchField<Type>::write(os); + if (this->cyclicAMIPatch().owner()) + { + jumpTable_->writeData(os); + } + this->writeEntry("value", os); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H new file mode 100644 index 0000000000000000000000000000000000000000..e5eb2e6826883fb37c33b72c3af8d2118525af10 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchField.H @@ -0,0 +1,193 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::uniformJumpAMIFvPatchField + +Group + grpCoupledBoundaryConditions + +Description + This boundary condition provides a jump condition, using the \c cyclicAMI + condition as a base. The jump is specified as a time-varying uniform + value across the patch. + + \heading Patch usage + + \table + Property | Description | Required | Default value + patchType | underlying patch type should be \c cyclicAMI| yes | + jumpTable | jump value | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type uniformJumpAMI; + patchType cyclicAMI; + jumpTable constant 10; + } + \endverbatim + + The above example shows the use of a fixed jump of '10'. + +Note + The uniformValue entry is a DataEntry type, able to describe time + varying functions. The example above gives the usage for supplying a + constant value. + + The underlying \c patchType should be set to \c cyclic + +SeeAlso + Foam::jumpCyclicAMIFvPatchField + +SourceFiles + uniformJumpAMIFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformJumpAMIFvPatchField_H +#define uniformJumpAMIFvPatchField_H + +#include "fixedJumpAMIFvPatchField.H" +#include "DataEntry.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class uniformJumpAMIFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template<class Type> +class uniformJumpAMIFvPatchField +: + public fixedJumpAMIFvPatchField<Type> +{ + +protected: + + // Protected data + + //- "jump" table + autoPtr<DataEntry<Type> > jumpTable_; + + +public: + + //- Runtime type information + TypeName("uniformJumpAMI"); + + // Constructors + + //- Construct from patch and internal field + uniformJumpAMIFvPatchField + ( + const fvPatch&, + const DimensionedField<Type, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + uniformJumpAMIFvPatchField + ( + const fvPatch&, + const DimensionedField<Type, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given uniformJumpAMIFvPatchField onto a + // new patch + uniformJumpAMIFvPatchField + ( + const uniformJumpAMIFvPatchField<Type>&, + const fvPatch&, + const DimensionedField<Type, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + uniformJumpAMIFvPatchField + ( + const uniformJumpAMIFvPatchField<Type>& + ); + + //- Construct and return a clone + virtual tmp<fvPatchField<Type> > clone() const + { + return tmp<fvPatchField<Type> > + ( + new uniformJumpAMIFvPatchField<Type>(*this) + ); + } + + //- Construct as copy setting internal field reference + uniformJumpAMIFvPatchField + ( + const uniformJumpAMIFvPatchField<Type>&, + const DimensionedField<Type, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchField<Type> > clone + ( + const DimensionedField<Type, volMesh>& iF + ) const + { + return tmp<fvPatchField<Type> > + ( + new uniformJumpAMIFvPatchField<Type>(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return the "jump" across the patch. + virtual tmp<Field<Type> > jump() const; + + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "uniformJumpAMIFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFields.C new file mode 100644 index 0000000000000000000000000000000000000000..f17f2849e86da26f2d733612a5dd53a629c9a99f --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFields.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "uniformJumpAMIFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFields(uniformJumpAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFields.H new file mode 100644 index 0000000000000000000000000000000000000000..0314210967bbe19b2752f146935ade3583f5523f --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformJumpAMIFvPatchFields_H +#define uniformJumpAMIFvPatchFields_H + +#include "uniformJumpAMIFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(uniformJumpAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFieldsFwd.H new file mode 100644 index 0000000000000000000000000000000000000000..29080e7ec0b0f9245fe41472ac2ed826a2278034 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformJumpAMI/uniformJumpAMIFvPatchFieldsFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformJumpAMIFvPatchFieldsFwd_H +#define uniformJumpAMIFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template<class Type> class uniformJumpAMIFvPatchField; + +makePatchTypeFieldTypedefs(uniformJumpAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/Make/files b/src/thermophysicalModels/basic/Make/files index 3dc3d0c082e22f544773583ee6f609cedea5e6ba..d8ac16387bdc16c3bdc35c6c4ec14ada47f97497 100644 --- a/src/thermophysicalModels/basic/Make/files +++ b/src/thermophysicalModels/basic/Make/files @@ -10,7 +10,14 @@ rhoThermo/rhoThermos.C derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C -derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C + +derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C +derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C + +derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.C +derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.C +derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.C +derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.C derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C diff --git a/src/thermophysicalModels/basic/Make/options b/src/thermophysicalModels/basic/Make/options index 16d886c766ceaf2770f063b58d22b0db48e1827d..5f64e9872d592f6b4dd450284481b5f8328f22e3 100644 --- a/src/thermophysicalModels/basic/Make/options +++ b/src/thermophysicalModels/basic/Make/options @@ -1,8 +1,8 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ - -lfiniteVolume \ - -L$(FOAM_USER_LIBBIN)/FvPatchScalarFieldEnthalpyJump + -lfiniteVolume diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C similarity index 86% rename from src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C rename to src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C index d3ba1becdd81d87b5a91dc65f28a29fdd56fd2d4..5f46273991971f781d3de1aeb1e04a43b467970c 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C @@ -25,7 +25,7 @@ License #include "addToRunTimeSelectionTable.H" #include "energyJumpFvPatchScalarField.H" -#include "temperatureJumpFvPatchScalarField.H" +#include "temperatureJumpBase.H" #include "basicThermo.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -61,7 +61,6 @@ Foam::energyJumpFvPatchScalarField::energyJumpFvPatchScalarField : fixedJumpFvPatchField<scalar>(p, iF) { - if (dict.found("value")) { fvPatchScalarField::operator= @@ -77,7 +76,6 @@ Foam::energyJumpFvPatchScalarField::energyJumpFvPatchScalarField const energyJumpFvPatchScalarField& ptf ) : - cyclicLduInterfaceField(), fixedJumpFvPatchField<scalar>(ptf) {} @@ -103,29 +101,21 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs() if (this->cyclicPatch().owner()) { - const basicThermo& thermo = db().lookupObject<basicThermo> - ( - "thermophysicalProperties" - ); + const basicThermo& thermo = + db().lookupObject<basicThermo>("thermophysicalProperties"); label patchID = patch().index(); const scalarField& pp = thermo.p().boundaryField()[patchID]; - const temperatureJumpFvPatchScalarField& TbPatch = - refCast<const temperatureJumpFvPatchScalarField> + const temperatureJumpBase& TbPatch = + refCast<const temperatureJumpBase> ( thermo.T().boundaryField()[patchID] ); - const scalar time = this->db().time().value(); - const scalarField jumpTb - ( - patch().size(), TbPatch.jumpTable().value(time) - ); - const labelUList& faceCells = this->patch().faceCells(); - jump_ = thermo.he(pp, jumpTb, faceCells); + jump_ = thermo.he(pp, TbPatch.jump(), faceCells); } fixedJumpFvPatchField<scalar>::updateCoeffs(); diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.H similarity index 91% rename from src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.H rename to src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.H index aae2d9597b07a17adbff7b2515b7eb23b81d091e..833072ad07a475fa409adf9318fe5001cb204b93 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.H @@ -29,23 +29,8 @@ Group Description This boundary condition provides an energy jump condition across a pair - of coupled patches. - - \heading Patch usage - - \table - Property | Description | Required | Default value - jump | energy jump values | yes | - \endtable - - Example of the boundary condition specification: - \verbatim - myPatch - { - type energyJump; - jump uniform 100; - } - \endverbatim + of coupled patches. It is not applied directly, but is employed on-the-fly + when converting temperature boundary conditions into energy. SeeAlso Foam::fixedJumpFvPatchField diff --git a/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C similarity index 56% rename from src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.C rename to src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C index 99be42e3d6fc610f434fb8db65acb9889266dfbf..01cbc404888d6247e227e2874e43a593e68414c7 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C @@ -24,51 +24,43 @@ License \*---------------------------------------------------------------------------*/ #include "addToRunTimeSelectionTable.H" -#include "temperatureJumpFvPatchScalarField.H" -#include "volFields.H" +#include "energyJumpAMIFvPatchScalarField.H" +#include "temperatureJumpBase.H" +#include "basicThermo.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField +Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF ) : - fixedJumpFvPatchField<scalar>(p, iF), - jumpTable_(0) + fixedJumpAMIFvPatchField<scalar>(p, iF) {} -Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField +Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField ( - const temperatureJumpFvPatchScalarField& ptf, + const energyJumpAMIFvPatchScalarField& ptf, const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, const fvPatchFieldMapper& mapper ) : - fixedJumpFvPatchField<scalar>(ptf, p, iF, mapper), - jumpTable_(ptf.jumpTable_().clone().ptr()) + fixedJumpAMIFvPatchField<scalar>(ptf, p, iF, mapper) {} -Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField +Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, const dictionary& dict ) : - fixedJumpFvPatchField<scalar>(p, iF), - jumpTable_(new DataEntry<scalar>("jumpTable")) + fixedJumpAMIFvPatchField<scalar>(p, iF) { - - if (this->cyclicPatch().owner()) - { - jumpTable_ = DataEntry<scalar>::New("jumpTable", dict); - } - if (dict.found("value")) { fvPatchScalarField::operator= @@ -79,38 +71,60 @@ Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField } -Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField +Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField ( - const temperatureJumpFvPatchScalarField& ptf + const energyJumpAMIFvPatchScalarField& ptf ) : - cyclicLduInterfaceField(), - fixedJumpFvPatchField<scalar>(ptf), - jumpTable_(ptf.jumpTable_().clone().ptr()) + fixedJumpAMIFvPatchField<scalar>(ptf) {} -Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField +Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField ( - const temperatureJumpFvPatchScalarField& ptf, + const energyJumpAMIFvPatchScalarField& ptf, const DimensionedField<scalar, volMesh>& iF ) : - fixedJumpFvPatchField<scalar>(ptf, iF), - jumpTable_(ptf.jumpTable_().clone().ptr()) + fixedJumpAMIFvPatchField<scalar>(ptf, iF) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::temperatureJumpFvPatchScalarField::write(Ostream& os) const +void Foam::energyJumpAMIFvPatchScalarField::updateCoeffs() { - fixedJumpFvPatchField<scalar>::write(os); - if (this->cyclicPatch().owner()) + if (this->updated()) { - jumpTable_->writeData(os); + return; } + + if (this->cyclicAMIPatch().owner()) + { + const basicThermo& thermo = + db().lookupObject<basicThermo>("thermophysicalProperties"); + + label patchID = patch().index(); + + const scalarField& pp = thermo.p().boundaryField()[patchID]; + const temperatureJumpBase& TbPatch = + refCast<const temperatureJumpBase> + ( + thermo.T().boundaryField()[patchID] + ); + + const labelUList& faceCells = this->patch().faceCells(); + + jump_ = thermo.he(pp, TbPatch.jump(), faceCells); + } + + fixedJumpAMIFvPatchField<scalar>::updateCoeffs(); +} + + +void Foam::energyJumpAMIFvPatchScalarField::write(Ostream& os) const +{ + fixedJumpAMIFvPatchField<scalar>::write(os); this->writeEntry("value", os); } @@ -122,7 +136,7 @@ namespace Foam makePatchTypeField ( fvPatchScalarField, - temperatureJumpFvPatchScalarField + energyJumpAMIFvPatchScalarField ); } diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..e000c6b2004706e00f97533cecbb4255ff234521 --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.H @@ -0,0 +1,150 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::energyJumpAMIFvPatchScalarField + +Group + grpThermoBoundaryConditions grpCoupledBoundaryConditions + +Description + This boundary condition provides an energy jump condition across a pair + of coupled patches with an arbitrary mesh interface (AMI). It is not + applied directly, but is employed on-the-fly when converting temperature + boundary conditions into energy. + +SeeAlso + Foam::fixedJumpAMIFvPatchField + +SourceFiles + energyJumpAMIFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef energyJumpAMIFvPatchScalarField_H +#define energyJumpAMIFvPatchScalarField_H + +#include "fixedJumpAMIFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class energyJumpAMIFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class energyJumpAMIFvPatchScalarField +: + public fixedJumpAMIFvPatchField<scalar> +{ + +public: + + //- Runtime type information + TypeName("energyJumpAMI"); + + // Constructors + + //- Construct from patch and internal field + energyJumpAMIFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + energyJumpAMIFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given energyJumpAMIFvPatchScalarField onto a + // new patch + energyJumpAMIFvPatchScalarField + ( + const energyJumpAMIFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + energyJumpAMIFvPatchScalarField + ( + const energyJumpAMIFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchField<scalar> > clone() const + { + return tmp<fvPatchField<scalar> > + ( + new energyJumpAMIFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + energyJumpAMIFvPatchScalarField + ( + const energyJumpAMIFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchField<scalar> > clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchField<scalar> > + ( + new energyJumpAMIFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients + virtual void updateCoeffs(); + + + //- Write + virtual void write(Ostream&) const; +}; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.C b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.C new file mode 100644 index 0000000000000000000000000000000000000000..5368a17bf2f03950fee011c5dd6f0f149195873d --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.C @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + + +\*---------------------------------------------------------------------------*/ + +#include "temperatureJumpAMIBase.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(temperatureJumpAMIBase, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::temperatureJumpAMIBase::temperatureJumpAMIBase() +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::temperatureJumpAMIBase::~temperatureJumpAMIBase() +{} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.H new file mode 100644 index 0000000000000000000000000000000000000000..79246c7080286d07783a251a3dc82100b0e112a3 --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpAMIBase.H @@ -0,0 +1,79 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Description + Base class for temperature jump boundary conditions that provides access + to the jump field + +SourceFiles + temperatureJumpBase.C + +\*---------------------------------------------------------------------------*/ + +#ifndef temperatureJumpAMIBase_H +#define temperatureJumpAMIBase_H + +#include "typeInfo.H" +#include "scalarField.H" +#include "tmp.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class temperatureJumpAMIBase Declaration +\*---------------------------------------------------------------------------*/ + +class temperatureJumpAMIBase +{ + +public: + + //- Runtime type information + TypeName("temperatureJumpAMIBase"); + + //- Construct null + temperatureJumpAMIBase(); + + + //- Destructor + virtual ~temperatureJumpAMIBase(); + + + // Member functions + + //- Return a field of the temperature jump + virtual tmp<scalarField> jump() const = 0; +}; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.C b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.C new file mode 100644 index 0000000000000000000000000000000000000000..afd18c09243b0d99db2acef2719e1c961c4550c1 --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.C @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + + +\*---------------------------------------------------------------------------*/ + +#include "temperatureJumpBase.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(temperatureJumpBase, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::temperatureJumpBase::temperatureJumpBase() +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::temperatureJumpBase::~temperatureJumpBase() +{} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.H new file mode 100644 index 0000000000000000000000000000000000000000..32744fd47a751d91ec02f265a94e3c9202c3812d --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/temperatureJumpBase/temperatureJumpBase.H @@ -0,0 +1,79 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Description + Base class for temperature jump boundary conditions that provides access + to the jump field + +SourceFiles + temperatureJumpBase.C + +\*---------------------------------------------------------------------------*/ + +#ifndef temperatureJumpBase_H +#define temperatureJumpBase_H + +#include "typeInfo.H" +#include "scalarField.H" +#include "tmp.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class temperatureJumpBase Declaration +\*---------------------------------------------------------------------------*/ + +class temperatureJumpBase +{ + +public: + + //- Runtime type information + TypeName("temperatureJumpBase"); + + //- Construct null + temperatureJumpBase(); + + + //-Destructor + virtual ~temperatureJumpBase(); + + + // Member functions + + //- Return a field of the temperature jump + virtual tmp<scalarField> jump() const = 0; +}; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..5e9a302c4737e8d354f5886d8ca288f548c3a9bd --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.C @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "addToRunTimeSelectionTable.H" +#include "uniformTemperatureJumpFvPatchScalarField.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::uniformTemperatureJumpFvPatchScalarField:: +uniformTemperatureJumpFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + uniformJumpFvPatchField<scalar>(p, iF) +{} + + +Foam::uniformTemperatureJumpFvPatchScalarField:: +uniformTemperatureJumpFvPatchScalarField +( + const uniformTemperatureJumpFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + uniformJumpFvPatchField<scalar>(ptf, p, iF, mapper) +{} + + +Foam::uniformTemperatureJumpFvPatchScalarField:: +uniformTemperatureJumpFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + uniformJumpFvPatchField<scalar>(p, iF) +{} + + +Foam::uniformTemperatureJumpFvPatchScalarField:: +uniformTemperatureJumpFvPatchScalarField +( + const uniformTemperatureJumpFvPatchScalarField& ptf +) +: + uniformJumpFvPatchField<scalar>(ptf) +{} + + +Foam::uniformTemperatureJumpFvPatchScalarField:: +uniformTemperatureJumpFvPatchScalarField +( + const uniformTemperatureJumpFvPatchScalarField& ptf, + const DimensionedField<scalar, volMesh>& iF +) +: + uniformJumpFvPatchField<scalar>(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + uniformTemperatureJumpFvPatchScalarField + ); +} + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H similarity index 71% rename from src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.H rename to src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H index 0663a1cb86745144c31881f95d2629d0f130c169..6dbae8d7073345036dac16fdc04e38ba824d0eb8 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJump/uniformTemperatureJumpFvPatchScalarField.H @@ -22,14 +22,14 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::temperatureJumpFvPatchScalarField + Foam::uniformTemperatureJumpFvPatchScalarField Group grpCoupledBoundaryConditions Description This boundary condition provides a temperature jump condition across a - coupled pair of cyclic patches. + coupled pair of cyclic patches, when solving for energy. The jump is specified as a \c DataEntry type, to enable the use of, e.g. contant, polynomial, table values. @@ -39,7 +39,6 @@ Description \table Property | Description | Required | Default value patchType | underlying patch type should be \c cyclic| yes | - jump | current jump value | yes | jumpTable | jump data, e.g. \c csvFile | yes | \endtable @@ -47,31 +46,32 @@ Description \verbatim myPatch { - type temperatureJump; + type uniformTemperatureJump; patchType cyclic; jumpTable constant 100; value uniform 300; } \endverbatim - The above example shows the use of a constant jump condition. + The above example shows the use of a constant jump condition of 300 K. Note The underlying \c patchType should be set to \c cyclic SeeAlso - Foam::fixedJumpFvPatchField + Foam::uniformJumpFvPatchField + Foam::energyJumpFvPatchScalarField SourceFiles - temperatureJumpFvPatchScalarField.C + uniformTemperatureJumpFvPatchScalarField.C \*---------------------------------------------------------------------------*/ -#ifndef temperatureJumpFvPatchScalarField_H -#define temperatureJumpFvPatchScalarField_H +#ifndef uniformTemperatureJumpFvPatchScalarField_H +#define uniformTemperatureJumpFvPatchScalarField_H -#include "fixedJumpFvPatchField.H" -#include "DataEntry.H" +#include "temperatureJumpBase.H" +#include "uniformJumpFvPatchField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -79,56 +79,51 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class temperatureJumpFvPatchScalarField Declaration + Class uniformTemperatureJumpFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ -class temperatureJumpFvPatchScalarField +class uniformTemperatureJumpFvPatchScalarField : - public fixedJumpFvPatchField<scalar> + public temperatureJumpBase, + public uniformJumpFvPatchField<scalar> { - // Private data - - //- Interpolation table - autoPtr<DataEntry<scalar> > jumpTable_; - - public: //- Runtime type information - TypeName("temperatureJump"); + TypeName("uniformTemperatureJump"); // Constructors //- Construct from patch and internal field - temperatureJumpFvPatchScalarField + uniformTemperatureJumpFvPatchScalarField ( const fvPatch&, const DimensionedField<scalar, volMesh>& ); //- Construct from patch, internal field and dictionary - temperatureJumpFvPatchScalarField + uniformTemperatureJumpFvPatchScalarField ( const fvPatch&, const DimensionedField<scalar, volMesh>&, const dictionary& ); - //- Construct by mapping given temperatureJumpFvPatchScalarField onto a - // new patch - temperatureJumpFvPatchScalarField + //- Construct by mapping given + // uniformTemperatureJumpFvPatchScalarField onto a new patch + uniformTemperatureJumpFvPatchScalarField ( - const temperatureJumpFvPatchScalarField&, + const uniformTemperatureJumpFvPatchScalarField&, const fvPatch&, const DimensionedField<scalar, volMesh>&, const fvPatchFieldMapper& ); //- Construct as copy - temperatureJumpFvPatchScalarField + uniformTemperatureJumpFvPatchScalarField ( - const temperatureJumpFvPatchScalarField& + const uniformTemperatureJumpFvPatchScalarField& ); //- Construct and return a clone @@ -136,14 +131,14 @@ public: { return tmp<fvPatchField<scalar> > ( - new temperatureJumpFvPatchScalarField(*this) + new uniformTemperatureJumpFvPatchScalarField(*this) ); } //- Construct as copy setting internal field reference - temperatureJumpFvPatchScalarField + uniformTemperatureJumpFvPatchScalarField ( - const temperatureJumpFvPatchScalarField&, + const uniformTemperatureJumpFvPatchScalarField&, const DimensionedField<scalar, volMesh>& ); @@ -155,25 +150,17 @@ public: { return tmp<fvPatchField<scalar> > ( - new temperatureJumpFvPatchScalarField(*this, iF) + new uniformTemperatureJumpFvPatchScalarField(*this, iF) ); } - // Member functions - - - // Access functions + // Member Functions - //- Return jumpTable - const DataEntry<scalar>& jumpTable() const - { - return jumpTable_(); - } - - - //- Write - virtual void write(Ostream&) const; + virtual tmp<Field<scalar> > jump() const + { + return uniformJumpFvPatchField::jump(); + } }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..379fffb7e37561c9c47401da2ee1f732e4ec8e6f --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.C @@ -0,0 +1,100 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "addToRunTimeSelectionTable.H" +#include "uniformTemperatureJumpAMIFvPatchScalarField.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::uniformTemperatureJumpAMIFvPatchScalarField:: +uniformTemperatureJumpAMIFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + uniformJumpAMIFvPatchField<scalar>(p, iF) +{} + + +Foam::uniformTemperatureJumpAMIFvPatchScalarField:: +uniformTemperatureJumpAMIFvPatchScalarField +( + const uniformTemperatureJumpAMIFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + uniformJumpAMIFvPatchField<scalar>(ptf, p, iF, mapper) +{} + + +Foam::uniformTemperatureJumpAMIFvPatchScalarField:: +uniformTemperatureJumpAMIFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + uniformJumpAMIFvPatchField<scalar>(p, iF) +{} + + +Foam::uniformTemperatureJumpAMIFvPatchScalarField:: +uniformTemperatureJumpAMIFvPatchScalarField +( + const uniformTemperatureJumpAMIFvPatchScalarField& ptf +) +: + uniformJumpAMIFvPatchField<scalar>(ptf) +{} + + +Foam::uniformTemperatureJumpAMIFvPatchScalarField:: +uniformTemperatureJumpAMIFvPatchScalarField +( + const uniformTemperatureJumpAMIFvPatchScalarField& ptf, + const DimensionedField<scalar, volMesh>& iF +) +: + uniformJumpAMIFvPatchField<scalar>(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + uniformTemperatureJumpAMIFvPatchScalarField + ); +} + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..9fd8c23ae4fa64bda33c55e4bc0543403416ab39 --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/temperatureJump/uniformTemperatureJumpAMI/uniformTemperatureJumpAMIFvPatchScalarField.H @@ -0,0 +1,175 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::uniformTemperatureJumpAMIFvPatchScalarField + +Group + grpCoupledBoundaryConditions + +Description + This boundary condition provides a temperature jump condition across a + coupled pair of non-conformal cyclic patches using an arbitrary mesh + interface (AMI), when solving for energy. + + The jump is specified as a \c DataEntry type, to enable the use of, e.g. + contant, polynomial, table values. + + \heading Patch usage + + \table + Property | Description | Required | Default value + patchType | underlying patch type should be \c cyclicAMI| yes | + jumpTable | jump data, e.g. \c csvFile | yes | + \endtable + + Example of the boundary condition specification: + \verbatim + myPatch + { + type uniformTemperatureJumpAMI; + patchType cyclic; + jumpTable constant 100; + value uniform 300; + } + \endverbatim + + The above example shows the use of a constant jump condition of 300 K. + +Note + The underlying \c patchType should be set to \c cyclicAMI + +SeeAlso + Foam::uniformJumpAMIFvPatchField + Foam::energyJumpAMIFvPatchScalarField + +SourceFiles + uniformTemperatureJumpAMIFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformTemperatureJumpAMIFvPatchScalarField_H +#define uniformTemperatureJumpAMIFvPatchScalarField_H + +#include "temperatureJumpAMIBase.H" +#include "uniformJumpAMIFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class uniformTemperatureJumpAMIFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class uniformTemperatureJumpAMIFvPatchScalarField +: + public temperatureJumpAMIBase, + public uniformJumpAMIFvPatchField<scalar> +{ + +public: + + //- Runtime type information + TypeName("uniformTemperatureJumpAMI"); + + // Constructors + + //- Construct from patch and internal field + uniformTemperatureJumpAMIFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + uniformTemperatureJumpAMIFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given + // uniformTemperatureJumpAMIFvPatchScalarField onto a new patch + uniformTemperatureJumpAMIFvPatchScalarField + ( + const uniformTemperatureJumpAMIFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + uniformTemperatureJumpAMIFvPatchScalarField + ( + const uniformTemperatureJumpAMIFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchField<scalar> > clone() const + { + return tmp<fvPatchField<scalar> > + ( + new uniformTemperatureJumpAMIFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + uniformTemperatureJumpAMIFvPatchScalarField + ( + const uniformTemperatureJumpAMIFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchField<scalar> > clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchField<scalar> > + ( + new uniformTemperatureJumpAMIFvPatchScalarField(*this, iF) + ); + } + + + // Member Functions + + virtual tmp<Field<scalar> > jump() const + { + return uniformJumpAMIFvPatchField::jump(); + } +}; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.C b/src/thermophysicalModels/basic/heThermo/heThermo.C index 4cace549800e870c736df2ae1464a4d123ab615f..d0b455b7aa6308c6b9832244e6054f9753f1d9c6 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.C +++ b/src/thermophysicalModels/basic/heThermo/heThermo.C @@ -28,8 +28,10 @@ License #include "fixedEnergyFvPatchScalarField.H" #include "gradientEnergyFvPatchScalarField.H" #include "mixedEnergyFvPatchScalarField.H" -#include "temperatureJumpFvPatchScalarField.H" +#include "temperatureJumpBase.H" +#include "temperatureJumpAMIBase.H" #include "energyJumpFvPatchScalarField.H" +#include "energyJumpAMIFvPatchScalarField.H" // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -59,10 +61,14 @@ Foam::wordList Foam::heThermo<BasicThermo, MixtureType>::heBoundaryTypes() { hbt[patchi] = mixedEnergyFvPatchScalarField::typeName; } - else if (isA<temperatureJumpFvPatchScalarField>(tbf[patchi])) + else if (isA<temperatureJumpBase>(tbf[patchi])) { hbt[patchi] = energyJumpFvPatchScalarField::typeName; } + else if (isA<temperatureJumpAMIBase>(tbf[patchi])) + { + hbt[patchi] = energyJumpAMIFvPatchScalarField::typeName; + } } return hbt; diff --git a/src/thermophysicalModels/reactionThermo/Make/options b/src/thermophysicalModels/reactionThermo/Make/options index 9dad3910dd9b75e5495d69a22ad669c973dcbd5d..8c18cf8318024f42bb1525dd6e0884982f801738 100644 --- a/src/thermophysicalModels/reactionThermo/Make/options +++ b/src/thermophysicalModels/reactionThermo/Make/options @@ -1,7 +1,11 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -lfluidThermophysicalModels \ + -lspecie \ + -lmeshTools diff --git a/tutorials/incompressible/pimpleFoam/TJunctionFan/0/p b/tutorials/incompressible/pimpleFoam/TJunctionFan/0/p index 16a8bb50eddb376e9a4d3efbbf94db59b3126a2b..e69dbaddef297209acae529c13477d797fc2e80d 100644 --- a/tutorials/incompressible/pimpleFoam/TJunctionFan/0/p +++ b/tutorials/incompressible/pimpleFoam/TJunctionFan/0/p @@ -56,7 +56,6 @@ boundaryField { type fan; patchType cyclic; - jump uniform 0; jumpTable polynomial 2 @@ -71,7 +70,6 @@ boundaryField { type fan; patchType cyclic; - jump uniform 0; value uniform 0; } defaultFaces diff --git a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/controlDict b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/controlDict index 13e3d95facdd911b10dca02fd2236d3355211e63..d8e11662d8eab7c6d1a2a7254f51d78ad931b714 100644 --- a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/controlDict +++ b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/controlDict @@ -48,6 +48,7 @@ runTimeModifiable yes; adjustTimeStep on; maxCo 0.5; +maxAlphaCo 0.5; maxDeltaT 1; // ************************************************************************* // diff --git a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/fvSolution b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/fvSolution index a4e4e913ec6feecc616f1d46f18592c27713a6e5..19d27d99becf5739284643fa38934c9dc77f7cc8 100644 --- a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/fvSolution +++ b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/fvSolution @@ -21,7 +21,7 @@ solvers { solver smoothSolver; smoother GaussSeidel; - tolerance 1e-7; + tolerance 1e-9; relTol 0; nSweeps 1; } @@ -66,6 +66,7 @@ PIMPLE nOuterCorrectors 1; nCorrectors 2; nNonOrthogonalCorrectors 0; + nAlphaSubCycles 2; pRefValue 0; pRefPoint (0.1 0.1 1); }