diff --git a/src/OpenFOAM/primitives/functions/Function1/quadraticRamp/quadraticRamp.H b/src/OpenFOAM/primitives/functions/Function1/quadraticRamp/quadraticRamp.H index a7a13ca89d..8511515b93 100644 --- a/src/OpenFOAM/primitives/functions/Function1/quadraticRamp/quadraticRamp.H +++ b/src/OpenFOAM/primitives/functions/Function1/quadraticRamp/quadraticRamp.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,7 @@ Class Foam::Function1s::quadraticRamp Description - Quadratic ramp function starting from 0 and increasing quadraticRampally + Quadratic ramp function starting from 0 and increasing quadratically to 1 from \c t_0 over the \c duration and remaining at 1 thereafter. See also diff --git a/src/OpenFOAM/primitives/functions/Function1/squarePulse/squarePulse.H b/src/OpenFOAM/primitives/functions/Function1/squarePulse/squarePulse.H index 03785fd70a..bb61d02542 100644 --- a/src/OpenFOAM/primitives/functions/Function1/squarePulse/squarePulse.H +++ b/src/OpenFOAM/primitives/functions/Function1/squarePulse/squarePulse.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,9 +91,6 @@ class squarePulse //- Duration of the ramp function scalar duration_; - -private: - // Private Member Functions //- Read the coefficients from the given dictionary diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 1c1d209d18..f2222f6eb4 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -170,6 +170,8 @@ $(derivedFvPatchFields)/fixedMean/fixedMeanFvPatchFields.C $(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C $(derivedFvPatchFields)/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C $(derivedFvPatchFields)/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +$(derivedFvPatchFields)/flowRateInletVelocity/laminarBL/laminarBL.C +$(derivedFvPatchFields)/flowRateInletVelocity/turbulentBL/turbulentBL.C $(derivedFvPatchFields)/flowRateOutletVelocity/flowRateOutletVelocityFvPatchVectorField.C $(derivedFvPatchFields)/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C $(derivedFvPatchFields)/freestream/freestreamFvPatchFields.C diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C index 2f1de42df2..5eb0fb855d 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,6 +27,87 @@ License #include "addToRunTimeSelectionTable.H" #include "volFields.H" #include "one.H" +#include "patchPatchDist.H" +#include "wallPolyPatch.H" + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +void Foam::flowRateInletVelocityFvPatchVectorField::setWallDist() +{ + if (profile_.valid()) + { + const labelHashSet otherPatchIDs + ( + patch().patch().boundaryMesh().findPatchIDs() + ); + + const patchPatchDist pwd(patch().patch(), otherPatchIDs); + + y_ = pwd/gMax(pwd); + } + + area_ = gSum(patch().magSf()); +} + + +template +void Foam::flowRateInletVelocityFvPatchVectorField::updateValues +( + const ScaleType& scale, + const AlphaType& alpha, + const RhoType& rho +) +{ + const scalarField profile(this->profile()); + + const scalar avgU = + -(scale*flowRate_->value(db().time().userTimeValue())) + /gSum(alpha*rho*profile*patch().magSf()); + + operator==(avgU*profile*patch().nf()); +} + + +template +void Foam::flowRateInletVelocityFvPatchVectorField::updateValues +( + const AlphaType& alpha +) +{ + if (meanVelocity_) + { + updateValues(area_, alpha, one()); + } + else if (volumetric_ || rhoName_ == "none") + { + updateValues(one(), alpha, one()); + } + else + { + // Mass flow-rate + if (db().foundObject(rhoName_)) + { + const fvPatchField& rhop = + patch().lookupPatchField(rhoName_); + + updateValues(one(), alpha, rhop); + } + else + { + // Use constant density + if (rhoInlet_ < 0) + { + FatalErrorInFunction + << "Did not find registered density field " << rhoName_ + << " and no constant density 'rhoInlet' specified" + << exit(FatalError); + } + + updateValues(one(), alpha, rhoInlet_); + } + } +} + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -39,11 +120,13 @@ flowRateInletVelocityFvPatchVectorField : fixedValueFvPatchField(p, iF), flowRate_(), + profile_(), + meanVelocity_(false), volumetric_(false), rhoName_("rho"), - rhoInlet_(0.0), + rhoInlet_(0), alphaName_(word::null), - extrapolateProfile_(false) + area_(0) {} @@ -57,20 +140,23 @@ flowRateInletVelocityFvPatchVectorField : fixedValueFvPatchField(p, iF, dict, false), rhoInlet_(dict.lookupOrDefault("rhoInlet", -vGreat)), - alphaName_(dict.lookupOrDefault("alpha", word::null)), - extrapolateProfile_ - ( - dict.lookupOrDefault("extrapolateProfile", false) - ) + alphaName_(dict.lookupOrDefault("alpha", word::null)) { - if (dict.found("volumetricFlowRate")) + if (dict.found("meanVelocity")) { + meanVelocity_ = true; + volumetric_ = false; + flowRate_ = Function1::New("meanVelocity", dict); + } + else if (dict.found("volumetricFlowRate")) + { + meanVelocity_ = false; volumetric_ = true; flowRate_ = Function1::New("volumetricFlowRate", dict); - rhoName_ = "rho"; } else if (dict.found("massFlowRate")) { + meanVelocity_ = false; volumetric_ = false; flowRate_ = Function1::New("massFlowRate", dict); rhoName_ = word(dict.lookupOrDefault("rho", "rho")); @@ -80,10 +166,17 @@ flowRateInletVelocityFvPatchVectorField FatalIOErrorInFunction ( dict - ) << "Please supply either 'volumetricFlowRate' or" + ) << "Please supply 'meanVelocity', 'volumetricFlowRate' or" << " 'massFlowRate' and 'rho'" << exit(FatalIOError); } + if (dict.found("profile")) + { + profile_ = Function1::New("profile", dict); + } + + setWallDist(); + // Value field require if mass based if (dict.found("value")) { @@ -110,12 +203,15 @@ flowRateInletVelocityFvPatchVectorField : fixedValueFvPatchField(ptf, p, iF, mapper), flowRate_(ptf.flowRate_, false), + profile_(ptf.profile_, false), + meanVelocity_(ptf.meanVelocity_), volumetric_(ptf.volumetric_), rhoName_(ptf.rhoName_), rhoInlet_(ptf.rhoInlet_), - alphaName_(ptf.alphaName_), - extrapolateProfile_(ptf.extrapolateProfile_) -{} + alphaName_(ptf.alphaName_) +{ + setWallDist(); +} Foam::flowRateInletVelocityFvPatchVectorField:: @@ -127,103 +223,57 @@ flowRateInletVelocityFvPatchVectorField : fixedValueFvPatchField(ptf, iF), flowRate_(ptf.flowRate_, false), + profile_(ptf.profile_, false), + meanVelocity_(ptf.meanVelocity_), volumetric_(ptf.volumetric_), rhoName_(ptf.rhoName_), rhoInlet_(ptf.rhoInlet_), alphaName_(ptf.alphaName_), - extrapolateProfile_(ptf.extrapolateProfile_) + y_(ptf.y_), + area_(ptf.area_) {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -template -void Foam::flowRateInletVelocityFvPatchVectorField::updateValues +void Foam::flowRateInletVelocityFvPatchVectorField::autoMap ( - const AlphaType& alpha, - const RhoType& rho + const fvPatchFieldMapper& m ) { - const scalar t = db().time().userTimeValue(); + fixedValueFvPatchVectorField::autoMap(m); + setWallDist(); +} - const vectorField n(patch().nf()); - if (extrapolateProfile_) +void Foam::flowRateInletVelocityFvPatchVectorField::rmap +( + const fvPatchVectorField& ptf, + const labelList& addr +) +{ + fixedValueFvPatchVectorField::rmap(ptf, addr); + + const flowRateInletVelocityFvPatchVectorField& tiptf = + refCast(ptf); + + if (profile_.valid()) { - vectorField Up(this->patchInternalField()); - - // Patch normal extrapolated velocity - scalarField nUp(n & Up); - - // Remove the normal component of the extrapolate patch velocity - Up -= nUp*n; - - // Remove any reverse flow - nUp = min(nUp, scalar(0)); - - const scalar flowRate = flowRate_->value(t); - const scalar estimatedFlowRate = - -gSum(alpha*rho*(this->patch().magSf()*nUp)); - - if (estimatedFlowRate/flowRate > 0.5) - { - nUp *= mag(flowRate)/mag(estimatedFlowRate); - } - else - { - nUp -= - (flowRate - estimatedFlowRate) - /gSum(alpha*rho*patch().magSf()); - } - - // Add the corrected normal component of velocity to the patch velocity - Up += nUp*n; - - // Correct the patch velocity - this->operator==(Up); - } - else - { - const scalar avgU = - -flowRate_->value(t)/gSum(alpha*rho*patch().magSf()); - operator==(avgU*n); + y_.rmap(tiptf.y_, addr); } } -template -void Foam::flowRateInletVelocityFvPatchVectorField::updateValues -( - const AlphaType& alpha -) +Foam::tmp +Foam::flowRateInletVelocityFvPatchVectorField::profile() { - if (volumetric_ || rhoName_ == "none") + if (profile_.valid()) { - updateValues(alpha, one()); + return profile_->value(y_); } else { - // Mass flow-rate - if (db().foundObject(rhoName_)) - { - const fvPatchField& rhop = - patch().lookupPatchField(rhoName_); - - updateValues(alpha, rhop); - } - else - { - // Use constant density - if (rhoInlet_ < 0) - { - FatalErrorInFunction - << "Did not find registered density field " << rhoName_ - << " and no constant density 'rhoInlet' specified" - << exit(FatalError); - } - - updateValues(alpha, rhoInlet_); - } + return tmp(new scalarField(size(), scalar(1))); } } @@ -255,13 +305,16 @@ void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const { fvPatchField::write(os); writeEntry(os, flowRate_()); + if (profile_.valid()) + { + writeEntry(os, profile_()); + } if (!volumetric_) { writeEntryIfDifferent(os, "rho", "rho", rhoName_); writeEntryIfDifferent(os, "rhoInlet", -vGreat, rhoInlet_); } writeEntryIfDifferent(os, "alpha", word::null, alphaName_); - writeEntry(os, "extrapolateProfile", extrapolateProfile_); writeEntry(os, "value", *this); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H index 7423110617..531f258c04 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,9 +25,9 @@ Class Foam::flowRateInletVelocityFvPatchVectorField Description - Velocity inlet boundary condition either correcting the extrapolated - velocity or creating a uniform velocity field normal to the patch adjusted - to match the specified flow rate + Velocity inlet boundary condition creating a velocity field with + optionally specified profile normal to the patch adjusted to match the + specified mass flow rate, volumetric flow rate or mean velocity. For a mass-based flux: - the flow rate should be provided in kg/s @@ -42,12 +42,13 @@ Description Usage \table Property | Description | Required | Default value - massFlowRate | mass flow rate [kg/s] | no | - volumetricFlowRate | volumetric flow rate [m^3/s]| no | - rho | density field name | no | rho - rhoInlet | inlet density | no | - alpha | volume fraction field name | no | - extrapolateProfile | Extrapolate velocity profile | no | false + massFlowRate | Mass flow rate [kg/s] | no | + volumetricFlowRate | Volumetric flow rate [m^3/s]| no | + meanVelocity | Mean velocity [m/s]| no | + profile | Velocity profile | no | + rho | Density field name | no | rho + rhoInlet | Inlet density | no | + alpha | Volume fraction field name | no | \endtable Example of the boundary condition specification for a volumetric flow rate: @@ -56,8 +57,7 @@ Usage { type flowRateInletVelocity; volumetricFlowRate 0.2; - extrapolateProfile yes; - value uniform (0 0 0); + profile laminarBL; } \endverbatim @@ -67,14 +67,30 @@ Usage { type flowRateInletVelocity; massFlowRate 0.2; - extrapolateProfile yes; + profile turbulentBL; rho rho; rhoInlet 1.0; - value uniform (0 0 0); } \endverbatim - The \c flowRate entry is a \c Function1 of time, see Foam::Function1s. + Example of the boundary condition specification for a volumetric flow rate: + \verbatim + + { + type flowRateInletVelocity; + meanVelocity 5; + profile turbulentBL; + } + \endverbatim + + The \c volumetricFlowRate, \c massFlowRate or \c meanVelocity entries are + \c Function1 of time, see Foam::Function1s. + + The \c profile entry is a \c Function1 of the normalised distance to the + wall. Any suitable Foam::Function1s can be used including + Foam::Function1s::codedFunction1 but Foam::Function1s::laminarBL and + Foam::Function1s::turbulentBL have been created specifically for this + purpose and are likely to be appropriate for most cases. Note - \c rhoInlet is required for the case of a mass flow rate, where the @@ -85,6 +101,8 @@ Note See also Foam::fixedValueFvPatchField + Foam::Function1s::laminarBL + Foam::Function1s::turbulentBL Foam::Function1s Foam::flowRateOutletVelocityFvPatchVectorField @@ -117,7 +135,13 @@ class flowRateInletVelocityFvPatchVectorField //- Inlet integral flow rate autoPtr> flowRate_; - //- Is volumetric? + //- Optional velocity profile + autoPtr> profile_; + + //- Is the flow-rate mean velocity? + bool meanVelocity_; + + //- Is the flow-rate volumetric? bool volumetric_; //- Name of the density field used to normalise the mass flux @@ -130,16 +154,27 @@ class flowRateInletVelocityFvPatchVectorField // velocity word alphaName_; - //- Set true to extrapolate the velocity profile from the interior - Switch extrapolateProfile_; + //- Normalised distance to the wall + scalarField y_; + + //- Total area of patch + scalar area_; // Private Member Functions + //- Set the wall distance field y_ + void setWallDist(); + //- Update the patch values given the appropriate volume fraction and // density types and values - template - void updateValues(const AlphaType& alpha, const RhoType& rho); + template + void updateValues + ( + const ScaleType& scale, + const AlphaType& alpha, + const RhoType& rho + ); //- Update the patch values given the appropriate volume fraction type // and values @@ -209,6 +244,17 @@ public: // Member Functions + //- Map (and resize as needed) from self given a mapping object + // Used to update fields following mesh topology change + virtual void autoMap(const fvPatchFieldMapper&); + + //- Reverse map the given fvPatchField onto this fvPatchField + // Used to reconstruct fields + virtual void rmap(const fvPatchVectorField&, const labelList&); + + //- Return the normalised velocity profile + virtual tmp profile(); + //- Update the coefficients associated with the patch field virtual void updateCoeffs(); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/laminarBL/laminarBL.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/laminarBL/laminarBL.C new file mode 100644 index 0000000000..def6eead17 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/laminarBL/laminarBL.C @@ -0,0 +1,63 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "laminarBL.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace Function1s +{ + makeScalarFunction1(laminarBL); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::Function1s::laminarBL::laminarBL +( + const word& name, + const dictionary& dict +) +: + FieldFunction1(name) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::Function1s::laminarBL::~laminarBL() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::Function1s::laminarBL::write(Ostream& os) const +{} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/laminarBL/laminarBL.H b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/laminarBL/laminarBL.H new file mode 100644 index 0000000000..098757c780 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/laminarBL/laminarBL.H @@ -0,0 +1,125 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::Function1s::laminarBL + +Description + Laminar boundary-layer function yHat*(2 - yHat) + + where yHat is the normalised distance to the wall. + + Usage: + \verbatim + laminarBL; + \endverbatim + +See also + Foam::Function1 + Foam::Function1s::turbulentBL + +SourceFiles + laminarBL.C + +\*---------------------------------------------------------------------------*/ + +#ifndef laminarBL_H +#define laminarBL_H + +#include "Function1.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace Function1s +{ + +/*---------------------------------------------------------------------------*\ + Class laminarBL Declaration +\*---------------------------------------------------------------------------*/ + +class laminarBL +: + public FieldFunction1 +{ + +public: + + // Runtime type information + TypeName("laminarBL"); + + + // Constructors + + //- Construct from name and dictionary + laminarBL + ( + const word& name, + const dictionary& dict + ); + + + //- Destructor + virtual ~laminarBL(); + + + // Member Functions + + //- Return value for time t + virtual inline scalar value(const scalar t) const; + + //- Return the integral between times t1 and t2 + virtual inline scalar integral + ( + const scalar t1, + const scalar t2 + ) const; + + //- Write data to dictionary stream + virtual void write(Ostream& os) const; + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const laminarBL&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Function1s +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "laminarBLI.H" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/laminarBL/laminarBLI.H b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/laminarBL/laminarBLI.H new file mode 100644 index 0000000000..67626429fe --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/laminarBL/laminarBLI.H @@ -0,0 +1,47 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "laminarBL.H" + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline Foam::scalar Foam::Function1s::laminarBL::value(const scalar t) const +{ + return t*(2 - t); +} + + +inline Foam::scalar Foam::Function1s::laminarBL::integral +( + const scalar t1, + const scalar t2 +) const +{ + NotImplemented; + return NaN; +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/turbulentBL/turbulentBL.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/turbulentBL/turbulentBL.C new file mode 100644 index 0000000000..84fd7bc8c7 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/turbulentBL/turbulentBL.C @@ -0,0 +1,75 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "turbulentBL.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace Function1s +{ + makeScalarFunction1(turbulentBL); +} +} + + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +void Foam::Function1s::turbulentBL::read(const dictionary& dict) +{ + exponent_ = dict.lookupOrDefault("exponent", 1.0/7.0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::Function1s::turbulentBL::turbulentBL +( + const word& name, + const dictionary& dict +) +: + FieldFunction1(name) +{ + read(dict); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::Function1s::turbulentBL::~turbulentBL() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::Function1s::turbulentBL::write(Ostream& os) const +{ + writeEntry(os, "exponent", exponent_); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/turbulentBL/turbulentBL.H b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/turbulentBL/turbulentBL.H new file mode 100644 index 0000000000..9fe44d35f1 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/turbulentBL/turbulentBL.H @@ -0,0 +1,145 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::Function1s::turbulentBL + +Description + Turbulent boundary-layer function pow(yHat, exponent) + + where yHat is the normalised distance to the wall and the optional exponent + defaults to 1/7. + + Usage: + \verbatim + turbulentBL; + \endverbatim + or + \verbatim + + { + type turbulentBL; + exponent 0.143; + } + \endverbatim + +See also + Foam::Function1 + Foam::Function1s::laminarBL + +SourceFiles + turbulentBL.C + +\*---------------------------------------------------------------------------*/ + +#ifndef turbulentBL_H +#define turbulentBL_H + +#include "Function1.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace Function1s +{ + +/*---------------------------------------------------------------------------*\ + Class turbulentBL Declaration +\*---------------------------------------------------------------------------*/ + +class turbulentBL +: + public FieldFunction1 +{ + // Private data + + //- Exponent of the pow function + scalar exponent_; + + + // Private Member Functions + + //- Read the coefficients from the given dictionary + void read(const dictionary& dict); + + +public: + + // Runtime type information + TypeName("turbulentBL"); + + + // Constructors + + //- Construct from name and dictionary + turbulentBL + ( + const word& name, + const dictionary& dict + ); + + + //- Destructor + virtual ~turbulentBL(); + + + // Member Functions + + //- Return value for time t + virtual inline scalar value(const scalar t) const; + + //- Return the integral between times t1 and t2 + virtual inline scalar integral + ( + const scalar t1, + const scalar t2 + ) const; + + //- Write data to dictionary stream + virtual void write(Ostream& os) const; + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const turbulentBL&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Function1s +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "turbulentBLI.H" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/turbulentBL/turbulentBLI.H b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/turbulentBL/turbulentBLI.H new file mode 100644 index 0000000000..949614d4e8 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/turbulentBL/turbulentBLI.H @@ -0,0 +1,47 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "turbulentBL.H" + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +inline Foam::scalar Foam::Function1s::turbulentBL::value(const scalar t) const +{ + return pow(t, exponent_); +} + + +inline Foam::scalar Foam::Function1s::turbulentBL::integral +( + const scalar t1, + const scalar t2 +) const +{ + NotImplemented; + return NaN; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloudI.H b/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloudI.H index df38a84634..6a98d54e39 100644 --- a/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloudI.H +++ b/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloudI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -256,10 +256,20 @@ Foam::ThermoCloud::Sh(const volScalarField& hs) const const volScalarField::Internal Vdt(this->mesh().V()*this->db().time().deltaT()); - return - hsTrans()/Vdt - - fvm::SuSp(hsCoeff()/(Cp*Vdt), hs) - + hsCoeff()/(Cp*Vdt)*hs; + if (hs.dimensions() == dimTemperature) + { + return + hsTrans()/Vdt + - fvm::SuSp(hsCoeff()/Vdt, hs) + + (hsCoeff()/Vdt)*hs; + } + else + { + return + hsTrans()/Vdt + - fvm::SuSp(hsCoeff()/(Cp*Vdt), hs) + + hsCoeff()/(Cp*Vdt)*hs; + } } else { diff --git a/tutorials/combustion/reactingFoam/Lagrangian/verticalChannel/0/U.orig b/tutorials/combustion/reactingFoam/Lagrangian/verticalChannel/0/U.orig index ac70ed6eb6..19a0bc04a7 100644 --- a/tutorials/combustion/reactingFoam/Lagrangian/verticalChannel/0/U.orig +++ b/tutorials/combustion/reactingFoam/Lagrangian/verticalChannel/0/U.orig @@ -33,12 +33,14 @@ boundaryField type flowRateInletVelocity; massFlowRate constant 0.00379; rhoInlet 1.0; // fallback value for e.g. potentialFoam + profile turbulentBL; } inletSides { type flowRateInletVelocity; massFlowRate constant 0.00832; rhoInlet 1.0; // fallback value for e.g. potentialFoam + profile turbulentBL; } outlet { diff --git a/tutorials/combustion/reactingFoam/Lagrangian/verticalChannel/0/k b/tutorials/combustion/reactingFoam/Lagrangian/verticalChannel/0/k index 701739de63..43b48312e6 100644 --- a/tutorials/combustion/reactingFoam/Lagrangian/verticalChannel/0/k +++ b/tutorials/combustion/reactingFoam/Lagrangian/verticalChannel/0/k @@ -31,13 +31,13 @@ boundaryField inletCentral { type turbulentIntensityKineticEnergyInlet; - intensity 0.15; + intensity 0.05; value uniform 3.75e-9; } inletSides { type turbulentIntensityKineticEnergyInlet; - intensity 0.16; + intensity 0.05; value uniform 3.75e-9; } outlet diff --git a/tutorials/combustion/reactingFoam/Lagrangian/verticalChannelLTS/0/U.orig b/tutorials/combustion/reactingFoam/Lagrangian/verticalChannelLTS/0/U.orig index ac70ed6eb6..19a0bc04a7 100644 --- a/tutorials/combustion/reactingFoam/Lagrangian/verticalChannelLTS/0/U.orig +++ b/tutorials/combustion/reactingFoam/Lagrangian/verticalChannelLTS/0/U.orig @@ -33,12 +33,14 @@ boundaryField type flowRateInletVelocity; massFlowRate constant 0.00379; rhoInlet 1.0; // fallback value for e.g. potentialFoam + profile turbulentBL; } inletSides { type flowRateInletVelocity; massFlowRate constant 0.00832; rhoInlet 1.0; // fallback value for e.g. potentialFoam + profile turbulentBL; } outlet { diff --git a/tutorials/combustion/reactingFoam/Lagrangian/verticalChannelLTS/0/k b/tutorials/combustion/reactingFoam/Lagrangian/verticalChannelLTS/0/k index 701739de63..43b48312e6 100644 --- a/tutorials/combustion/reactingFoam/Lagrangian/verticalChannelLTS/0/k +++ b/tutorials/combustion/reactingFoam/Lagrangian/verticalChannelLTS/0/k @@ -31,13 +31,13 @@ boundaryField inletCentral { type turbulentIntensityKineticEnergyInlet; - intensity 0.15; + intensity 0.05; value uniform 3.75e-9; } inletSides { type turbulentIntensityKineticEnergyInlet; - intensity 0.16; + intensity 0.05; value uniform 3.75e-9; } outlet diff --git a/tutorials/combustion/reactingFoam/Lagrangian/verticalChannelSteady/0/U.orig b/tutorials/combustion/reactingFoam/Lagrangian/verticalChannelSteady/0/U.orig index 82707bcd30..a53468af21 100644 --- a/tutorials/combustion/reactingFoam/Lagrangian/verticalChannelSteady/0/U.orig +++ b/tutorials/combustion/reactingFoam/Lagrangian/verticalChannelSteady/0/U.orig @@ -33,6 +33,7 @@ boundaryField type flowRateInletVelocity; rhoInlet 1.2; massFlowRate constant 0.00379; + profile turbulentBL; value uniform (0 14.68 0); } inletSides @@ -40,6 +41,7 @@ boundaryField type flowRateInletVelocity; rhoInlet 1.2; massFlowRate constant 0.00832; + profile turbulentBL; value uniform (0 17.79 0); } outlet diff --git a/tutorials/combustion/reactingFoam/Lagrangian/verticalChannelSteady/0/k b/tutorials/combustion/reactingFoam/Lagrangian/verticalChannelSteady/0/k index 701739de63..43b48312e6 100644 --- a/tutorials/combustion/reactingFoam/Lagrangian/verticalChannelSteady/0/k +++ b/tutorials/combustion/reactingFoam/Lagrangian/verticalChannelSteady/0/k @@ -31,13 +31,13 @@ boundaryField inletCentral { type turbulentIntensityKineticEnergyInlet; - intensity 0.15; + intensity 0.05; value uniform 3.75e-9; } inletSides { type turbulentIntensityKineticEnergyInlet; - intensity 0.16; + intensity 0.05; value uniform 3.75e-9; } outlet diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/0/U b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/0/U index 1f1a10b72a..f18631f94d 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/0/U +++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/0/U @@ -34,6 +34,7 @@ boundaryField { type flowRateInletVelocity; massFlowRate constant 0.1; + profile turbulentBL; rhoInlet 1; // estimate for initial rho } diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/0/U b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/0/U index 96cce749ee..2ffa6e0c9a 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/0/U +++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/0/U @@ -34,6 +34,7 @@ boundaryField { type flowRateInletVelocity; massFlowRate constant 0.1; + profile turbulentBL; value uniform (0 0 0); } diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/0/U b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/0/U index 236d3b0cf0..8928c6f66a 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/0/U +++ b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/0/U @@ -29,6 +29,7 @@ boundaryField type flowRateInletVelocity; massFlowRate constant 5; rhoInlet 1000; // Guess for rho + profile turbulentBL; } outlet diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/fvSchemes b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/fvSchemes index 8b526f31e9..356c6003f7 100644 --- a/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/fvSchemes +++ b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/fvSchemes @@ -30,7 +30,7 @@ divSchemes { default none; - div(phi,U) Gauss linearUpwind limited; + div(phi,U) Gauss linearUpwindV limited; div(phi,e) Gauss linearUpwind limited; div(phi,epsilon) Gauss linearUpwind limited; div(phi,k) Gauss linearUpwind limited; diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/U b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/U index 7c21784eb7..39c8ec7c0e 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/U +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/U @@ -34,6 +34,7 @@ boundaryField { type flowRateInletVelocity; massFlowRate constant 0.1; + profile turbulentBL; value uniform (0 0 0); } diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/U b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/U index 7c21784eb7..39c8ec7c0e 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/U +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/U @@ -34,6 +34,7 @@ boundaryField { type flowRateInletVelocity; massFlowRate constant 0.1; + profile turbulentBL; value uniform (0 0 0); } diff --git a/tutorials/compressible/rhoSimpleFoam/squareBend/0/U b/tutorials/compressible/rhoSimpleFoam/squareBend/0/U index 505aba637d..2f43261bde 100644 --- a/tutorials/compressible/rhoSimpleFoam/squareBend/0/U +++ b/tutorials/compressible/rhoSimpleFoam/squareBend/0/U @@ -28,6 +28,7 @@ boundaryField type flowRateInletVelocity; massFlowRate constant 0.5; rhoInlet 0.5; // Guess for rho + profile turbulentBL; } outlet { diff --git a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/0/U b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/0/U index b0950b9137..9e7405ae2b 100644 --- a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/0/U +++ b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/0/U @@ -28,6 +28,7 @@ boundaryField type flowRateInletVelocity; massFlowRate constant 5; rhoInlet 1000; // Guess for rho + profile turbulentBL; } outlet { diff --git a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/fvSchemes b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/fvSchemes index 98ffbd757f..ad0ae211ec 100644 --- a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/fvSchemes +++ b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/fvSchemes @@ -30,7 +30,7 @@ divSchemes { default none; - div(phi,U) bounded Gauss linearUpwind limited; + div(phi,U) bounded Gauss linearUpwindV limited; div(phi,h) bounded Gauss linearUpwind limited; div(phi,e) bounded Gauss linearUpwind limited; div(phi,epsilon) bounded Gauss linearUpwind limited; diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/shellAndTubeHeatExchanger/0/shell/U b/tutorials/heatTransfer/chtMultiRegionFoam/shellAndTubeHeatExchanger/0/shell/U index d6e4187c0c..a136dc1182 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/shellAndTubeHeatExchanger/0/shell/U +++ b/tutorials/heatTransfer/chtMultiRegionFoam/shellAndTubeHeatExchanger/0/shell/U @@ -31,6 +31,7 @@ boundaryField { type flowRateInletVelocity; massFlowRate constant 0.05; + profile turbulentBL; value $internalField; } wall diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/shellAndTubeHeatExchanger/0/tube/U b/tutorials/heatTransfer/chtMultiRegionFoam/shellAndTubeHeatExchanger/0/tube/U index b26c369db6..ebab41f8c8 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/shellAndTubeHeatExchanger/0/tube/U +++ b/tutorials/heatTransfer/chtMultiRegionFoam/shellAndTubeHeatExchanger/0/tube/U @@ -26,6 +26,7 @@ boundaryField { type flowRateInletVelocity; massFlowRate constant 0.05; + profile turbulentBL; value $internalField; } upper diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/U b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/U index c07b8eff2e..804ed2630f 100644 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/U +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/U @@ -34,6 +34,7 @@ boundaryField { type flowRateInletVelocity; volumetricFlowRate constant 0.1; + profile turbulentBL; } outlet diff --git a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/U b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/U index d0f0d13e17..67d7dc0fcf 100644 --- a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/U +++ b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/U @@ -40,7 +40,7 @@ boundaryField { type flowRateInletVelocity; volumetricFlowRate constant 0.1; -// value uniform (0.1 0 0); + profile turbulentBL; } outlet { diff --git a/tutorials/multiphase/interFoam/RAS/angledDuct/0/U b/tutorials/multiphase/interFoam/RAS/angledDuct/0/U index f413cd54aa..a732542654 100644 --- a/tutorials/multiphase/interFoam/RAS/angledDuct/0/U +++ b/tutorials/multiphase/interFoam/RAS/angledDuct/0/U @@ -34,6 +34,7 @@ boundaryField { type flowRateInletVelocity; massFlowRate constant 0.1; + profile turbulentBL; value uniform (0 0 0); } diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/0/U.vapor b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/0/U.vapor index 24bf543192..9792e887f4 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/0/U.vapor +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesis/0/U.vapor @@ -24,8 +24,9 @@ boundaryField inlet { type flowRateInletVelocity; - massFlowRate 2.173893E-07; + massFlowRate 2.173893e-07; rho thermo:rho.vapor; + profile laminarBL; value $internalField; } diff --git a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/0/U.vapor b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/0/U.vapor index 24bf543192..9792e887f4 100644 --- a/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/0/U.vapor +++ b/tutorials/multiphase/multiphaseEulerFoam/laminar/titaniaSynthesisSurface/0/U.vapor @@ -24,8 +24,9 @@ boundaryField inlet { type flowRateInletVelocity; - massFlowRate 2.173893E-07; + massFlowRate 2.173893e-07; rho thermo:rho.vapor; + profile laminarBL; value $internalField; } diff --git a/tutorials/resources/blockMesh/angledDuct b/tutorials/resources/blockMesh/angledDuct index 5f32405729..6f46137b69 100644 --- a/tutorials/resources/blockMesh/angledDuct +++ b/tutorials/resources/blockMesh/angledDuct @@ -58,8 +58,8 @@ vertices #codeStream points = transform(Rz(degToRad($angle)), points); // Append points 6 and 7 - points.append(points[0] - point($lenInlet, 0, 0)); // pt 6 - points.append(points[3] - point($lenInlet, 0, 0)); // pt 7 + points.append(point(-$lenInlet, points[0].y(), points[0].z())); // pt 6 + points.append(point(-$lenInlet, points[3].y(), points[3].z())); // pt 7 // Duplicate z points points.append(cmptMultiply(points, vector(1, 1, -1)));