diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.C index 2cc9641d52b9b4008e9e2a14294f15afb39cccb7..9719903efc9c37a9667755f7114c466c7f6e3d1a 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -61,7 +61,10 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField : totalPressureFvPatchScalarField(p, iF), fanCurve_(), - direction_(ffdOut) + direction_(ffdOut), + nonDimensional_(false), + rpm_(0.0), + dm_(0.0) {} @@ -75,7 +78,10 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField : totalPressureFvPatchScalarField(ptf, p, iF, mapper), fanCurve_(ptf.fanCurve_), - direction_(ptf.direction_) + direction_(ptf.direction_), + nonDimensional_(ptf.nonDimensional_), + rpm_(ptf.rpm_), + dm_(ptf.dm_) {} @@ -88,8 +94,17 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField : totalPressureFvPatchScalarField(p, iF, dict), fanCurve_(dict), - direction_(fanFlowDirectionNames_.read(dict.lookup("direction"))) -{} + direction_(fanFlowDirectionNames_.read(dict.lookup("direction"))), + nonDimensional_(dict.lookupOrDefault<Switch>("nonDimensional", false)), + rpm_(dict.lookupOrDefault<scalar>("rpm", 0.0)), + dm_(dict.lookupOrDefault<scalar>("dm", 0.0)) +{ + if (nonDimensional_) + { + dict.lookup("rpm") >> rpm_; + dict.lookup("dm") >> dm_; + } +} Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField @@ -99,7 +114,10 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField : totalPressureFvPatchScalarField(pfopsf), fanCurve_(pfopsf.fanCurve_), - direction_(pfopsf.direction_) + direction_(pfopsf.direction_), + nonDimensional_(pfopsf.nonDimensional_), + rpm_(pfopsf.rpm_), + dm_(pfopsf.dm_) {} @@ -111,7 +129,10 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField : totalPressureFvPatchScalarField(pfopsf, iF), fanCurve_(pfopsf.fanCurve_), - direction_(pfopsf.direction_) + direction_(pfopsf.direction_), + nonDimensional_(pfopsf.nonDimensional_), + rpm_(pfopsf.rpm_), + dm_(pfopsf.dm_) {} @@ -156,8 +177,21 @@ void Foam::fanPressureFvPatchScalarField::updateCoeffs() << exit(FatalError); } + if (nonDimensional_) + { + // Create an adimensional flow rate + volFlowRate = + 120.0*volFlowRate/pow3(constant::mathematical::pi)/pow3(dm_); + } + // Pressure drop for this flow rate - const scalar pdFan = fanCurve_(max(volFlowRate, 0.0)); + scalar pdFan = fanCurve_(max(volFlowRate, 0.0)); + + if (nonDimensional_) + { + // Convert the adimensional deltap from curve into deltaP + pdFan = pdFan*pow4(constant::mathematical::pi)*rpm_*sqr(dm_)/1800; + } totalPressureFvPatchScalarField::updateCoeffs ( @@ -173,6 +207,10 @@ void Foam::fanPressureFvPatchScalarField::write(Ostream& os) const fanCurve_.write(os); os.writeKeyword("direction") << fanFlowDirectionNames_[direction_] << token::END_STATEMENT << nl; + os.writeKeyword("nonDimensional") << nonDimensional_ + << token::END_STATEMENT << nl; + os.writeEntry("rpm", rpm_); + os.writeEntry("dm", dm_); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.H index aa4b19f28b81caf81d591330afa3d343ce0cd860..e8744b192c90240e0f15e742d396b485bd44b744 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fanPressure/fanPressureFvPatchScalarField.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,6 +31,24 @@ Description This boundary condition can be applied to assign either a pressure inlet or outlet total pressure condition for a fan. + The switch nonDimensional can be used for a non-dimensional table. It needs + inputs rpm and dm of the fan. + + The nonDimensional flux for the table is calculate as : + + phi = 4.0*mDot/(rho*sqr(PI)*dm^3*omega) + where: + dm is the mean diameter. + omega is rad/sec. + + The nonDimensinal pressure : + + Psi = 2 deltaP/(rho*(sqr(PI*omega*dm))) + where: + deltaP is the pressure drop + + The non-dimensional table should be given as Psi = F(phi). + Usage \table Property | Description | Required | Default value @@ -38,6 +56,9 @@ Usage outOfBounds | out of bounds handling | yes | direction | direction of flow through fan [in/out] | yes | p0 | environmental total pressure | yes | + nonDimensional | uses non-dimensional table | no | false + rpm | fan rpm for non-dimensional table | no | 0.0 + dm | mean diameter for non-dimensional table | no | 0.0 \endtable Example of the boundary condition specification: @@ -116,6 +137,17 @@ private: //- Direction of flow through the fan relative to patch fanFlowDirection direction_; + //- Swtich for using non-dimensional curve + Switch nonDimensional_; + + // Parameters for non-dimensional table + + //- Fan rpm + scalar rpm_; + + //- Fan mean diameter + scalar dm_; + public: diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/air/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/air/changeDictionaryDict index 46208629875248ea9a0723a09c2d3026cd632907..9e4ef1a6b35a0a287a7da91c60270409b0613c29 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/air/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/air/changeDictionaryDict @@ -72,6 +72,7 @@ dictionaryReplacement qrNbr none; qr qr; kappa none; + thermalInertia true; value uniform 300; } } diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/floor/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/floor/changeDictionaryDict index 3860f7dc3fcc24b619a2f3a19ac13d94d2d8e0ef..1b15cfcc0613b25b41d073917a7e77771830fbb1 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/floor/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/floor/changeDictionaryDict @@ -43,6 +43,7 @@ dictionaryReplacement qrNbr none; qr none; kappa none; + thermalInertia true; value uniform 300; } @@ -54,6 +55,7 @@ dictionaryReplacement qrNbr qr; qr none; kappa none; + thermalInertia true; value uniform 300; } diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/solid/changeDictionaryDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/solid/changeDictionaryDict index 080b5fba86def0d2b8101ace168d0f0e7217dfbb..4c0e93ace8af2683d28905180d4f5530baefca21 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/solid/changeDictionaryDict +++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/solid/changeDictionaryDict @@ -37,6 +37,7 @@ dictionaryReplacement qrNbr qr; qr none; kappa none; + thermalInertia true; value uniform 300; } @@ -48,6 +49,7 @@ dictionaryReplacement qrNbr none; qr none; kappa none; + thermalInertia true; value uniform 300; }