diff --git a/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C b/applications/solvers/compressible/rhoCentralFoam/rhoCentralFoam.C index 063aaa4fb5..84a122d0dd 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 2d70a5bab5..be34ab52ed 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 ade8af0081..0000000000 --- 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 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 b9f52944e8..acf563fc8e 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 7c24e05a1a..54c246f203 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 06811c2191..9d221b5ca9 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 0c2cf71e4e..5f5ac824b8 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 b59b0ae5fe..6c82f94049 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 042a17e1f3..5cbbc0b3ab 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 fa56de00bb..6c82f94049 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 3d450a3917..ee92734509 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 559916f2ce..69eb0964ce 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 244ea75fae..795b7c14a1 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 d816f8aced..97a09ce017 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 d4b1194ba1..33647cd28d 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 6e02524e26..ad2cf243d2 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 5ed807bbad..00a7976a2e 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 c8ce69c074..6e20519ec9 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 0000000000..139646e43c --- /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 d152baba0b..c68a0e56c5 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 0000000000..6c82f94049 --- /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 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 8a2b20e153..6113aba01f 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 d13d012468..eee3fd6894 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)/uniformFixedValue/uniformFixedValueFvPatchFields.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)/uniformFixedValue/uniformFixedValueFvPatchFields.C +$(derivedFvPatchFields)/uniformJump/uniformJumpFvPatchFields.C +$(derivedFvPatchFields)/uniformJumpAMI/uniformJumpAMIFvPatchFields.C +$(derivedFvPatchFields)/uniformTotalPressure/uniformTotalPressureFvPatchScalarField.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 193008daff..67bc7f96db 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclic/jumpCyclicFvPatchField.C @@ -105,12 +105,12 @@ tmp > jumpCyclicFvPatchField::patchNeighbourField() const tmp > tpnf(new Field(this->size())); Field& pnf = tpnf(); - tmp > tjf = jump(); + tmp > tjf = jump(); if (!this->cyclicPatch().owner()) { tjf = -tjf; } - const Field& jf = tjf(); + const Field& jf = tjf(); if (this->doTransform()) { @@ -149,7 +149,8 @@ void jumpCyclicFvPatchField::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 > tjf = jump()().component(cmpt); if (!this->cyclicPatch().owner()) @@ -197,7 +198,8 @@ void jumpCyclicFvPatchField::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 > 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 0000000000..87d7c20efd --- /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 . + +\*---------------------------------------------------------------------------*/ + +#include "jumpCyclicAMIFvPatchField.H" +#include "transformField.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::jumpCyclicAMIFvPatchField::jumpCyclicAMIFvPatchField +( + const fvPatch& p, + const DimensionedField& iF +) +: + cyclicAMIFvPatchField(p, iF) +{} + + +template +Foam::jumpCyclicAMIFvPatchField::jumpCyclicAMIFvPatchField +( + const jumpCyclicAMIFvPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + cyclicAMIFvPatchField(ptf, p, iF, mapper) +{} + + +template +Foam::jumpCyclicAMIFvPatchField::jumpCyclicAMIFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + cyclicAMIFvPatchField(p, iF, dict) +{ + // Call this evaluation in derived classes + //this->evaluate(Pstream::blocking); +} + + +template +Foam::jumpCyclicAMIFvPatchField::jumpCyclicAMIFvPatchField +( + const jumpCyclicAMIFvPatchField& ptf +) +: + cyclicAMIFvPatchField(ptf) +{} + + +template +Foam::jumpCyclicAMIFvPatchField::jumpCyclicAMIFvPatchField +( + const jumpCyclicAMIFvPatchField& ptf, + const DimensionedField& iF +) +: + cyclicAMIFvPatchField(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Foam::tmp > +Foam::jumpCyclicAMIFvPatchField::patchNeighbourField() const +{ + const Field& iField = this->internalField(); + const labelUList& nbrFaceCells = + this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells(); + + Field pnf(iField, nbrFaceCells); + tmp > tpnf + ( + new Field(this->cyclicAMIPatch().interpolate(pnf)) + ); + + if (this->doTransform()) + { + tpnf = transform(this->forwardT(), tpnf); + } + + tmp > tjf = jump(); + if (!this->cyclicAMIPatch().owner()) + { + tjf = -tjf; + } + + return tpnf - tjf; +} + + +template +void Foam::jumpCyclicAMIFvPatchField::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 > 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 +void Foam::jumpCyclicAMIFvPatchField::updateInterfaceMatrix +( + Field& result, + const Field& psiInternal, + const scalarField& coeffs, + const Pstream::commsTypes +) const +{ + const labelUList& nbrFaceCells = + this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells(); + + Field pnf(psiInternal, nbrFaceCells); + + pnf = this->cyclicAMIPatch().interpolate(pnf); + + // for AMG solve - only apply jump to finest level + if (psiInternal.size() == this->internalField().size()) + { + tmp > 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 0000000000..6759b09a36 --- /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 . + +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 jumpCyclicAMIFvPatchField +: + public cyclicAMIFvPatchField +{ + +public: + + //- Runtime type information + TypeName("jumpCyclicAMI"); + + + // Constructors + + //- Construct from patch and internal field + jumpCyclicAMIFvPatchField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + jumpCyclicAMIFvPatchField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given jumpCyclicAMIFvPatchField onto a + // new patch + jumpCyclicAMIFvPatchField + ( + const jumpCyclicAMIFvPatchField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + jumpCyclicAMIFvPatchField + ( + const jumpCyclicAMIFvPatchField& + ); + + //- Construct as copy setting internal field reference + jumpCyclicAMIFvPatchField + ( + const jumpCyclicAMIFvPatchField&, + const DimensionedField& + ); + + + // Member functions + + // Access + + //- Return the interface type + virtual const word& interfaceFieldType() const + { + return cyclicAMIFvPatchField::type(); + } + + //- Return the "jump" across the patch as a "half" field + virtual tmp > jump() const = 0; + + + // Evaluation functions + + //- Return neighbour coupled given internal cell data + tmp > 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&, + const Field&, + 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 0000000000..323f460d9f --- /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 . + +\*---------------------------------------------------------------------------*/ + +#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 0000000000..6f5039e0bc --- /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 . + +\*---------------------------------------------------------------------------*/ + +#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 0000000000..c4bc6547b0 --- /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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef jumpCyclicAMIFvPatchFieldsFwd_H +#define jumpCyclicAMIFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template 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 477b242b76..3a150c6f70 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::fanFvPatchField const DimensionedField& iF ) : - fixedJumpFvPatchField(p, iF), - jumpTable_(0) + uniformJumpFvPatchField(p, iF) {} @@ -48,8 +47,7 @@ Foam::fanFvPatchField::fanFvPatchField const fvPatchFieldMapper& mapper ) : - fixedJumpFvPatchField(ptf, p, iF, mapper), - jumpTable_(ptf.jumpTable_().clone().ptr()) + uniformJumpFvPatchField(ptf, p, iF, mapper) {} @@ -61,8 +59,7 @@ Foam::fanFvPatchField::fanFvPatchField const dictionary& dict ) : - fixedJumpFvPatchField(p, iF), - jumpTable_(DataEntry::New("jumpTable", dict)) + uniformJumpFvPatchField(p, iF, dict) {} @@ -72,9 +69,7 @@ Foam::fanFvPatchField::fanFvPatchField const fanFvPatchField& ptf ) : - cyclicLduInterfaceField(), - fixedJumpFvPatchField(ptf), - jumpTable_(ptf.jumpTable_().clone().ptr()) + uniformJumpFvPatchField(ptf) {} @@ -85,25 +80,8 @@ Foam::fanFvPatchField::fanFvPatchField const DimensionedField& iF ) : - fixedJumpFvPatchField(ptf, iF), - jumpTable_(ptf.jumpTable_().clone().ptr()) + uniformJumpFvPatchField(ptf, iF) {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - - -template -void Foam::fanFvPatchField::write(Ostream& os) const -{ - - fixedJumpFvPatchField::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 3eea1382f3..463ebeb543 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 fanFvPatchField : - public fixedJumpFvPatchField + public uniformJumpFvPatchField { - // Private data - - //- Interpolation table - autoPtr > 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 1b291d500c..1c8e934892 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::fanFvPatchField const dictionary& dict ) : - fixedJumpFvPatchField(p, iF), - jumpTable_(new DataEntry("jumpTable")) + uniformJumpFvPatchField(p, iF) { if (this->cyclicPatch().owner()) { @@ -83,7 +82,7 @@ Foam::fanFvPatchField::fanFvPatchField } } - jumpTable_.reset + this->jumpTable_.reset ( new polynomial("jumpTable", coeffs) ); @@ -91,9 +90,14 @@ Foam::fanFvPatchField::fanFvPatchField else { // Generic input constructed from dictionary - jumpTable_ = DataEntry::New("jumpTable", dict); + this->jumpTable_ = DataEntry::New("jumpTable", dict); } } + else + { + // Generic input constructed from dictionary + this->jumpTable_.reset(new DataEntry("jumpTable")); + } if (dict.found("value")) @@ -136,10 +140,10 @@ void Foam::fanFvPatchField::updateCoeffs() Un /= patch().lookupPatchField("rho"); } - jump_ = jumpTable_->value(Un); + this->jump_ = this->jumpTable_->value(Un); } - fixedJumpFvPatchField::updateCoeffs(); + uniformJumpFvPatchField::updateCoeffs(); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJump/fixedJumpFvPatchField.C index fd2050ffcc..eb997abf36 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::fixedJumpFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +Foam::tmp > Foam::fixedJumpFvPatchField::jump() const +{ + if (this->cyclicPatch().owner()) + { + return jump_; + } + else + { + return refCast > + ( + this->neighbourPatchField() + ).jump(); + } +} + + template void Foam::fixedJumpFvPatchField::autoMap ( @@ -124,6 +141,7 @@ void Foam::fixedJumpFvPatchField::write(Ostream& os) const fvPatchField::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 30ec57fc54..ede9fea8af 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 + 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 > jump() const - { - if (this->cyclicPatch().owner()) - { - return jump_; - } - else - { - return refCast > - ( - this->neighbourPatchField() - ).jump(); - } - } + //- Return the "jump" across the patch + virtual tmp > 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 0000000000..b06849691a --- /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 . + +\*---------------------------------------------------------------------------*/ + +#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 0000000000..444d3259bd --- /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 . + +\*---------------------------------------------------------------------------*/ + +#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 0000000000..97a42cfa46 --- /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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedJumpFvPatchFieldsFwd_H +#define fixedJumpFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template 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 0000000000..d9cdc383a3 --- /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 . + +\*---------------------------------------------------------------------------*/ + +#include "fixedJumpAMIFvPatchField.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::fixedJumpAMIFvPatchField::fixedJumpAMIFvPatchField +( + const fvPatch& p, + const DimensionedField& iF +) +: + jumpCyclicAMIFvPatchField(p, iF), + jump_(this->size(), pTraits::zero) +{} + + +template +Foam::fixedJumpAMIFvPatchField::fixedJumpAMIFvPatchField +( + const fixedJumpAMIFvPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + jumpCyclicAMIFvPatchField(ptf, p, iF, mapper), + jump_(ptf.jump_, mapper) +{} + + +template +Foam::fixedJumpAMIFvPatchField::fixedJumpAMIFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + jumpCyclicAMIFvPatchField(p, iF), + jump_("jump", dict, p.size()) +{} + + +template +Foam::fixedJumpAMIFvPatchField::fixedJumpAMIFvPatchField +( + const fixedJumpAMIFvPatchField& ptf +) +: + jumpCyclicAMIFvPatchField(ptf), + jump_(ptf.jump_) +{} + + +template +Foam::fixedJumpAMIFvPatchField::fixedJumpAMIFvPatchField +( + const fixedJumpAMIFvPatchField& ptf, + const DimensionedField& iF +) +: + jumpCyclicAMIFvPatchField(ptf, iF), + jump_(ptf.jump_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Foam::tmp > Foam::fixedJumpAMIFvPatchField::jump() const +{ + if (this->cyclicAMIPatch().owner()) + { + return jump_; + } + else + { + const fixedJumpAMIFvPatchField& nbrPatch = + refCast > + ( + this->neighbourPatchField() + ); + + return this->cyclicAMIPatch().interpolate(nbrPatch.jump()); + } +} + + +template +void Foam::fixedJumpAMIFvPatchField::autoMap +( + const fvPatchFieldMapper& m +) +{ + jumpCyclicAMIFvPatchField::autoMap(m); + jump_.autoMap(m); +} + + +template +void Foam::fixedJumpAMIFvPatchField::rmap +( + const fvPatchField& ptf, + const labelList& addr +) +{ + jumpCyclicAMIFvPatchField::rmap(ptf, addr); + + const fixedJumpAMIFvPatchField& tiptf = + refCast >(ptf); + jump_.rmap(tiptf.jump_, addr); +} + + +template +void Foam::fixedJumpAMIFvPatchField::write(Ostream& os) const +{ + fvPatchField::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 0000000000..9a0c4bf520 --- /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 . + +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 fixedJumpAMIFvPatchField +: + public jumpCyclicAMIFvPatchField +{ + +protected: + + // Protected data + + //- "jump" field + Field jump_; + + +public: + + //- Runtime type information + TypeName("fixedJumpAMI"); + + + // Constructors + + //- Construct from patch and internal field + fixedJumpAMIFvPatchField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + fixedJumpAMIFvPatchField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given fixedJumpAMIFvPatchField onto a + // new patch + fixedJumpAMIFvPatchField + ( + const fixedJumpAMIFvPatchField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + fixedJumpAMIFvPatchField + ( + const fixedJumpAMIFvPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new fixedJumpAMIFvPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + fixedJumpAMIFvPatchField + ( + const fixedJumpAMIFvPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new fixedJumpAMIFvPatchField(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return the "jump" across the patch + virtual tmp > 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&, 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 0000000000..c28877d601 --- /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 . + +\*---------------------------------------------------------------------------*/ + +#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 0000000000..b0da67335a --- /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 . + +\*---------------------------------------------------------------------------*/ + +#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 0000000000..9231539cf3 --- /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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef fixedJumpAMIFvPatchFieldsFwd_H +#define fixedJumpAMIFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template 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 0000000000..88e7578141 --- /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 . + +\*---------------------------------------------------------------------------*/ + +#include "uniformJumpFvPatchField.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::uniformJumpFvPatchField::uniformJumpFvPatchField +( + const fvPatch& p, + const DimensionedField& iF +) +: + fixedJumpFvPatchField(p, iF), + jumpTable_(0) +{} + + +template +Foam::uniformJumpFvPatchField::uniformJumpFvPatchField +( + const uniformJumpFvPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + fixedJumpFvPatchField(ptf, p, iF, mapper), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +template +Foam::uniformJumpFvPatchField::uniformJumpFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + fixedJumpFvPatchField(p, iF), + jumpTable_(new DataEntry("jumpTable")) +{ + if (this->cyclicPatch().owner()) + { + jumpTable_ = DataEntry::New("jumpTable", dict); + } + + if (dict.found("value")) + { + fvPatchField::operator= + ( + Field("value", dict, p.size()) + ); + } +} + + +template +Foam::uniformJumpFvPatchField::uniformJumpFvPatchField +( + const uniformJumpFvPatchField& ptf +) +: + fixedJumpFvPatchField(ptf), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +template +Foam::uniformJumpFvPatchField::uniformJumpFvPatchField +( + const uniformJumpFvPatchField& ptf, + const DimensionedField& iF +) +: + fixedJumpFvPatchField(ptf, iF), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Foam::tmp > Foam::uniformJumpFvPatchField::jump() const +{ + if (this->cyclicPatch().owner()) + { + Type j = jumpTable_->value(this->db().time().value()); + + return tmp >(new Field(this->size(), j)); + } + else + { + const uniformJumpFvPatchField& nbrPatch = + refCast > + ( + this->neighbourPatchField() + ); + + return nbrPatch.jump(); + } +} + + +template +void Foam::uniformJumpFvPatchField::write(Ostream& os) const +{ + fixedJumpFvPatchField::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 0000000000..633dc1752e --- /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 . + +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 uniformJumpFvPatchField +: + public fixedJumpFvPatchField +{ + +protected: + + // Protected data + + //- "jump" table + autoPtr > jumpTable_; + + +public: + + //- Runtime type information + TypeName("uniformJump"); + + // Constructors + + //- Construct from patch and internal field + uniformJumpFvPatchField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + uniformJumpFvPatchField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given uniformJumpFvPatchField onto a + // new patch + uniformJumpFvPatchField + ( + const uniformJumpFvPatchField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + uniformJumpFvPatchField + ( + const uniformJumpFvPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new uniformJumpFvPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + uniformJumpFvPatchField + ( + const uniformJumpFvPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new uniformJumpFvPatchField(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return the "jump" across the patch. + virtual tmp > 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 0000000000..489ab5f633 --- /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 . + +\*---------------------------------------------------------------------------*/ + +#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 0000000000..e28916c383 --- /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 . + +\*---------------------------------------------------------------------------*/ + +#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 0000000000..e9bcac0bba --- /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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformJumpFvPatchFieldsFwd_H +#define uniformJumpFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template 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 0000000000..cb9ff6cd90 --- /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 . + +\*---------------------------------------------------------------------------*/ + +#include "uniformJumpAMIFvPatchField.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::uniformJumpAMIFvPatchField::uniformJumpAMIFvPatchField +( + const fvPatch& p, + const DimensionedField& iF +) +: + fixedJumpAMIFvPatchField(p, iF), + jumpTable_(0) +{} + + +template +Foam::uniformJumpAMIFvPatchField::uniformJumpAMIFvPatchField +( + const uniformJumpAMIFvPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + fixedJumpAMIFvPatchField(ptf, p, iF, mapper), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +template +Foam::uniformJumpAMIFvPatchField::uniformJumpAMIFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + fixedJumpAMIFvPatchField(p, iF), + jumpTable_(new DataEntry("jumpTable")) +{ + if (this->cyclicAMIPatch().owner()) + { + jumpTable_ = DataEntry::New("jumpTable", dict); + } + + if (dict.found("value")) + { + fvPatchField::operator=(Field("value", dict, p.size())); + } +} + + +template +Foam::uniformJumpAMIFvPatchField::uniformJumpAMIFvPatchField +( + const uniformJumpAMIFvPatchField& ptf +) +: + fixedJumpAMIFvPatchField(ptf), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +template +Foam::uniformJumpAMIFvPatchField::uniformJumpAMIFvPatchField +( + const uniformJumpAMIFvPatchField& ptf, + const DimensionedField& iF +) +: + fixedJumpAMIFvPatchField(ptf, iF), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Foam::tmp > +Foam::uniformJumpAMIFvPatchField::jump() const +{ + if (this->cyclicAMIPatch().owner()) + { + Type j = jumpTable_->value(this->db().time().value()); + + return tmp >(new Field(this->size(), j)); + } + else + { + const uniformJumpAMIFvPatchField& nbrPatch = + refCast > + ( + this->neighbourPatchField() + ); + + return this->cyclicAMIPatch().interpolate(nbrPatch.jump()); + } +} + + +template +void Foam::uniformJumpAMIFvPatchField::write(Ostream& os) const +{ + fixedJumpAMIFvPatchField::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 0000000000..e5eb2e6826 --- /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 . + +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 uniformJumpAMIFvPatchField +: + public fixedJumpAMIFvPatchField +{ + +protected: + + // Protected data + + //- "jump" table + autoPtr > jumpTable_; + + +public: + + //- Runtime type information + TypeName("uniformJumpAMI"); + + // Constructors + + //- Construct from patch and internal field + uniformJumpAMIFvPatchField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + uniformJumpAMIFvPatchField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given uniformJumpAMIFvPatchField onto a + // new patch + uniformJumpAMIFvPatchField + ( + const uniformJumpAMIFvPatchField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + uniformJumpAMIFvPatchField + ( + const uniformJumpAMIFvPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new uniformJumpAMIFvPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + uniformJumpAMIFvPatchField + ( + const uniformJumpAMIFvPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new uniformJumpAMIFvPatchField(*this, iF) + ); + } + + + // Member functions + + // Access + + //- Return the "jump" across the patch. + virtual tmp > 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 0000000000..f17f2849e8 --- /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 . + +\*---------------------------------------------------------------------------*/ + +#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 0000000000..0314210967 --- /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 . + +\*---------------------------------------------------------------------------*/ + +#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 0000000000..29080e7ec0 --- /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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef uniformJumpAMIFvPatchFieldsFwd_H +#define uniformJumpAMIFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class uniformJumpAMIFvPatchField; + +makePatchTypeFieldTypedefs(uniformJumpAMI); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/Make/files b/src/thermophysicalModels/basic/Make/files index 3dc3d0c082..d8ac16387b 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 16d886c766..5f64e9872d 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 d3ba1becdd..5f46273991 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(p, iF) { - if (dict.found("value")) { fvPatchScalarField::operator= @@ -77,7 +76,6 @@ Foam::energyJumpFvPatchScalarField::energyJumpFvPatchScalarField const energyJumpFvPatchScalarField& ptf ) : - cyclicLduInterfaceField(), fixedJumpFvPatchField(ptf) {} @@ -103,29 +101,21 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs() if (this->cyclicPatch().owner()) { - const basicThermo& thermo = db().lookupObject - ( - "thermophysicalProperties" - ); + const basicThermo& thermo = + db().lookupObject("thermophysicalProperties"); label patchID = patch().index(); const scalarField& pp = thermo.p().boundaryField()[patchID]; - const temperatureJumpFvPatchScalarField& TbPatch = - refCast + const temperatureJumpBase& TbPatch = + refCast ( 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::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 aae2d9597b..833072ad07 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 99be42e3d6..01cbc40488 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& iF ) : - fixedJumpFvPatchField(p, iF), - jumpTable_(0) + fixedJumpAMIFvPatchField(p, iF) {} -Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField +Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField ( - const temperatureJumpFvPatchScalarField& ptf, + const energyJumpAMIFvPatchScalarField& ptf, const fvPatch& p, const DimensionedField& iF, const fvPatchFieldMapper& mapper ) : - fixedJumpFvPatchField(ptf, p, iF, mapper), - jumpTable_(ptf.jumpTable_().clone().ptr()) + fixedJumpAMIFvPatchField(ptf, p, iF, mapper) {} -Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField +Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField ( const fvPatch& p, const DimensionedField& iF, const dictionary& dict ) : - fixedJumpFvPatchField(p, iF), - jumpTable_(new DataEntry("jumpTable")) + fixedJumpAMIFvPatchField(p, iF) { - - if (this->cyclicPatch().owner()) - { - jumpTable_ = DataEntry::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(ptf), - jumpTable_(ptf.jumpTable_().clone().ptr()) + fixedJumpAMIFvPatchField(ptf) {} -Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField +Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField ( - const temperatureJumpFvPatchScalarField& ptf, + const energyJumpAMIFvPatchScalarField& ptf, const DimensionedField& iF ) : - fixedJumpFvPatchField(ptf, iF), - jumpTable_(ptf.jumpTable_().clone().ptr()) + fixedJumpAMIFvPatchField(ptf, iF) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::temperatureJumpFvPatchScalarField::write(Ostream& os) const +void Foam::energyJumpAMIFvPatchScalarField::updateCoeffs() { - fixedJumpFvPatchField::write(os); - if (this->cyclicPatch().owner()) + if (this->updated()) { - jumpTable_->writeData(os); + return; } + + if (this->cyclicAMIPatch().owner()) + { + const basicThermo& thermo = + db().lookupObject("thermophysicalProperties"); + + label patchID = patch().index(); + + const scalarField& pp = thermo.p().boundaryField()[patchID]; + const temperatureJumpBase& TbPatch = + refCast + ( + thermo.T().boundaryField()[patchID] + ); + + const labelUList& faceCells = this->patch().faceCells(); + + jump_ = thermo.he(pp, TbPatch.jump(), faceCells); + } + + fixedJumpAMIFvPatchField::updateCoeffs(); +} + + +void Foam::energyJumpAMIFvPatchScalarField::write(Ostream& os) const +{ + fixedJumpAMIFvPatchField::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 0000000000..e000c6b200 --- /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 . + +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 +{ + +public: + + //- Runtime type information + TypeName("energyJumpAMI"); + + // Constructors + + //- Construct from patch and internal field + energyJumpAMIFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + energyJumpAMIFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given energyJumpAMIFvPatchScalarField onto a + // new patch + energyJumpAMIFvPatchScalarField + ( + const energyJumpAMIFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + energyJumpAMIFvPatchScalarField + ( + const energyJumpAMIFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new energyJumpAMIFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + energyJumpAMIFvPatchScalarField + ( + const energyJumpAMIFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + 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 0000000000..5368a17bf2 --- /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 . + + +\*---------------------------------------------------------------------------*/ + +#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 0000000000..79246c7080 --- /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 . + +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 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 0000000000..afd18c0924 --- /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 . + + +\*---------------------------------------------------------------------------*/ + +#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 0000000000..32744fd47a --- /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 . + +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 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 0000000000..5e9a302c47 --- /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 . + +\*---------------------------------------------------------------------------*/ + +#include "addToRunTimeSelectionTable.H" +#include "uniformTemperatureJumpFvPatchScalarField.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::uniformTemperatureJumpFvPatchScalarField:: +uniformTemperatureJumpFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + uniformJumpFvPatchField(p, iF) +{} + + +Foam::uniformTemperatureJumpFvPatchScalarField:: +uniformTemperatureJumpFvPatchScalarField +( + const uniformTemperatureJumpFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + uniformJumpFvPatchField(ptf, p, iF, mapper) +{} + + +Foam::uniformTemperatureJumpFvPatchScalarField:: +uniformTemperatureJumpFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + uniformJumpFvPatchField(p, iF) +{} + + +Foam::uniformTemperatureJumpFvPatchScalarField:: +uniformTemperatureJumpFvPatchScalarField +( + const uniformTemperatureJumpFvPatchScalarField& ptf +) +: + uniformJumpFvPatchField(ptf) +{} + + +Foam::uniformTemperatureJumpFvPatchScalarField:: +uniformTemperatureJumpFvPatchScalarField +( + const uniformTemperatureJumpFvPatchScalarField& ptf, + const DimensionedField& iF +) +: + uniformJumpFvPatchField(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 0663a1cb86..6dbae8d707 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 . 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 + public temperatureJumpBase, + public uniformJumpFvPatchField { - // Private data - - //- Interpolation table - autoPtr > jumpTable_; - - public: //- Runtime type information - TypeName("temperatureJump"); + TypeName("uniformTemperatureJump"); // Constructors //- Construct from patch and internal field - temperatureJumpFvPatchScalarField + uniformTemperatureJumpFvPatchScalarField ( const fvPatch&, const DimensionedField& ); //- Construct from patch, internal field and dictionary - temperatureJumpFvPatchScalarField + uniformTemperatureJumpFvPatchScalarField ( const fvPatch&, const DimensionedField&, 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&, const fvPatchFieldMapper& ); //- Construct as copy - temperatureJumpFvPatchScalarField + uniformTemperatureJumpFvPatchScalarField ( - const temperatureJumpFvPatchScalarField& + const uniformTemperatureJumpFvPatchScalarField& ); //- Construct and return a clone @@ -136,14 +131,14 @@ public: { return tmp > ( - new temperatureJumpFvPatchScalarField(*this) + new uniformTemperatureJumpFvPatchScalarField(*this) ); } //- Construct as copy setting internal field reference - temperatureJumpFvPatchScalarField + uniformTemperatureJumpFvPatchScalarField ( - const temperatureJumpFvPatchScalarField&, + const uniformTemperatureJumpFvPatchScalarField&, const DimensionedField& ); @@ -155,25 +150,17 @@ public: { return tmp > ( - new temperatureJumpFvPatchScalarField(*this, iF) + new uniformTemperatureJumpFvPatchScalarField(*this, iF) ); } - // Member functions + // Member Functions - - // Access functions - - //- Return jumpTable - const DataEntry& jumpTable() const - { - return jumpTable_(); - } - - - //- Write - virtual void write(Ostream&) const; + virtual tmp > 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 0000000000..379fffb7e3 --- /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 . + +\*---------------------------------------------------------------------------*/ + +#include "addToRunTimeSelectionTable.H" +#include "uniformTemperatureJumpAMIFvPatchScalarField.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::uniformTemperatureJumpAMIFvPatchScalarField:: +uniformTemperatureJumpAMIFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + uniformJumpAMIFvPatchField(p, iF) +{} + + +Foam::uniformTemperatureJumpAMIFvPatchScalarField:: +uniformTemperatureJumpAMIFvPatchScalarField +( + const uniformTemperatureJumpAMIFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + uniformJumpAMIFvPatchField(ptf, p, iF, mapper) +{} + + +Foam::uniformTemperatureJumpAMIFvPatchScalarField:: +uniformTemperatureJumpAMIFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + uniformJumpAMIFvPatchField(p, iF) +{} + + +Foam::uniformTemperatureJumpAMIFvPatchScalarField:: +uniformTemperatureJumpAMIFvPatchScalarField +( + const uniformTemperatureJumpAMIFvPatchScalarField& ptf +) +: + uniformJumpAMIFvPatchField(ptf) +{} + + +Foam::uniformTemperatureJumpAMIFvPatchScalarField:: +uniformTemperatureJumpAMIFvPatchScalarField +( + const uniformTemperatureJumpAMIFvPatchScalarField& ptf, + const DimensionedField& iF +) +: + uniformJumpAMIFvPatchField(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 0000000000..9fd8c23ae4 --- /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 . + +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 +{ + +public: + + //- Runtime type information + TypeName("uniformTemperatureJumpAMI"); + + // Constructors + + //- Construct from patch and internal field + uniformTemperatureJumpAMIFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + uniformTemperatureJumpAMIFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given + // uniformTemperatureJumpAMIFvPatchScalarField onto a new patch + uniformTemperatureJumpAMIFvPatchScalarField + ( + const uniformTemperatureJumpAMIFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + uniformTemperatureJumpAMIFvPatchScalarField + ( + const uniformTemperatureJumpAMIFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new uniformTemperatureJumpAMIFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + uniformTemperatureJumpAMIFvPatchScalarField + ( + const uniformTemperatureJumpAMIFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new uniformTemperatureJumpAMIFvPatchScalarField(*this, iF) + ); + } + + + // Member Functions + + virtual tmp > 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 4cace54980..d0b455b7aa 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::heBoundaryTypes() { hbt[patchi] = mixedEnergyFvPatchScalarField::typeName; } - else if (isA(tbf[patchi])) + else if (isA(tbf[patchi])) { hbt[patchi] = energyJumpFvPatchScalarField::typeName; } + else if (isA(tbf[patchi])) + { + hbt[patchi] = energyJumpAMIFvPatchScalarField::typeName; + } } return hbt; diff --git a/src/thermophysicalModels/reactionThermo/Make/options b/src/thermophysicalModels/reactionThermo/Make/options index 9dad3910dd..8c18cf8318 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 16a8bb50ed..e69dbaddef 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 13e3d95fac..d8e11662d8 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 a4e4e913ec..19d27d99be 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); }