Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
mattijs
2012-10-25 17:28:32 +01:00
71 changed files with 3189 additions and 305 deletions

View File

@ -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));

View File

@ -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();
}
}

View File

@ -1,40 +0,0 @@
{
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
surfaceScalarField phic(mag(phi/mesh.magSf()));
phic = min(interface.cAlpha()*phic, max(phic));
fvc::makeAbsolute(phi, U);
volScalarField divU(fvc::div(phi));
fvc::makeRelative(phi, U);
if (nAlphaSubCycles > 1)
{
dimensionedScalar totalDeltaT = runTime.deltaT();
surfaceScalarField rhoPhiSum(0.0*rhoPhi);
for
(
subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
!(++alphaSubCycle).end();
)
{
#include "alphaEqns.H"
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
}
rhoPhi = rhoPhiSum;
}
else
{
#include "alphaEqns.H"
}
// correct interface on first PIMPLE corrector
if (pimple.corr() == 1)
{
interface.correct();
}
}

View File

@ -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"

View File

@ -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"

View File

@ -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();

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -23,6 +23,4 @@ else
#include "alphaEqn.H"
}
interface.correct();
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;

View File

@ -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())

View File

@ -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())

View File

@ -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())

View File

@ -24,8 +24,6 @@ else
#include "alphaEqns.H"
}
interface.correct();
{
volScalarField rhoNew(alpha1*rho1 + alpha2*rho2 + alpha3*rho3);

View File

@ -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

View File

@ -40,10 +40,5 @@ surfaceScalarField rhoPhi
#include "alphaEqn.H"
}
if (pimple.nCorrPIMPLE() == 1)
{
interface.correct();
}
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;
}

View File

@ -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

View File

@ -1,4 +1,5 @@
EXE_INC = \
-I../interFoam \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \

View File

@ -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;

View File

@ -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;

View File

@ -0,0 +1,26 @@
label nAlphaCorr(readLabel(pimple.dict().lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(pimple.dict().lookup("nAlphaSubCycles")));
if (nAlphaSubCycles > 1)
{
dimensionedScalar totalDeltaT = runTime.deltaT();
surfaceScalarField rhoPhiSum(0.0*rhoPhi);
for
(
subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
!(++alphaSubCycle).end();
)
{
#include "alphaEqn.H"
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
}
rhoPhi = rhoPhiSum;
}
else
{
#include "alphaEqn.H"
}
rho == alpha1*rho1 + (scalar(1) - alpha1)*rho2;

View File

@ -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

View File

@ -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

View File

@ -105,12 +105,12 @@ tmp<Field<Type> > jumpCyclicFvPatchField<Type>::patchNeighbourField() const
tmp<Field<Type> > tpnf(new Field<Type>(this->size()));
Field<Type>& pnf = tpnf();
tmp<Field<scalar> > tjf = jump();
tmp<Field<Type> > tjf = jump();
if (!this->cyclicPatch().owner())
{
tjf = -tjf;
}
const Field<scalar>& jf = tjf();
const Field<Type>& jf = tjf();
if (this->doTransform())
{
@ -149,7 +149,8 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
const labelUList& nbrFaceCells =
this->cyclicPatch().neighbFvPatch().faceCells();
if (&psiInternal == &this->internalField())
// for AMG solve - only apply jump to finest level
if (psiInternal.size() == this->internalField().size())
{
tmp<Field<scalar> > tjf = jump()().component(cmpt);
if (!this->cyclicPatch().owner())
@ -197,7 +198,8 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
const labelUList& nbrFaceCells =
this->cyclicPatch().neighbFvPatch().faceCells();
if (&psiInternal == &this->internalField())
// for AMG solve - only apply jump to finest level
if (psiInternal.size() == this->internalField().size())
{
tmp<Field<Type> > tjf = jump();
if (!this->cyclicPatch().owner())

View File

@ -0,0 +1,201 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "jumpCyclicAMIFvPatchField.H"
#include "transformField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::jumpCyclicAMIFvPatchField<Type>::jumpCyclicAMIFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
cyclicAMIFvPatchField<Type>(p, iF)
{}
template<class Type>
Foam::jumpCyclicAMIFvPatchField<Type>::jumpCyclicAMIFvPatchField
(
const jumpCyclicAMIFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
cyclicAMIFvPatchField<Type>(ptf, p, iF, mapper)
{}
template<class Type>
Foam::jumpCyclicAMIFvPatchField<Type>::jumpCyclicAMIFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
cyclicAMIFvPatchField<Type>(p, iF, dict)
{
// Call this evaluation in derived classes
//this->evaluate(Pstream::blocking);
}
template<class Type>
Foam::jumpCyclicAMIFvPatchField<Type>::jumpCyclicAMIFvPatchField
(
const jumpCyclicAMIFvPatchField<Type>& ptf
)
:
cyclicAMIFvPatchField<Type>(ptf)
{}
template<class Type>
Foam::jumpCyclicAMIFvPatchField<Type>::jumpCyclicAMIFvPatchField
(
const jumpCyclicAMIFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
cyclicAMIFvPatchField<Type>(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type> >
Foam::jumpCyclicAMIFvPatchField<Type>::patchNeighbourField() const
{
const Field<Type>& iField = this->internalField();
const labelUList& nbrFaceCells =
this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells();
Field<Type> pnf(iField, nbrFaceCells);
tmp<Field<Type> > tpnf
(
new Field<Type>(this->cyclicAMIPatch().interpolate(pnf))
);
if (this->doTransform())
{
tpnf = transform(this->forwardT(), tpnf);
}
tmp<Field<Type> > tjf = jump();
if (!this->cyclicAMIPatch().owner())
{
tjf = -tjf;
}
return tpnf - tjf;
}
template<class Type>
void Foam::jumpCyclicAMIFvPatchField<Type>::updateInterfaceMatrix
(
scalarField& result,
const scalarField& psiInternal,
const scalarField& coeffs,
const direction cmpt,
const Pstream::commsTypes
) const
{
const labelUList& nbrFaceCells =
this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells();
scalarField pnf(psiInternal, nbrFaceCells);
pnf = this->cyclicAMIPatch().interpolate(pnf);
// for AMG solve - only apply jump to finest level
if (psiInternal.size() == this->internalField().size())
{
tmp<Field<scalar> > tjf = jump()().component(cmpt);
if (!this->cyclicAMIPatch().owner())
{
tjf = -tjf;
}
pnf -= tjf;
}
// Transform according to the transformation tensors
this->transformCoupleField(pnf, cmpt);
// Multiply the field by coefficients and add into the result
const labelUList& faceCells = this->cyclicAMIPatch().faceCells();
forAll(faceCells, elemI)
{
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
}
}
template<class Type>
void Foam::jumpCyclicAMIFvPatchField<Type>::updateInterfaceMatrix
(
Field<Type>& result,
const Field<Type>& psiInternal,
const scalarField& coeffs,
const Pstream::commsTypes
) const
{
const labelUList& nbrFaceCells =
this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells();
Field<Type> pnf(psiInternal, nbrFaceCells);
pnf = this->cyclicAMIPatch().interpolate(pnf);
// for AMG solve - only apply jump to finest level
if (psiInternal.size() == this->internalField().size())
{
tmp<Field<Type> > tjf = jump();
if (!this->cyclicAMIPatch().owner())
{
tjf = -tjf;
}
pnf -= tjf;
}
// Transform according to the transformation tensors
this->transformCoupleField(pnf);
// Multiply the field by coefficients and add into the result
const labelUList& faceCells = this->cyclicAMIPatch().faceCells();
forAll(faceCells, elemI)
{
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
}
}
// ************************************************************************* //

View File

@ -0,0 +1,165 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::jumpCyclicAMIFvPatchField
Group
grpCoupledBoundaryConditions
Description
This boundary condition provides a base class that enforces a cyclic
condition with a specified 'jump' (or offset) between a pair of boundaries,
whereby communication between the patches is performed using an arbitrary
mesh interface (AMI) interpolation.
SeeAlso
Foam::cyclicAMIFvPatchField
SourceFiles
jumpCyclicAMIFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef jumpCyclicAMIFvPatchField_H
#define jumpCyclicAMIFvPatchField_H
#include "cyclicAMIFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class jumpCyclicAMIFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class jumpCyclicAMIFvPatchField
:
public cyclicAMIFvPatchField<Type>
{
public:
//- Runtime type information
TypeName("jumpCyclicAMI");
// Constructors
//- Construct from patch and internal field
jumpCyclicAMIFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
jumpCyclicAMIFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given jumpCyclicAMIFvPatchField onto a
// new patch
jumpCyclicAMIFvPatchField
(
const jumpCyclicAMIFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
jumpCyclicAMIFvPatchField
(
const jumpCyclicAMIFvPatchField<Type>&
);
//- Construct as copy setting internal field reference
jumpCyclicAMIFvPatchField
(
const jumpCyclicAMIFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
// Member functions
// Access
//- Return the interface type
virtual const word& interfaceFieldType() const
{
return cyclicAMIFvPatchField<Type>::type();
}
//- Return the "jump" across the patch as a "half" field
virtual tmp<Field<Type> > jump() const = 0;
// Evaluation functions
//- Return neighbour coupled given internal cell data
tmp<Field<Type> > patchNeighbourField() const;
//- Update result field based on interface functionality
virtual void updateInterfaceMatrix
(
scalarField& result,
const scalarField& psiInternal,
const scalarField& coeffs,
const direction cmpt,
const Pstream::commsTypes commsType
) const;
//- Update result field based on interface functionality
virtual void updateInterfaceMatrix
(
Field<Type>&,
const Field<Type>&,
const scalarField&,
const Pstream::commsTypes commsType
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "jumpCyclicAMIFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "jumpCyclicAMIFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFieldsTypeName(jumpCyclicAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef jumpCyclicAMIFvPatchFields_H
#define jumpCyclicAMIFvPatchFields_H
#include "jumpCyclicAMIFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(jumpCyclicAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef jumpCyclicAMIFvPatchFieldsFwd_H
#define jumpCyclicAMIFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class jumpCyclicAMIFvPatchField;
makePatchTypeFieldTypedefs(jumpCyclicAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -34,8 +34,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const DimensionedField<Type, volMesh>& iF
)
:
fixedJumpFvPatchField<Type>(p, iF),
jumpTable_(0)
uniformJumpFvPatchField<Type>(p, iF)
{}
@ -48,8 +47,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const fvPatchFieldMapper& mapper
)
:
fixedJumpFvPatchField<Type>(ptf, p, iF, mapper),
jumpTable_(ptf.jumpTable_().clone().ptr())
uniformJumpFvPatchField<Type>(ptf, p, iF, mapper)
{}
@ -61,8 +59,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const dictionary& dict
)
:
fixedJumpFvPatchField<Type>(p, iF),
jumpTable_(DataEntry<Type>::New("jumpTable", dict))
uniformJumpFvPatchField<Type>(p, iF, dict)
{}
@ -72,9 +69,7 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const fanFvPatchField<Type>& ptf
)
:
cyclicLduInterfaceField(),
fixedJumpFvPatchField<Type>(ptf),
jumpTable_(ptf.jumpTable_().clone().ptr())
uniformJumpFvPatchField<Type>(ptf)
{}
@ -85,25 +80,8 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
const DimensionedField<Type, volMesh>& iF
)
:
fixedJumpFvPatchField<Type>(ptf, iF),
jumpTable_(ptf.jumpTable_().clone().ptr())
uniformJumpFvPatchField<Type>(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::fanFvPatchField<Type>::write(Ostream& os) const
{
fixedJumpFvPatchField<Type>::write(os);
if (this->cyclicPatch().owner())
{
jumpTable_->writeData(os);
}
this->writeEntry("value", os);
}
// ************************************************************************* //

View File

@ -83,7 +83,7 @@ SourceFiles
#ifndef fanFvPatchField_H
#define fanFvPatchField_H
#include "fixedJumpFvPatchField.H"
#include "uniformJumpFvPatchField.H"
#include "DataEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -98,13 +98,8 @@ namespace Foam
template<class Type>
class fanFvPatchField
:
public fixedJumpFvPatchField<Type>
public uniformJumpFvPatchField<Type>
{
// Private data
//- Interpolation table
autoPtr<DataEntry<Type> > jumpTable_;
public:
@ -179,10 +174,6 @@ public:
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};

View File

@ -53,8 +53,7 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
const dictionary& dict
)
:
fixedJumpFvPatchField<scalar>(p, iF),
jumpTable_(new DataEntry<scalar>("jumpTable"))
uniformJumpFvPatchField<scalar>(p, iF)
{
if (this->cyclicPatch().owner())
{
@ -83,7 +82,7 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
}
}
jumpTable_.reset
this->jumpTable_.reset
(
new polynomial("jumpTable", coeffs)
);
@ -91,9 +90,14 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
else
{
// Generic input constructed from dictionary
jumpTable_ = DataEntry<scalar>::New("jumpTable", dict);
this->jumpTable_ = DataEntry<scalar>::New("jumpTable", dict);
}
}
else
{
// Generic input constructed from dictionary
this->jumpTable_.reset(new DataEntry<scalar>("jumpTable"));
}
if (dict.found("value"))
@ -136,10 +140,10 @@ void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs()
Un /= patch().lookupPatchField<volScalarField, scalar>("rho");
}
jump_ = jumpTable_->value(Un);
this->jump_ = this->jumpTable_->value(Un);
}
fixedJumpFvPatchField<scalar>::updateCoeffs();
uniformJumpFvPatchField<scalar>::updateCoeffs();
}

View File

@ -92,6 +92,23 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::fixedJumpFvPatchField<Type>::jump() const
{
if (this->cyclicPatch().owner())
{
return jump_;
}
else
{
return refCast<const fixedJumpFvPatchField<Type> >
(
this->neighbourPatchField()
).jump();
}
}
template<class Type>
void Foam::fixedJumpFvPatchField<Type>::autoMap
(
@ -124,6 +141,7 @@ void Foam::fixedJumpFvPatchField<Type>::write(Ostream& os) const
fvPatchField<Type>::write(os);
os.writeKeyword("patchType") << "cyclic" << token::END_STATEMENT << nl;
jump_.writeEntry("jump", os);
this->writeEntry("value", os);
}

View File

@ -28,14 +28,37 @@ Group
grpCoupledBoundaryConditions
Description
Base class for "jump" of a field<type>
This boundary condition provides a jump condition, using the \c cyclic
condition as a base.
The jump is specified as a fixed value field, applied as an offset to the
'owner' patch.
\heading Patch usage
\table
Property | Description | Required | Default value
patchType | underlying patch type should be \c cyclic| yes |
jump | current jump value | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type fixedJump;
patchType cyclic;
jump uniform 10;
}
\endverbatim
The above example shows the use of a fixed jump of '10'.
Note
not used directly
The underlying \c patchType should be set to \c cyclic
SeeAlso
Foam::fanFvPatchScalarField
Foam::fanPressureFvPatchScalarField
Foam::jumpCyclicFvPatchField
SourceFiles
fixedJumpFvPatchField.C
@ -72,6 +95,9 @@ protected:
public:
//- Runtime type information
TypeName("fixedJump");
// Constructors
//- Construct from patch and internal field
@ -138,21 +164,8 @@ public:
// Access
//- Return the "jump" across the patch.
virtual tmp<Field<Type> > jump() const
{
if (this->cyclicPatch().owner())
{
return jump_;
}
else
{
return refCast<const fixedJumpFvPatchField<Type> >
(
this->neighbourPatchField()
).jump();
}
}
//- Return the "jump" across the patch
virtual tmp<Field<Type> > jump() const;
// Mapping functions

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "fixedJumpFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(fixedJump);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef fixedJumpFvPatchFields_H
#define fixedJumpFvPatchFields_H
#include "fixedJumpFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(fixedJump);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef fixedJumpFvPatchFieldsFwd_H
#define fixedJumpFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class fixedJumpFvPatchField;
makePatchTypeFieldTypedefs(fixedJump);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,150 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "fixedJumpAMIFvPatchField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
jumpCyclicAMIFvPatchField<Type>(p, iF),
jump_(this->size(), pTraits<Type>::zero)
{}
template<class Type>
Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField
(
const fixedJumpAMIFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
jumpCyclicAMIFvPatchField<Type>(ptf, p, iF, mapper),
jump_(ptf.jump_, mapper)
{}
template<class Type>
Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
jumpCyclicAMIFvPatchField<Type>(p, iF),
jump_("jump", dict, p.size())
{}
template<class Type>
Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField
(
const fixedJumpAMIFvPatchField<Type>& ptf
)
:
jumpCyclicAMIFvPatchField<Type>(ptf),
jump_(ptf.jump_)
{}
template<class Type>
Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField
(
const fixedJumpAMIFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
jumpCyclicAMIFvPatchField<Type>(ptf, iF),
jump_(ptf.jump_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::fixedJumpAMIFvPatchField<Type>::jump() const
{
if (this->cyclicAMIPatch().owner())
{
return jump_;
}
else
{
const fixedJumpAMIFvPatchField& nbrPatch =
refCast<const fixedJumpAMIFvPatchField<Type> >
(
this->neighbourPatchField()
);
return this->cyclicAMIPatch().interpolate(nbrPatch.jump());
}
}
template<class Type>
void Foam::fixedJumpAMIFvPatchField<Type>::autoMap
(
const fvPatchFieldMapper& m
)
{
jumpCyclicAMIFvPatchField<Type>::autoMap(m);
jump_.autoMap(m);
}
template<class Type>
void Foam::fixedJumpAMIFvPatchField<Type>::rmap
(
const fvPatchField<Type>& ptf,
const labelList& addr
)
{
jumpCyclicAMIFvPatchField<Type>::rmap(ptf, addr);
const fixedJumpAMIFvPatchField<Type>& tiptf =
refCast<const fixedJumpAMIFvPatchField<Type> >(ptf);
jump_.rmap(tiptf.jump_, addr);
}
template<class Type>
void Foam::fixedJumpAMIFvPatchField<Type>::write(Ostream& os) const
{
fvPatchField<Type>::write(os);
os.writeKeyword("patchType") << "cyclicAMI" << token::END_STATEMENT << nl;
jump_.writeEntry("jump", os);
this->writeEntry("value", os);
}
// ************************************************************************* //

View File

@ -0,0 +1,200 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fixedJumpAMIFvPatchField
Group
grpCoupledBoundaryConditions
Description
This boundary condition provides a jump condition, across non-conformal
cyclic path-pairs, employing an arbitraryMeshInterface (AMI).
The jump is specified as a fixed value field, applied as an offset to the
'owner' patch.
\heading Patch usage
\table
Property | Description | Required | Default value
patchType | underlying patch type should be \c cyclic| yes |
jump | current jump value | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type fixedJumpAMI;
patchType cyclic;
jump uniform 10;
}
\endverbatim
The above example shows the use of a fixed jump of '10'.
Note
The underlying \c patchType should be set to \c cyclicAMI
SeeAlso
Foam::jumpCyclicAMIFvPatchField
SourceFiles
fixedJumpAMIFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef fixedJumpAMIFvPatchField_H
#define fixedJumpAMIFvPatchField_H
#include "jumpCyclicAMIFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class fixedJumpAMIFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class fixedJumpAMIFvPatchField
:
public jumpCyclicAMIFvPatchField<Type>
{
protected:
// Protected data
//- "jump" field
Field<Type> jump_;
public:
//- Runtime type information
TypeName("fixedJumpAMI");
// Constructors
//- Construct from patch and internal field
fixedJumpAMIFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
fixedJumpAMIFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given fixedJumpAMIFvPatchField onto a
// new patch
fixedJumpAMIFvPatchField
(
const fixedJumpAMIFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
fixedJumpAMIFvPatchField
(
const fixedJumpAMIFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new fixedJumpAMIFvPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
fixedJumpAMIFvPatchField
(
const fixedJumpAMIFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
(
new fixedJumpAMIFvPatchField<Type>(*this, iF)
);
}
// Member functions
// Access
//- Return the "jump" across the patch
virtual tmp<Field<Type> > jump() const;
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap(const fvPatchFieldMapper&);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap(const fvPatchField<Type>&, const labelList&);
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "fixedJumpAMIFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "fixedJumpAMIFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(fixedJumpAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef fixedJumpAMIFvPatchFields_H
#define fixedJumpAMIFvPatchFields_H
#include "fixedJumpAMIFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(fixedJumpAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef fixedJumpAMIFvPatchFieldsFwd_H
#define fixedJumpAMIFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class fixedJumpAMIFvPatchField;
makePatchTypeFieldTypedefs(fixedJumpAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,141 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "uniformJumpFvPatchField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
fixedJumpFvPatchField<Type>(p, iF),
jumpTable_(0)
{}
template<class Type>
Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
(
const uniformJumpFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedJumpFvPatchField<Type>(ptf, p, iF, mapper),
jumpTable_(ptf.jumpTable_().clone().ptr())
{}
template<class Type>
Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
fixedJumpFvPatchField<Type>(p, iF),
jumpTable_(new DataEntry<Type>("jumpTable"))
{
if (this->cyclicPatch().owner())
{
jumpTable_ = DataEntry<Type>::New("jumpTable", dict);
}
if (dict.found("value"))
{
fvPatchField<Type>::operator=
(
Field<Type>("value", dict, p.size())
);
}
}
template<class Type>
Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
(
const uniformJumpFvPatchField<Type>& ptf
)
:
fixedJumpFvPatchField<Type>(ptf),
jumpTable_(ptf.jumpTable_().clone().ptr())
{}
template<class Type>
Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
(
const uniformJumpFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
fixedJumpFvPatchField<Type>(ptf, iF),
jumpTable_(ptf.jumpTable_().clone().ptr())
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::uniformJumpFvPatchField<Type>::jump() const
{
if (this->cyclicPatch().owner())
{
Type j = jumpTable_->value(this->db().time().value());
return tmp<Field<Type> >(new Field<Type>(this->size(), j));
}
else
{
const uniformJumpFvPatchField& nbrPatch =
refCast<const uniformJumpFvPatchField<Type> >
(
this->neighbourPatchField()
);
return nbrPatch.jump();
}
}
template<class Type>
void Foam::uniformJumpFvPatchField<Type>::write(Ostream& os) const
{
fixedJumpFvPatchField<Type>::write(os);
if (this->cyclicPatch().owner())
{
jumpTable_->writeData(os);
}
this->writeEntry("value", os);
}
// ************************************************************************* //

View File

@ -0,0 +1,193 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::uniformJumpFvPatchField
Group
grpCoupledBoundaryConditions
Description
This boundary condition provides a jump condition, using the \c cyclic
condition as a base. The jump is specified as a time-varying uniform
value across the patch.
\heading Patch usage
\table
Property | Description | Required | Default value
patchType | underlying patch type should be \c cyclic| yes |
jumpTable | jump value | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type uniformJump;
patchType cyclic;
jumpTable constant 10;
}
\endverbatim
The above example shows the use of a fixed jump of '10'.
Note
The uniformValue entry is a DataEntry type, able to describe time
varying functions. The example above gives the usage for supplying a
constant value.
The underlying \c patchType should be set to \c cyclic
SeeAlso
Foam::fixedJumpFvPatchField
SourceFiles
uniformJumpFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef uniformJumpFvPatchField_H
#define uniformJumpFvPatchField_H
#include "fixedJumpFvPatchField.H"
#include "DataEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class uniformJumpFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class uniformJumpFvPatchField
:
public fixedJumpFvPatchField<Type>
{
protected:
// Protected data
//- "jump" table
autoPtr<DataEntry<Type> > jumpTable_;
public:
//- Runtime type information
TypeName("uniformJump");
// Constructors
//- Construct from patch and internal field
uniformJumpFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
uniformJumpFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given uniformJumpFvPatchField onto a
// new patch
uniformJumpFvPatchField
(
const uniformJumpFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
uniformJumpFvPatchField
(
const uniformJumpFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new uniformJumpFvPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
uniformJumpFvPatchField
(
const uniformJumpFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
(
new uniformJumpFvPatchField<Type>(*this, iF)
);
}
// Member functions
// Access
//- Return the "jump" across the patch.
virtual tmp<Field<Type> > jump() const;
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "uniformJumpFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "uniformJumpFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(uniformJump);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef uniformJumpFvPatchFields_H
#define uniformJumpFvPatchFields_H
#include "uniformJumpFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(uniformJump);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef uniformJumpFvPatchFieldsFwd_H
#define uniformJumpFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class uniformJumpFvPatchField;
makePatchTypeFieldTypedefs(uniformJump);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,139 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "uniformJumpAMIFvPatchField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
fixedJumpAMIFvPatchField<Type>(p, iF),
jumpTable_(0)
{}
template<class Type>
Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
(
const uniformJumpAMIFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedJumpAMIFvPatchField<Type>(ptf, p, iF, mapper),
jumpTable_(ptf.jumpTable_().clone().ptr())
{}
template<class Type>
Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
fixedJumpAMIFvPatchField<Type>(p, iF),
jumpTable_(new DataEntry<Type>("jumpTable"))
{
if (this->cyclicAMIPatch().owner())
{
jumpTable_ = DataEntry<Type>::New("jumpTable", dict);
}
if (dict.found("value"))
{
fvPatchField<Type>::operator=(Field<Type>("value", dict, p.size()));
}
}
template<class Type>
Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
(
const uniformJumpAMIFvPatchField<Type>& ptf
)
:
fixedJumpAMIFvPatchField<Type>(ptf),
jumpTable_(ptf.jumpTable_().clone().ptr())
{}
template<class Type>
Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
(
const uniformJumpAMIFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
fixedJumpAMIFvPatchField<Type>(ptf, iF),
jumpTable_(ptf.jumpTable_().clone().ptr())
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type> >
Foam::uniformJumpAMIFvPatchField<Type>::jump() const
{
if (this->cyclicAMIPatch().owner())
{
Type j = jumpTable_->value(this->db().time().value());
return tmp<Field<Type> >(new Field<Type>(this->size(), j));
}
else
{
const uniformJumpAMIFvPatchField& nbrPatch =
refCast<const uniformJumpAMIFvPatchField<Type> >
(
this->neighbourPatchField()
);
return this->cyclicAMIPatch().interpolate(nbrPatch.jump());
}
}
template<class Type>
void Foam::uniformJumpAMIFvPatchField<Type>::write(Ostream& os) const
{
fixedJumpAMIFvPatchField<Type>::write(os);
if (this->cyclicAMIPatch().owner())
{
jumpTable_->writeData(os);
}
this->writeEntry("value", os);
}
// ************************************************************************* //

View File

@ -0,0 +1,193 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::uniformJumpAMIFvPatchField
Group
grpCoupledBoundaryConditions
Description
This boundary condition provides a jump condition, using the \c cyclicAMI
condition as a base. The jump is specified as a time-varying uniform
value across the patch.
\heading Patch usage
\table
Property | Description | Required | Default value
patchType | underlying patch type should be \c cyclicAMI| yes |
jumpTable | jump value | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type uniformJumpAMI;
patchType cyclicAMI;
jumpTable constant 10;
}
\endverbatim
The above example shows the use of a fixed jump of '10'.
Note
The uniformValue entry is a DataEntry type, able to describe time
varying functions. The example above gives the usage for supplying a
constant value.
The underlying \c patchType should be set to \c cyclic
SeeAlso
Foam::jumpCyclicAMIFvPatchField
SourceFiles
uniformJumpAMIFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef uniformJumpAMIFvPatchField_H
#define uniformJumpAMIFvPatchField_H
#include "fixedJumpAMIFvPatchField.H"
#include "DataEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class uniformJumpAMIFvPatchField Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class uniformJumpAMIFvPatchField
:
public fixedJumpAMIFvPatchField<Type>
{
protected:
// Protected data
//- "jump" table
autoPtr<DataEntry<Type> > jumpTable_;
public:
//- Runtime type information
TypeName("uniformJumpAMI");
// Constructors
//- Construct from patch and internal field
uniformJumpAMIFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
uniformJumpAMIFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given uniformJumpAMIFvPatchField onto a
// new patch
uniformJumpAMIFvPatchField
(
const uniformJumpAMIFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
uniformJumpAMIFvPatchField
(
const uniformJumpAMIFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new uniformJumpAMIFvPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
uniformJumpAMIFvPatchField
(
const uniformJumpAMIFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
(
new uniformJumpAMIFvPatchField<Type>(*this, iF)
);
}
// Member functions
// Access
//- Return the "jump" across the patch.
virtual tmp<Field<Type> > jump() const;
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "uniformJumpAMIFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "uniformJumpAMIFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(uniformJumpAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef uniformJumpAMIFvPatchFields_H
#define uniformJumpAMIFvPatchFields_H
#include "uniformJumpAMIFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(uniformJumpAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef uniformJumpAMIFvPatchFieldsFwd_H
#define uniformJumpAMIFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class uniformJumpAMIFvPatchField;
makePatchTypeFieldTypedefs(uniformJumpAMI);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -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

View File

@ -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

View File

@ -25,7 +25,7 @@ License
#include "addToRunTimeSelectionTable.H"
#include "energyJumpFvPatchScalarField.H"
#include "temperatureJumpFvPatchScalarField.H"
#include "temperatureJumpBase.H"
#include "basicThermo.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
@ -61,7 +61,6 @@ Foam::energyJumpFvPatchScalarField::energyJumpFvPatchScalarField
:
fixedJumpFvPatchField<scalar>(p, iF)
{
if (dict.found("value"))
{
fvPatchScalarField::operator=
@ -77,7 +76,6 @@ Foam::energyJumpFvPatchScalarField::energyJumpFvPatchScalarField
const energyJumpFvPatchScalarField& ptf
)
:
cyclicLduInterfaceField(),
fixedJumpFvPatchField<scalar>(ptf)
{}
@ -103,29 +101,21 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs()
if (this->cyclicPatch().owner())
{
const basicThermo& thermo = db().lookupObject<basicThermo>
(
"thermophysicalProperties"
);
const basicThermo& thermo =
db().lookupObject<basicThermo>("thermophysicalProperties");
label patchID = patch().index();
const scalarField& pp = thermo.p().boundaryField()[patchID];
const temperatureJumpFvPatchScalarField& TbPatch =
refCast<const temperatureJumpFvPatchScalarField>
const temperatureJumpBase& TbPatch =
refCast<const temperatureJumpBase>
(
thermo.T().boundaryField()[patchID]
);
const scalar time = this->db().time().value();
const scalarField jumpTb
(
patch().size(), TbPatch.jumpTable().value(time)
);
const labelUList& faceCells = this->patch().faceCells();
jump_ = thermo.he(pp, jumpTb, faceCells);
jump_ = thermo.he(pp, TbPatch.jump(), faceCells);
}
fixedJumpFvPatchField<scalar>::updateCoeffs();

View File

@ -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

View File

@ -24,51 +24,43 @@ License
\*---------------------------------------------------------------------------*/
#include "addToRunTimeSelectionTable.H"
#include "temperatureJumpFvPatchScalarField.H"
#include "volFields.H"
#include "energyJumpAMIFvPatchScalarField.H"
#include "temperatureJumpBase.H"
#include "basicThermo.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField
Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedJumpFvPatchField<scalar>(p, iF),
jumpTable_(0)
fixedJumpAMIFvPatchField<scalar>(p, iF)
{}
Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField
Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField
(
const temperatureJumpFvPatchScalarField& ptf,
const energyJumpAMIFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedJumpFvPatchField<scalar>(ptf, p, iF, mapper),
jumpTable_(ptf.jumpTable_().clone().ptr())
fixedJumpAMIFvPatchField<scalar>(ptf, p, iF, mapper)
{}
Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField
Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
fixedJumpFvPatchField<scalar>(p, iF),
jumpTable_(new DataEntry<scalar>("jumpTable"))
fixedJumpAMIFvPatchField<scalar>(p, iF)
{
if (this->cyclicPatch().owner())
{
jumpTable_ = DataEntry<scalar>::New("jumpTable", dict);
}
if (dict.found("value"))
{
fvPatchScalarField::operator=
@ -79,38 +71,60 @@ Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField
}
Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField
Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField
(
const temperatureJumpFvPatchScalarField& ptf
const energyJumpAMIFvPatchScalarField& ptf
)
:
cyclicLduInterfaceField(),
fixedJumpFvPatchField<scalar>(ptf),
jumpTable_(ptf.jumpTable_().clone().ptr())
fixedJumpAMIFvPatchField<scalar>(ptf)
{}
Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField
Foam::energyJumpAMIFvPatchScalarField::energyJumpAMIFvPatchScalarField
(
const temperatureJumpFvPatchScalarField& ptf,
const energyJumpAMIFvPatchScalarField& ptf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedJumpFvPatchField<scalar>(ptf, iF),
jumpTable_(ptf.jumpTable_().clone().ptr())
fixedJumpAMIFvPatchField<scalar>(ptf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::temperatureJumpFvPatchScalarField::write(Ostream& os) const
void Foam::energyJumpAMIFvPatchScalarField::updateCoeffs()
{
fixedJumpFvPatchField<scalar>::write(os);
if (this->cyclicPatch().owner())
if (this->updated())
{
jumpTable_->writeData(os);
return;
}
if (this->cyclicAMIPatch().owner())
{
const basicThermo& thermo =
db().lookupObject<basicThermo>("thermophysicalProperties");
label patchID = patch().index();
const scalarField& pp = thermo.p().boundaryField()[patchID];
const temperatureJumpBase& TbPatch =
refCast<const temperatureJumpBase>
(
thermo.T().boundaryField()[patchID]
);
const labelUList& faceCells = this->patch().faceCells();
jump_ = thermo.he(pp, TbPatch.jump(), faceCells);
}
fixedJumpAMIFvPatchField<scalar>::updateCoeffs();
}
void Foam::energyJumpAMIFvPatchScalarField::write(Ostream& os) const
{
fixedJumpAMIFvPatchField<scalar>::write(os);
this->writeEntry("value", os);
}
@ -122,7 +136,7 @@ namespace Foam
makePatchTypeField
(
fvPatchScalarField,
temperatureJumpFvPatchScalarField
energyJumpAMIFvPatchScalarField
);
}

View File

@ -0,0 +1,150 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::energyJumpAMIFvPatchScalarField
Group
grpThermoBoundaryConditions grpCoupledBoundaryConditions
Description
This boundary condition provides an energy jump condition across a pair
of coupled patches with an arbitrary mesh interface (AMI). It is not
applied directly, but is employed on-the-fly when converting temperature
boundary conditions into energy.
SeeAlso
Foam::fixedJumpAMIFvPatchField
SourceFiles
energyJumpAMIFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef energyJumpAMIFvPatchScalarField_H
#define energyJumpAMIFvPatchScalarField_H
#include "fixedJumpAMIFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class energyJumpAMIFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class energyJumpAMIFvPatchScalarField
:
public fixedJumpAMIFvPatchField<scalar>
{
public:
//- Runtime type information
TypeName("energyJumpAMI");
// Constructors
//- Construct from patch and internal field
energyJumpAMIFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
energyJumpAMIFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given energyJumpAMIFvPatchScalarField onto a
// new patch
energyJumpAMIFvPatchScalarField
(
const energyJumpAMIFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
energyJumpAMIFvPatchScalarField
(
const energyJumpAMIFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchField<scalar> > clone() const
{
return tmp<fvPatchField<scalar> >
(
new energyJumpAMIFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
energyJumpAMIFvPatchScalarField
(
const energyJumpAMIFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<scalar> > clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchField<scalar> >
(
new energyJumpAMIFvPatchScalarField(*this, iF)
);
}
// Member functions
// Evaluation functions
//- Update the coefficients
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "temperatureJumpAMIBase.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(temperatureJumpAMIBase, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::temperatureJumpAMIBase::temperatureJumpAMIBase()
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::temperatureJumpAMIBase::~temperatureJumpAMIBase()
{}
// ************************************************************************* //

View File

@ -0,0 +1,79 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Base class for temperature jump boundary conditions that provides access
to the jump field
SourceFiles
temperatureJumpBase.C
\*---------------------------------------------------------------------------*/
#ifndef temperatureJumpAMIBase_H
#define temperatureJumpAMIBase_H
#include "typeInfo.H"
#include "scalarField.H"
#include "tmp.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class temperatureJumpAMIBase Declaration
\*---------------------------------------------------------------------------*/
class temperatureJumpAMIBase
{
public:
//- Runtime type information
TypeName("temperatureJumpAMIBase");
//- Construct null
temperatureJumpAMIBase();
//- Destructor
virtual ~temperatureJumpAMIBase();
// Member functions
//- Return a field of the temperature jump
virtual tmp<scalarField> jump() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "temperatureJumpBase.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(temperatureJumpBase, 0);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::temperatureJumpBase::temperatureJumpBase()
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::temperatureJumpBase::~temperatureJumpBase()
{}
// ************************************************************************* //

View File

@ -0,0 +1,79 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Description
Base class for temperature jump boundary conditions that provides access
to the jump field
SourceFiles
temperatureJumpBase.C
\*---------------------------------------------------------------------------*/
#ifndef temperatureJumpBase_H
#define temperatureJumpBase_H
#include "typeInfo.H"
#include "scalarField.H"
#include "tmp.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class temperatureJumpBase Declaration
\*---------------------------------------------------------------------------*/
class temperatureJumpBase
{
public:
//- Runtime type information
TypeName("temperatureJumpBase");
//- Construct null
temperatureJumpBase();
//-Destructor
virtual ~temperatureJumpBase();
// Member functions
//- Return a field of the temperature jump
virtual tmp<scalarField> jump() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "addToRunTimeSelectionTable.H"
#include "uniformTemperatureJumpFvPatchScalarField.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::uniformTemperatureJumpFvPatchScalarField::
uniformTemperatureJumpFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
uniformJumpFvPatchField<scalar>(p, iF)
{}
Foam::uniformTemperatureJumpFvPatchScalarField::
uniformTemperatureJumpFvPatchScalarField
(
const uniformTemperatureJumpFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
uniformJumpFvPatchField<scalar>(ptf, p, iF, mapper)
{}
Foam::uniformTemperatureJumpFvPatchScalarField::
uniformTemperatureJumpFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
uniformJumpFvPatchField<scalar>(p, iF)
{}
Foam::uniformTemperatureJumpFvPatchScalarField::
uniformTemperatureJumpFvPatchScalarField
(
const uniformTemperatureJumpFvPatchScalarField& ptf
)
:
uniformJumpFvPatchField<scalar>(ptf)
{}
Foam::uniformTemperatureJumpFvPatchScalarField::
uniformTemperatureJumpFvPatchScalarField
(
const uniformTemperatureJumpFvPatchScalarField& ptf,
const DimensionedField<scalar, volMesh>& iF
)
:
uniformJumpFvPatchField<scalar>(ptf, iF)
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
uniformTemperatureJumpFvPatchScalarField
);
}
// ************************************************************************* //

View File

@ -22,14 +22,14 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::temperatureJumpFvPatchScalarField
Foam::uniformTemperatureJumpFvPatchScalarField
Group
grpCoupledBoundaryConditions
Description
This boundary condition provides a temperature jump condition across a
coupled pair of cyclic patches.
coupled pair of cyclic patches, when solving for energy.
The jump is specified as a \c DataEntry type, to enable the use of, e.g.
contant, polynomial, table values.
@ -39,7 +39,6 @@ Description
\table
Property | Description | Required | Default value
patchType | underlying patch type should be \c cyclic| yes |
jump | current jump value | yes |
jumpTable | jump data, e.g. \c csvFile | yes |
\endtable
@ -47,31 +46,32 @@ Description
\verbatim
myPatch
{
type temperatureJump;
type uniformTemperatureJump;
patchType cyclic;
jumpTable constant 100;
value uniform 300;
}
\endverbatim
The above example shows the use of a constant jump condition.
The above example shows the use of a constant jump condition of 300 K.
Note
The underlying \c patchType should be set to \c cyclic
SeeAlso
Foam::fixedJumpFvPatchField
Foam::uniformJumpFvPatchField
Foam::energyJumpFvPatchScalarField
SourceFiles
temperatureJumpFvPatchScalarField.C
uniformTemperatureJumpFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef temperatureJumpFvPatchScalarField_H
#define temperatureJumpFvPatchScalarField_H
#ifndef uniformTemperatureJumpFvPatchScalarField_H
#define uniformTemperatureJumpFvPatchScalarField_H
#include "fixedJumpFvPatchField.H"
#include "DataEntry.H"
#include "temperatureJumpBase.H"
#include "uniformJumpFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -79,56 +79,51 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class temperatureJumpFvPatchScalarField Declaration
Class uniformTemperatureJumpFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class temperatureJumpFvPatchScalarField
class uniformTemperatureJumpFvPatchScalarField
:
public fixedJumpFvPatchField<scalar>
public temperatureJumpBase,
public uniformJumpFvPatchField<scalar>
{
// Private data
//- Interpolation table
autoPtr<DataEntry<scalar> > jumpTable_;
public:
//- Runtime type information
TypeName("temperatureJump");
TypeName("uniformTemperatureJump");
// Constructors
//- Construct from patch and internal field
temperatureJumpFvPatchScalarField
uniformTemperatureJumpFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
temperatureJumpFvPatchScalarField
uniformTemperatureJumpFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given temperatureJumpFvPatchScalarField onto a
// new patch
temperatureJumpFvPatchScalarField
//- Construct by mapping given
// uniformTemperatureJumpFvPatchScalarField onto a new patch
uniformTemperatureJumpFvPatchScalarField
(
const temperatureJumpFvPatchScalarField&,
const uniformTemperatureJumpFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
temperatureJumpFvPatchScalarField
uniformTemperatureJumpFvPatchScalarField
(
const temperatureJumpFvPatchScalarField&
const uniformTemperatureJumpFvPatchScalarField&
);
//- Construct and return a clone
@ -136,14 +131,14 @@ public:
{
return tmp<fvPatchField<scalar> >
(
new temperatureJumpFvPatchScalarField(*this)
new uniformTemperatureJumpFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
temperatureJumpFvPatchScalarField
uniformTemperatureJumpFvPatchScalarField
(
const temperatureJumpFvPatchScalarField&,
const uniformTemperatureJumpFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
@ -155,25 +150,17 @@ public:
{
return tmp<fvPatchField<scalar> >
(
new temperatureJumpFvPatchScalarField(*this, iF)
new uniformTemperatureJumpFvPatchScalarField(*this, iF)
);
}
// Member functions
// Member Functions
// Access functions
//- Return jumpTable
const DataEntry<scalar>& jumpTable() const
{
return jumpTable_();
}
//- Write
virtual void write(Ostream&) const;
virtual tmp<Field<scalar> > jump() const
{
return uniformJumpFvPatchField::jump();
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "addToRunTimeSelectionTable.H"
#include "uniformTemperatureJumpAMIFvPatchScalarField.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::uniformTemperatureJumpAMIFvPatchScalarField::
uniformTemperatureJumpAMIFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
uniformJumpAMIFvPatchField<scalar>(p, iF)
{}
Foam::uniformTemperatureJumpAMIFvPatchScalarField::
uniformTemperatureJumpAMIFvPatchScalarField
(
const uniformTemperatureJumpAMIFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
uniformJumpAMIFvPatchField<scalar>(ptf, p, iF, mapper)
{}
Foam::uniformTemperatureJumpAMIFvPatchScalarField::
uniformTemperatureJumpAMIFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
uniformJumpAMIFvPatchField<scalar>(p, iF)
{}
Foam::uniformTemperatureJumpAMIFvPatchScalarField::
uniformTemperatureJumpAMIFvPatchScalarField
(
const uniformTemperatureJumpAMIFvPatchScalarField& ptf
)
:
uniformJumpAMIFvPatchField<scalar>(ptf)
{}
Foam::uniformTemperatureJumpAMIFvPatchScalarField::
uniformTemperatureJumpAMIFvPatchScalarField
(
const uniformTemperatureJumpAMIFvPatchScalarField& ptf,
const DimensionedField<scalar, volMesh>& iF
)
:
uniformJumpAMIFvPatchField<scalar>(ptf, iF)
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
uniformTemperatureJumpAMIFvPatchScalarField
);
}
// ************************************************************************* //

View File

@ -0,0 +1,175 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::uniformTemperatureJumpAMIFvPatchScalarField
Group
grpCoupledBoundaryConditions
Description
This boundary condition provides a temperature jump condition across a
coupled pair of non-conformal cyclic patches using an arbitrary mesh
interface (AMI), when solving for energy.
The jump is specified as a \c DataEntry type, to enable the use of, e.g.
contant, polynomial, table values.
\heading Patch usage
\table
Property | Description | Required | Default value
patchType | underlying patch type should be \c cyclicAMI| yes |
jumpTable | jump data, e.g. \c csvFile | yes |
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type uniformTemperatureJumpAMI;
patchType cyclic;
jumpTable constant 100;
value uniform 300;
}
\endverbatim
The above example shows the use of a constant jump condition of 300 K.
Note
The underlying \c patchType should be set to \c cyclicAMI
SeeAlso
Foam::uniformJumpAMIFvPatchField
Foam::energyJumpAMIFvPatchScalarField
SourceFiles
uniformTemperatureJumpAMIFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef uniformTemperatureJumpAMIFvPatchScalarField_H
#define uniformTemperatureJumpAMIFvPatchScalarField_H
#include "temperatureJumpAMIBase.H"
#include "uniformJumpAMIFvPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class uniformTemperatureJumpAMIFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class uniformTemperatureJumpAMIFvPatchScalarField
:
public temperatureJumpAMIBase,
public uniformJumpAMIFvPatchField<scalar>
{
public:
//- Runtime type information
TypeName("uniformTemperatureJumpAMI");
// Constructors
//- Construct from patch and internal field
uniformTemperatureJumpAMIFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
uniformTemperatureJumpAMIFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// uniformTemperatureJumpAMIFvPatchScalarField onto a new patch
uniformTemperatureJumpAMIFvPatchScalarField
(
const uniformTemperatureJumpAMIFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
uniformTemperatureJumpAMIFvPatchScalarField
(
const uniformTemperatureJumpAMIFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchField<scalar> > clone() const
{
return tmp<fvPatchField<scalar> >
(
new uniformTemperatureJumpAMIFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
uniformTemperatureJumpAMIFvPatchScalarField
(
const uniformTemperatureJumpAMIFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<scalar> > clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchField<scalar> >
(
new uniformTemperatureJumpAMIFvPatchScalarField(*this, iF)
);
}
// Member Functions
virtual tmp<Field<scalar> > jump() const
{
return uniformJumpAMIFvPatchField::jump();
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -28,8 +28,10 @@ License
#include "fixedEnergyFvPatchScalarField.H"
#include "gradientEnergyFvPatchScalarField.H"
#include "mixedEnergyFvPatchScalarField.H"
#include "temperatureJumpFvPatchScalarField.H"
#include "temperatureJumpBase.H"
#include "temperatureJumpAMIBase.H"
#include "energyJumpFvPatchScalarField.H"
#include "energyJumpAMIFvPatchScalarField.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
@ -59,10 +61,14 @@ Foam::wordList Foam::heThermo<BasicThermo, MixtureType>::heBoundaryTypes()
{
hbt[patchi] = mixedEnergyFvPatchScalarField::typeName;
}
else if (isA<temperatureJumpFvPatchScalarField>(tbf[patchi]))
else if (isA<temperatureJumpBase>(tbf[patchi]))
{
hbt[patchi] = energyJumpFvPatchScalarField::typeName;
}
else if (isA<temperatureJumpAMIBase>(tbf[patchi]))
{
hbt[patchi] = energyJumpAMIFvPatchScalarField::typeName;
}
}
return hbt;

View File

@ -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

View File

@ -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

View File

@ -48,6 +48,7 @@ runTimeModifiable yes;
adjustTimeStep on;
maxCo 0.5;
maxAlphaCo 0.5;
maxDeltaT 1;
// ************************************************************************* //

View File

@ -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);
}