ENH: Adding non-dimensional table input to fanPressure BC
Adding intertial term switch to solarLoad chtMultiRegionFoam case
This commit is contained in:
parent
d27d69e3f7
commit
e3701a47ae
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -61,7 +61,10 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
|||||||
:
|
:
|
||||||
totalPressureFvPatchScalarField(p, iF),
|
totalPressureFvPatchScalarField(p, iF),
|
||||||
fanCurve_(),
|
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),
|
totalPressureFvPatchScalarField(ptf, p, iF, mapper),
|
||||||
fanCurve_(ptf.fanCurve_),
|
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),
|
totalPressureFvPatchScalarField(p, iF, dict),
|
||||||
fanCurve_(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
|
Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
||||||
@ -99,7 +114,10 @@ Foam::fanPressureFvPatchScalarField::fanPressureFvPatchScalarField
|
|||||||
:
|
:
|
||||||
totalPressureFvPatchScalarField(pfopsf),
|
totalPressureFvPatchScalarField(pfopsf),
|
||||||
fanCurve_(pfopsf.fanCurve_),
|
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),
|
totalPressureFvPatchScalarField(pfopsf, iF),
|
||||||
fanCurve_(pfopsf.fanCurve_),
|
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);
|
<< 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
|
// 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
|
totalPressureFvPatchScalarField::updateCoeffs
|
||||||
(
|
(
|
||||||
@ -173,6 +207,10 @@ void Foam::fanPressureFvPatchScalarField::write(Ostream& os) const
|
|||||||
fanCurve_.write(os);
|
fanCurve_.write(os);
|
||||||
os.writeKeyword("direction")
|
os.writeKeyword("direction")
|
||||||
<< fanFlowDirectionNames_[direction_] << token::END_STATEMENT << nl;
|
<< fanFlowDirectionNames_[direction_] << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("nonDimensional") << nonDimensional_
|
||||||
|
<< token::END_STATEMENT << nl;
|
||||||
|
os.writeEntry("rpm", rpm_);
|
||||||
|
os.writeEntry("dm", dm_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -31,6 +31,24 @@ Description
|
|||||||
This boundary condition can be applied to assign either a pressure inlet
|
This boundary condition can be applied to assign either a pressure inlet
|
||||||
or outlet total pressure condition for a fan.
|
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
|
Usage
|
||||||
\table
|
\table
|
||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default value
|
||||||
@ -38,6 +56,9 @@ Usage
|
|||||||
outOfBounds | out of bounds handling | yes |
|
outOfBounds | out of bounds handling | yes |
|
||||||
direction | direction of flow through fan [in/out] | yes |
|
direction | direction of flow through fan [in/out] | yes |
|
||||||
p0 | environmental total pressure | 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
|
\endtable
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
Example of the boundary condition specification:
|
||||||
@ -116,6 +137,17 @@ private:
|
|||||||
//- Direction of flow through the fan relative to patch
|
//- Direction of flow through the fan relative to patch
|
||||||
fanFlowDirection direction_;
|
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:
|
public:
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@ dictionaryReplacement
|
|||||||
qrNbr none;
|
qrNbr none;
|
||||||
qr qr;
|
qr qr;
|
||||||
kappa none;
|
kappa none;
|
||||||
|
thermalInertia true;
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,6 +43,7 @@ dictionaryReplacement
|
|||||||
qrNbr none;
|
qrNbr none;
|
||||||
qr none;
|
qr none;
|
||||||
kappa none;
|
kappa none;
|
||||||
|
thermalInertia true;
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,6 +55,7 @@ dictionaryReplacement
|
|||||||
qrNbr qr;
|
qrNbr qr;
|
||||||
qr none;
|
qr none;
|
||||||
kappa none;
|
kappa none;
|
||||||
|
thermalInertia true;
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ dictionaryReplacement
|
|||||||
qrNbr qr;
|
qrNbr qr;
|
||||||
qr none;
|
qr none;
|
||||||
kappa none;
|
kappa none;
|
||||||
|
thermalInertia true;
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,6 +49,7 @@ dictionaryReplacement
|
|||||||
qrNbr none;
|
qrNbr none;
|
||||||
qr none;
|
qr none;
|
||||||
kappa none;
|
kappa none;
|
||||||
|
thermalInertia true;
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user