From b93f038ea3b434afae295dc4d9dc7c480c280d43 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 31 Jan 2023 13:45:19 +0100 Subject: [PATCH] TUT: replace exprFixedValue with uniformFixedValue - wish to deprecate and remove exprFixedValue in the future since the same functionality is possible using patch expressions with a uniformFixedValue condition. --- .../rhoPimpleFoam/RAS/TJunctionAverage/0/p | 27 +++++++----- .../rhoSimpleFoam/squareBendLiq/0.orig/T | 43 +++++++++++-------- 2 files changed, 40 insertions(+), 30 deletions(-) diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/p b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/p index c846dc84e9..b613e521f3 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/p +++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunctionAverage/0/p @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2212 | +| \\ / O peration | Version: v2306 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -40,19 +40,24 @@ boundaryField outlet1 { - type exprFixedValue; + type uniformFixedValue; value $internalField; - // debug true; - // debug.scanner true; - // debug.parser true; - variables - ( - "pInlet{inlet} = weightAverage(p)" - "pOutlet2{outlet2} = p" - ); + uniformValue + { + type expression; + // debug true; + // debug.scanner true; + // debug.parser true; - valueExpr "0.5*(pInlet + pOutlet2)"; + variables + ( + "pInlet{inlet} = weightAverage(p)" + "pOutlet2{outlet2} = p" + ); + + expression "0.5*(pInlet + pOutlet2)"; + } } outlet2 diff --git a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/0.orig/T b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/0.orig/T index 92668052dd..b886a9d90a 100644 --- a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/0.orig/T +++ b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/0.orig/T @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: v2212 | +| \\ / O peration | Version: v2306 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -38,29 +38,34 @@ boundaryField value uniform 350; // For general testing purposes: - type exprFixedValue; + type uniformFixedValue; - functions + uniformValue { - trigger + type expression; + + functions { - type functionObjectTrigger; - triggers (2 4); - defaultValue true; + trigger + { + type functionObjectTrigger; + triggers (2 4); + defaultValue true; + } } + + variables + ( + "Tcrit = 500" + "par1 = mag(internalField(U))/snGrad(T)" + ); + + expression + #{ + Tcrit + + par1*internalField(T) * max((Tcrit-T)/(Tcrit)*deltaT()/time(),0) + #}; } - - variables - ( - "Tcrit = 500" - "par1 = mag(internalField(U))/snGrad(T)" - ); - - valueExpr - #{ - Tcrit - + par1*internalField(T) * max((Tcrit-T)/(Tcrit)*deltaT()/time(),0) - #}; } }