diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H index 13ffff11b649b7b44889d2909c01ab9ff9a4e9d3..aa3aca24242bbf4326e58328e910539cfb5ca7fd 100644 --- a/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H +++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/pEqn.H @@ -31,11 +31,7 @@ fvm::laplacian(rhorAUf, p_rgh) == fvc::div(phiHbyA) ); - p_rghEqn.setReference - ( - pRefCell, - compressible ? getRefCellValue(p_rgh, pRefCell) : pRefValue - ); + p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); p_rghEqn.solve(); @@ -76,8 +72,9 @@ { p += (initialMass - fvc::domainIntegrate(psi*p)) /fvc::domainIntegrate(psi); - p_rgh = p - rho*gh; + } + p_rgh = p - rho*gh; } rho = thermo.rho(); diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H index 410fc7166d14f31febb352aa18b0d841ea9e65ef..c4cc0d6c3c69f08d56f6e7f5546bd64420e06a78 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/fluid/pEqn.H @@ -1,11 +1,4 @@ { - /* - rho = thermo.rho(); - rho = max(rho, rhoMin[i]); - rho = min(rho, rhoMax[i]); - rho.relax(); - */ - volScalarField rAU("rAU", 1.0/UEqn.A()); surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU)); volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh)); @@ -39,11 +32,7 @@ fvm::laplacian(rhorAUf, p_rgh) == fvc::div(phiHbyA) ); - p_rghEqn.setReference - ( - pRefCell, - compressible ? getRefCellValue(p_rgh, pRefCell) : pRefValue - ); + p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell)); p_rghEqn.solve(); @@ -84,8 +73,8 @@ { p += (initialMass - fvc::domainIntegrate(psi*p)) /compressibility; - p_rgh = p - rho*gh; } + p_rgh = p - rho*gh; } rho = thermo.rho(); diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C index 3aa29ad806292d412dee811a6b76f1c3a8e0068c..d1b23832861b1e9e4b5eda5e7bd62676d19870f1 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -185,39 +185,17 @@ externalWallHeatFluxTemperatureFvPatchScalarField temperatureCoupledBase(patch(), ptf), mode_(ptf.mode_), Q_(ptf.Q_), + q_(ptf.q_, mapper), + h_(ptf.h_, mapper), + Ta_(ptf.Ta_, mapper), relaxation_(ptf.relaxation_), emissivity_(ptf.emissivity_), + qrPrevious_(ptf.qrPrevious_, mapper), qrRelaxation_(ptf.qrRelaxation_), qrName_(ptf.qrName_), thicknessLayers_(ptf.thicknessLayers_), kappaLayers_(ptf.kappaLayers_) -{ - switch (mode_) - { - case fixedPower: - { - break; - } - case fixedHeatFlux: - { - q_.autoMap(mapper); - - break; - } - case fixedHeatTransferCoeff: - { - h_.autoMap(mapper); - Ta_.autoMap(mapper); - - break; - } - } - - if (qrName_ != "none") - { - qrPrevious_.autoMap(mapper); - } -} +{} Foam::externalWallHeatFluxTemperatureFvPatchScalarField:: diff --git a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedNTUHeatTransfer/tabulatedNTUHeatTransfer.H b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedNTUHeatTransfer/tabulatedNTUHeatTransfer.H index 9459eca62f9eb3a9d23116ef228872694bf54b6f..0f087fd3287014a1d5405ea46663741aa54b9caf 100644 --- a/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedNTUHeatTransfer/tabulatedNTUHeatTransfer.H +++ b/src/fvOptions/sources/interRegion/interRegionHeatTransfer/tabulatedNTUHeatTransfer/tabulatedNTUHeatTransfer.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2015-2017 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -73,7 +73,7 @@ Description fields (h); outOfBounds clamp; - fileName "ntuTable"; + file "ntuTable"; nbrModel airToCooler; semiImplicit no; @@ -82,7 +82,7 @@ Description Ain 0.01728; AinNbr 0.3456; Vcore 0.01244; // Optional - + // geometryMode calculated; // inletPatch inlet_HWK; // inletPatchNbr inlet_air; diff --git a/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C b/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C index ca59d0e9c57bf333f7d3ead5729f0103bd4f7352..b8d21877b02b6da056c816ac4ac2ce225f8e8389 100644 --- a/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C +++ b/src/thermophysicalModels/thermophysicalPropertiesFvPatchFields/liquidProperties/humidityTemperatureCoupledMixed/humidityTemperatureCoupledMixedFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2015-2016 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2015-2017 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -469,7 +469,7 @@ void Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs() scalarField nrbDeltaCoeffs(nbrPatch.deltaCoeffs()); mpp.distribute(nrbDeltaCoeffs); - scalarField KDeltaNbr(nbrK*nrbDeltaCoeffs); + scalarField KDeltaNbr(nbrField.kappa(*this)*nbrPatch.deltaCoeffs()); mpp.distribute(KDeltaNbr); myKDelta_ = K*patch().deltaCoeffs(); @@ -702,7 +702,6 @@ void Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs() mixedFvPatchScalarField::updateCoeffs(); - if (debug && fluid_) { scalar Qdm = gSum(dm); diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun-parallel b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun-parallel index 5ebe90f21e0688d54251d78404c3f4851a6ce91c..32453b285e732ce0ba54d64db44797c0504b6b9c 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun-parallel +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/Allrun-parallel @@ -22,7 +22,8 @@ done # Generate view factors for i in air do - runParallel -s $i -np 4 viewFactorsGen -region $i + runParallel -s $i -np 4 \ + viewFactorsGen -region $i done # set the initial fields diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun-parallel b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun-parallel new file mode 100755 index 0000000000000000000000000000000000000000..18fefcf28cfd906ab6422b0a496718bfe8aef2fa --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun-parallel @@ -0,0 +1,39 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# create the underlying block mesh +runApplication blockMesh + +# create the set for the obstacles +runApplication topoSet + +# mesh processing to generate the inlet duct +runApplication subsetMesh c0 -patch walls -overwrite + +# split into the cabin, ice and exterior regions +runApplication splitMeshRegions -cellZones -overwrite + +# create register face and cell zones +rm log.topoSet +runApplication topoSet -region cabin -dict system/topoSetDictRegister + +# set the initial fields +restore0Dir + +# Decompose +runApplication decomposePar -allRegions -constant + +runParallel $(getApplication) + +# Reconstruct +runApplication reconstructPar -allRegions + +echo +echo "creating files for paraview post-processing" +echo +paraFoam -touchAll + +#------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/cabin/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/cabin/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..0d50f520e43d3ae32220887e13bae91efe0c5713 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/cabin/decomposeParDict @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method scotch; + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/cabin/fvOptions b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/cabin/fvOptions index 2acad8f14c1240162150418fad807dfba3c82372..45272dd12c1430890069939c16f91ce557302004 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/cabin/fvOptions +++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/cabin/fvOptions @@ -40,11 +40,11 @@ airDeflection length 0.01; //constant - pressureDrop 8; + //pressureDrop 8; //volumetricFlowRateTable - outOfBounds clamp; - fileName "volFlowRateTable"; + //outOfBounds clamp; + //file "volFlowRateTable"; } } diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/controlDict b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/controlDict index 1dd1497a4ac0f7dd7c2bd2b359f669da749298db..ee2da935e828026e5ce2b80d31fbebfc4caf2c95 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/controlDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/controlDict @@ -35,7 +35,7 @@ writeControl adjustableRunTime; purgeWrite 0; -writeFormat binary; +writeFormat ascii; writePrecision 10; @@ -49,7 +49,7 @@ runTimeModifiable true; adjustTimeStep yes; -maxDi 10; +maxDi 10e3; functions { diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..0d50f520e43d3ae32220887e13bae91efe0c5713 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/decomposeParDict @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method scotch; + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/windshield/decomposeParDict b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/windshield/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..0d50f520e43d3ae32220887e13bae91efe0c5713 --- /dev/null +++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/windshield/decomposeParDict @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: plus | +| \\ / A nd | Web: www.OpenFOAM.com | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + note "mesh decomposition control dictionary"; + location "system"; + object decomposeParDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method scotch; + + +// ************************************************************************* //