diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/files b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/files deleted file mode 100644 index 8e2cf71dcc..0000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C - -LIB = $(FOAM_LIBBIN)/libcoupledDerivedFvPatchFields diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/options deleted file mode 100644 index 1cbced1cd3..0000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/Make/options +++ /dev/null @@ -1,12 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \ - -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude - -LIB_LIBS = \ - -lmeshTools \ - -lbasicThermophysicalModels \ - -lfiniteVolume \ - -lradiationModels diff --git a/src/turbulenceModels/compressible/turbulenceModel/Make/files b/src/turbulenceModels/compressible/turbulenceModel/Make/files index dd14188e4d..cb4d10d56f 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/Make/files +++ b/src/turbulenceModels/compressible/turbulenceModel/Make/files @@ -9,5 +9,6 @@ derivedFvPatchFields/turbulentTemperatureCoupledBaffle/regionProperties.C derivedFvPatchFields/temperatureThermoBaffle1D/temperatureThermoBaffle1DFvPatchScalarFields.C derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C +derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C LIB = $(FOAM_LIBBIN)/libcompressibleTurbulenceModel diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C similarity index 93% rename from applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C rename to src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C index a73784ecf2..8fa99c3697 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C @@ -202,17 +202,16 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() return; } + scalarField q(size(), 0.0); + scalarField KDelta = K(*this)*patch().deltaCoeffs(); + if (oldMode_ == fixedHeatFlux) { - this->refGrad() = q_/K(*this); - this->refValue() = 0.0; - this->valueFraction() = 0.0; + q = q_; } else if(oldMode_ == fixedHeatTransferCoeff) { - this->refGrad() = (Ta_ - *this)*h_/K(*this); - this->refValue() = 0.0; - this->valueFraction() = 0.0; + q = (Ta_ - *this)*h_; } else { @@ -224,6 +223,22 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() << exit(FatalError); } + forAll (*this, i) + { + if (q[i] > 0) //in + { + this->refGrad()[i] = q[i]/K(*this)()[i]; + this->refValue()[i] = 0.0; + this->valueFraction()[i] = 0.0; + } + else //out + { + this->refGrad()[i] = 0.0; + this->refValue()[i] = KDelta[i]*q[i] + patchInternalField()()[i]; + this->valueFraction()[i] = 1.0; + } + } + mixedFvPatchScalarField::updateCoeffs(); if (debug) diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionFoam/coupledDerivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H rename to src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H