From 06bbf06c5b489f90ec3e66213acb3e406c09b300 Mon Sep 17 00:00:00 2001 From: sergio Date: Thu, 22 Mar 2012 10:56:01 +0000 Subject: [PATCH 1/4] BUG: Fix the calculation on max delta normal to the wall on each cell.It loops over all faces --- .../SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C index 4cd85a7cf6..5a680bc56b 100644 --- a/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C +++ b/src/turbulenceModels/incompressible/LES/SpalartAllmarasIDDES/IDDESDelta/IDDESDelta.C @@ -74,16 +74,20 @@ void Foam::IDDESDelta::calcDelta() { scalar deltaMaxTmp = 0.0; const labelList& cFaces = cells[cellI]; - const point& faceCentre = faceCentres[cFaces[0]]; const vector nCell = n[cellI]; forAll(cFaces, cFaceI) { label faceI = cFaces[cFaceI]; - const point& faceCentreTwo = faceCentres[faceI]; - scalar tmp = (faceCentre - faceCentreTwo) & nCell; - if (tmp > deltaMaxTmp) + const point& faceCentreI = faceCentres[faceI]; + forAll(cFaces, cFaceJ) { - deltaMaxTmp = tmp; + label faceJ = cFaces[cFaceJ]; + const point& faceCentreJ = faceCentres[faceJ]; + scalar tmp = (faceCentreJ - faceCentreI) & nCell; + if (tmp > deltaMaxTmp) + { + deltaMaxTmp = tmp; + } } } faceToFacenMax[cellI] = deltaMaxTmp; From 1ebe55d95b6409b2c34674bc800d24e21e19e348 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 22 Mar 2012 11:48:09 +0000 Subject: [PATCH 2/4] multiphase solvers: remove lift and drag at fixed-flux BCs, i.e. inlets --- .../compressibleTwoPhaseEulerFoam.C | 1 + .../interfacialCoeffs.H | 11 +++++ .../multiphaseSystem/multiphaseSystem.C | 40 ++++++++++++++++--- .../twoPhaseEulerFoam/liftDragCoeffs.H | 10 +++++ .../twoPhaseEulerFoam/twoPhaseEulerFoam.C | 1 + 5 files changed, 58 insertions(+), 5 deletions(-) diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C index 78d70a1537..94548090b1 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C @@ -33,6 +33,7 @@ Description #include "fvCFD.H" #include "nearWallDist.H" #include "wallFvPatch.H" +#include "fixedValueFvsPatchFields.H" #include "Switch.H" #include "IFstream.H" diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialCoeffs.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialCoeffs.H index 0f28f2330d..3b4d2be679 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialCoeffs.H +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialCoeffs.H @@ -77,4 +77,15 @@ volScalarField heatTransferCoeff heatTransferCoeff *= alpha1Coeff; liftForce = Cl*(alpha1*rho1 + alpha2*rho2)*(Ur ^ fvc::curl(U)); + + // Remove lift, drag and phase heat-transfer at fixed-flux boundaries + forAll(phi1.boundaryField(), patchi) + { + if (isA(phi1.boundaryField()[patchi])) + { + dragCoeff.boundaryField()[patchi] = 0.0; + heatTransferCoeff.boundaryField()[patchi] = 0.0; + liftForce.boundaryField()[patchi] = vector::zero; + } + } } diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index 2224030613..41b79f77b9 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -25,6 +25,7 @@ License #include "multiphaseSystem.H" #include "alphaContactAngleFvPatchScalarField.H" +#include "fixedValueFvsPatchFields.H" #include "Time.H" #include "subCycle.H" #include "MULES.H" @@ -610,6 +611,21 @@ Foam::tmp Foam::multiphaseSystem::Svm } } + // Remove lift at fixed-flux boundaries + forAll(phase.phi().boundaryField(), patchi) + { + if + ( + isA + ( + phase.phi().boundaryField()[patchi] + ) + ) + { + tSvm().boundaryField()[patchi] = vector::zero; + } + } + return tSvm; } @@ -623,9 +639,7 @@ Foam::multiphaseSystem::dragCoeffs() const { const dragModel& dm = *iter(); - dragCoeffsPtr().insert - ( - iter.key(), + volScalarField* Kptr = ( max ( @@ -642,8 +656,24 @@ Foam::multiphaseSystem::dragCoeffs() const dm.residualSlip() ) ) - ).ptr() - ); + ).ptr(); + + // Remove drag at fixed-flux boundaries + forAll(dm.phase1().phi().boundaryField(), patchi) + { + if + ( + isA + ( + dm.phase1().phi().boundaryField()[patchi] + ) + ) + { + Kptr->boundaryField()[patchi] = 0.0; + } + } + + dragCoeffsPtr().insert(iter.key(), Kptr); } return dragCoeffsPtr; diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/liftDragCoeffs.H b/applications/solvers/multiphase/twoPhaseEulerFoam/liftDragCoeffs.H index 097123378c..415afe9483 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/liftDragCoeffs.H +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/liftDragCoeffs.H @@ -19,3 +19,13 @@ ( Cl*(alpha2*rho2 + alpha1*rho1)*(Ur ^ fvc::curl(U)) ); + + // Remove lift and drag at fixed-flux boundaries + forAll(phi1.boundaryField(), patchi) + { + if (isA(phi1.boundaryField()[patchi])) + { + K.boundaryField()[patchi] = 0.0; + liftCoeff.boundaryField()[patchi] = vector::zero; + } + } diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C index d9da532aef..178032db6f 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C @@ -35,6 +35,7 @@ Description #include "subCycle.H" #include "nearWallDist.H" #include "wallFvPatch.H" +#include "fixedValueFvsPatchFields.H" #include "Switch.H" #include "IFstream.H" From 9d7cb91af14afafe10fc4fe3c5561f64e79c329c Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 22 Mar 2012 11:48:29 +0000 Subject: [PATCH 3/4] Update headers --- .../compressibleTwoPhaseEulerFoam.C | 2 +- .../multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C index 94548090b1..c736f8194d 100644 --- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C +++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C @@ -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 diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index 41b79f77b9..620499a2e7 100644 --- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -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 From 79062e3fa20f9917f48cecad2e769ee4e4ec66ae Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 22 Mar 2012 14:48:27 +0000 Subject: [PATCH 4/4] ENH: Updated fluent3DMeshToFoam Flex rules for reading header information --- .../conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L index 5f6a49ab3b..c67f5b289b 100644 --- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L @@ -163,6 +163,7 @@ hexLabel {hexDigit}+ zeroLabel {digit}* signedInteger [-+]?{integer} word ({alpha}|{digit}|{dotColonDash})* +wordBraces ({word}|{lbrac}|{rbrac})* exponent_part [eE][-+]?{digit}+ fractional_constant [-+]?(({digit}*"."{digit}+)|({digit}+".")|({digit})) @@ -184,6 +185,7 @@ schemeSymbolList ({schemeSymbolListElement}+{space}) starStar ("**") text ({space}({word}*{space})*) +textBraces ({space}({wordBraces}*{space})*) anythingInBlock ([^)]*) dateDDMMYYYY ({digit}{digit}"/"{digit}{digit}"/"{digit}{digit}{digit}{digit}) @@ -276,11 +278,10 @@ endOfSection {space}")"{space} BEGIN(readHeader); } -{anythingInBlock} { - Info<< "Header: " << YYText() << endl; +{quote}{textBraces}{quote} { + Info<< "Reading header: " << YYText() << endl; } - {dimension} { BEGIN(readDimension); }