From 54b98a8ce1b12579b1e2d2825978642b0a089824 Mon Sep 17 00:00:00 2001 From: Sergio Ferraris <sergio@alex.opencfd.co.uk> Date: Wed, 8 Jan 2014 17:12:46 +0000 Subject: [PATCH] BUG: Bug in F for DarcyForchheimer porosity model. Changing to Lists the contact resistances of turbulentTemperatureRadCoupledMixed and turbulentTemperatureCoupled BC's Updating fvOption in heatExchanger tutorial --- .../porosityModel/DarcyForchheimer/DarcyForchheimer.C | 9 +++++---- ...lentTemperatureCoupledBaffleMixedFvPatchScalarField.C | 6 ++---- ...lentTemperatureCoupledBaffleMixedFvPatchScalarField.H | 7 ++++--- ...rbulentTemperatureRadCoupledMixedFvPatchScalarField.C | 7 +++---- ...rbulentTemperatureRadCoupledMixedFvPatchScalarField.H | 7 ++++--- .../heatExchanger/system/air/fvOptions | 4 ++-- .../heatExchanger/system/porous/fvSolution | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C index 4fb8d7f2124..619ce5f1a34 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -102,9 +102,10 @@ Foam::porosityModels::DarcyForchheimer::DarcyForchheimer D_[zoneI][i].yy() = d.value().y(); D_[zoneI][i].zz() = d.value().z(); - F_[zoneI][i].xx() = f.value().x(); - F_[zoneI][i].yy() = f.value().y(); - F_[zoneI][i].zz() = f.value().z(); + // leading 0.5 is from 1/2*rho + F_[zoneI][i].xx() = 0.5*f.value().x(); + F_[zoneI][i].yy() = 0.5*f.value().y(); + F_[zoneI][i].zz() = 0.5*f.value().z(); } D_[zoneI] = coordSys_.R().transformTensor(D_[zoneI], cells); diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C index 4b1eea216f3..f71810b2d50 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C @@ -279,10 +279,8 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write mixedFvPatchScalarField::write(os); os.writeKeyword("Tnbr")<< TnbrName_ << token::END_STATEMENT << nl; - os.writeKeyword("thicknessLayers")<< thicknessLayers_ - << token::END_STATEMENT << nl; - os.writeKeyword("kappaLayers")<< kappaLayers_ - << token::END_STATEMENT << nl; + thicknessLayers_.writeEntry("thicknessLayers", os); + thicknessLayers_.writeEntry("kappaLayers", os); temperatureCoupledBase::write(os); } diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H index e2b163f5080..ad4bc066b2b 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -90,6 +90,7 @@ SourceFiles #include "mixedFvPatchFields.H" #include "temperatureCoupledBase.H" +#include "scalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -113,10 +114,10 @@ class turbulentTemperatureCoupledBaffleMixedFvPatchScalarField const word TnbrName_; //- Thickness of layers - scalarField thicknessLayers_; + scalarList thicknessLayers_; //- Conductivity of layers - scalarField kappaLayers_; + scalarList kappaLayers_; //- Total contact resistance scalar contactRes_; diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C index 863ba3a4f36..2e6831870ad 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C @@ -278,10 +278,9 @@ void turbulentTemperatureRadCoupledMixedFvPatchScalarField::write os.writeKeyword("QrNbr")<< QrNbrName_ << token::END_STATEMENT << nl; os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl; os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl; - os.writeKeyword("thicknessLayers")<< thicknessLayers_ - << token::END_STATEMENT << nl; - os.writeKeyword("kappaLayers")<< kappaLayers_ - << token::END_STATEMENT << nl; + thicknessLayers_.writeEntry("thicknessLayers", os); + thicknessLayers_.writeEntry("kappaLayers", os); + temperatureCoupledBase::write(os); } diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H index b272ff8c535..47d7e58f790 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,6 +84,7 @@ SourceFiles #include "mixedFvPatchFields.H" #include "temperatureCoupledBase.H" +#include "scalarList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -113,10 +114,10 @@ class turbulentTemperatureRadCoupledMixedFvPatchScalarField const word QrName_; //- Thickness of layers - scalarField thicknessLayers_; + scalarList thicknessLayers_; //- Conductivity of layers - scalarField kappaLayers_; + scalarList kappaLayers_; //- Total contact resistance scalar contactRes_; diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/fvOptions b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/fvOptions index e0562a38510..0c2b98d01ff 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/fvOptions +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/fvOptions @@ -46,7 +46,7 @@ porosityBlockage DarcyForchheimerCoeffs { - d d [0 -2 0 0 0] (10 -1000 -1000); + d d [0 -2 0 0 0] (-1000 -1000 1e4); f f [0 -1 0 0 0] (0 0 0); coordinateSystem @@ -75,7 +75,7 @@ MRF1 { origin (0.25 0.25 0.25); axis (0 0 1); - omega 477.5; // 500 rpm + omega 47.7; // 50 rpm } } diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/porous/fvSolution b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/porous/fvSolution index fd6da4016c5..0c19c83955c 100644 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/porous/fvSolution +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/porous/fvSolution @@ -29,7 +29,7 @@ solvers agglomerator faceAreaPair; mergeLevels 1; - maxIter 100; + maxIter 10; } "(U|h|e|k|epsilon)" -- GitLab