mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://dm/home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -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
|
||||
@ -168,7 +168,7 @@ namespace Foam
|
||||
FatalErrorIn("fileMonitorWatcher(const bool, const label)")
|
||||
<< "You selected inotify but this file was compiled"
|
||||
<< " without FOAM_USE_INOTIFY"
|
||||
<< "Please select another fileModification test method"
|
||||
<< " Please select another fileModification test method"
|
||||
<< exit(FatalError);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ flowRateInletVelocityFvPatchVectorField
|
||||
)
|
||||
:
|
||||
fixedValueFvPatchField<vector>(p, iF),
|
||||
rhoInlet_(0.0)
|
||||
rhoInlet_(dict.lookupOrDefault<scalar>("rhoInlet", -VGREAT))
|
||||
{
|
||||
if (dict.found("volumetricFlowRate"))
|
||||
{
|
||||
@ -107,14 +107,9 @@ flowRateInletVelocityFvPatchVectorField
|
||||
vectorField("value", dict, p.size())
|
||||
);
|
||||
}
|
||||
else if (volumetric_)
|
||||
{
|
||||
evaluate(Pstream::blocking);
|
||||
}
|
||||
else
|
||||
{
|
||||
rhoInlet_ = readScalar(dict.lookup("rhoInlet"));
|
||||
updateCoeffs(rhoInlet_);
|
||||
evaluate(Pstream::blocking);
|
||||
}
|
||||
}
|
||||
|
||||
@ -202,10 +197,30 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
else
|
||||
{
|
||||
// mass flow-rate
|
||||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
if
|
||||
(
|
||||
patch().boundaryMesh().mesh().foundObject<volScalarField>(rhoName_)
|
||||
)
|
||||
{
|
||||
const fvPatchField<scalar>& rhop =
|
||||
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||
|
||||
operator==(n*avgU/rhop);
|
||||
operator==(n*avgU/rhop);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use constant density
|
||||
if (rhoInlet_ < 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"flowRateInletVelocityFvPatchVectorField::updateCoeffs()"
|
||||
) << "Did not find registered density field " << rhoName_
|
||||
<< " and no constant density 'rhoInlet' specified"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
operator==(n*avgU/rhoInlet_);
|
||||
}
|
||||
}
|
||||
|
||||
fixedValueFvPatchField<vector>::updateCoeffs();
|
||||
@ -219,7 +234,7 @@ void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const
|
||||
if (!volumetric_)
|
||||
{
|
||||
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
||||
os.writeKeyword("rhoInlet") << rhoInlet_ << token::END_STATEMENT << nl;
|
||||
writeEntryIfDifferent<scalar>(os, "rhoInlet", -VGREAT, rhoInlet_);
|
||||
}
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
@ -29,7 +29,7 @@ Description
|
||||
magnitude as an integral over its area.
|
||||
|
||||
Either specify 'volumetricFlowRate' or 'massFlowRate' (requires additional
|
||||
'rho' entry).
|
||||
'rho' or 'rhoInlet' entry).
|
||||
|
||||
Example of the boundary condition specification:
|
||||
\verbatim
|
||||
@ -44,9 +44,10 @@ Description
|
||||
inlet
|
||||
{
|
||||
type flowRateInletVelocity;
|
||||
volumetricFlowRate 0.2; // mass flow rate [kg/s]
|
||||
massFlowRate 0.2; // mass flow rate [kg/s]
|
||||
rho rho; // rho [m3/s or kg/s]
|
||||
value uniform (0 0 0); // placeholder
|
||||
rhoInlet 1.0 // uniform rho if no rho field registered
|
||||
// (e.g. at startup)
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
|
||||
Reference in New Issue
Block a user