From 4248fdcd96a4bd32be17f896bf654ecef685a0a5 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 22 Jun 2020 14:22:18 +0200 Subject: [PATCH 1/5] BUG: windows IOobject::path() incorrect from absolute (fixes #1738) - only checked if it started with '/' and not 'd:/' (for example). --- src/OpenFOAM/db/IOobject/IOobject.C | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/db/IOobject/IOobject.C b/src/OpenFOAM/db/IOobject/IOobject.C index 8ec241819d..db76a66867 100644 --- a/src/OpenFOAM/db/IOobject/IOobject.C +++ b/src/OpenFOAM/db/IOobject/IOobject.C @@ -456,10 +456,19 @@ const Foam::fileName& Foam::IOobject::caseName() const Foam::fileName Foam::IOobject::path() const { // A file is 'outside' of the case if it has been specified using an - // absolute path (starts with '/') + // absolute path - if (instance().starts_with('/')) + const auto first = instance().find('/'); + + if + ( + first == 0 + #ifdef _WIN32 + || (first == 2 && instance()[1] == ':') // Eg, d:/path + #endif + ) { + // Absolute path (starts with '/' or 'd:/') return instance(); } From c49d923392c19b3431042a321995924cf55a1de6 Mon Sep 17 00:00:00 2001 From: sergio Date: Tue, 23 Jun 2020 08:13:33 -0700 Subject: [PATCH 2/5] BUG: Correcting htc definition to avoid negative values --- ...ernalCoupledTemperatureMixedFvPatchScalarField.C | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/functionObjects/field/externalCoupled/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C b/src/functionObjects/field/externalCoupled/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C index f206921523..66269bc4a2 100644 --- a/src/functionObjects/field/externalCoupled/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C +++ b/src/functionObjects/field/externalCoupled/externalCoupledTemperatureMixed/externalCoupledTemperatureMixedFvPatchScalarField.C @@ -280,9 +280,18 @@ void Foam::externalCoupledTemperatureMixedFvPatchScalarField::writeData const scalarField Tfluid(tfluid); - // Heat transfer coefficient [W/m2/K] - const scalarField htc(qDot/(max(Twall - Tfluid), 1e-3)); + // This htc needs to be always larger or equal to zero + //const scalarField htc(qDot/max(Twall - Tfluid, 1e-3)); + scalarField htc(qDot.size(), 0); + forAll (qDot, i) + { + scalar deltaT = mag(Twall[i] - Tfluid[i]); + if (deltaT > 1e-3) + { + htc[i] = sign(qDot[i])*qDot[i]/deltaT; + } + } const Field& magSf = this->patch().magSf(); From b6bf3502a36944bfb78766a30ed585c77313bc59 Mon Sep 17 00:00:00 2001 From: sergio Date: Thu, 25 Jun 2020 08:35:21 -0700 Subject: [PATCH 3/5] BUG: Adding phasePropertyName to basicThermo constructor (fixes #1745) --- src/thermophysicalModels/basic/basicThermo/basicThermo.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.C b/src/thermophysicalModels/basic/basicThermo/basicThermo.C index 3a76c30a73..a85231a962 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.C @@ -275,7 +275,7 @@ Foam::basicThermo::basicThermo ( IOobject ( - "thermo:alpha", + phasePropertyName("thermo:alpha"), mesh.time().timeName(), mesh, IOobject::READ_IF_PRESENT, From 65342453597a752d855ca51b9a26e580250bc229 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 26 Jun 2020 10:16:45 +0200 Subject: [PATCH 4/5] BUG: incorrect lookup name in ReynoldsAnalogy (fixes #1751) - used fluidThermo::typeName instead of fluidThermo::dictName within the Cp() method. --- .../ReynoldsAnalogy/ReynoldsAnalogy.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/ReynoldsAnalogy/ReynoldsAnalogy.C b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/ReynoldsAnalogy/ReynoldsAnalogy.C index 31a2019c86..006c83f351 100644 --- a/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/ReynoldsAnalogy/ReynoldsAnalogy.C +++ b/src/functionObjects/field/heatTransferCoeff/heatTransferCoeffModels/ReynoldsAnalogy/ReynoldsAnalogy.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2017 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -81,10 +81,10 @@ Foam::heatTransferCoeffModels::ReynoldsAnalogy::Cp(const label patchi) const const label n = mesh_.boundary()[patchi].size(); return tmp>::New(n, CpRef_); } - else if (mesh_.foundObject(fluidThermo::typeName)) + else if (mesh_.foundObject(fluidThermo::dictName)) { const fluidThermo& thermo = - mesh_.lookupObject(fluidThermo::typeName); + mesh_.lookupObject(fluidThermo::dictName); const scalarField& pp = thermo.p().boundaryField()[patchi]; const scalarField& Tp = thermo.T().boundaryField()[patchi]; From 51dd8f1c633dda9a38e974bded29f0c772f42fe9 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 26 Jun 2020 10:35:52 +0200 Subject: [PATCH 5/5] CONFIG: increment patch level --- META-INFO/api-info | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/META-INFO/api-info b/META-INFO/api-info index 35b8bd0011..850cf6f7af 100644 --- a/META-INFO/api-info +++ b/META-INFO/api-info @@ -1,2 +1,2 @@ api=1912 -patch=200604 +patch=200626