Merge commit 'OpenCFD/master' into olesenm

This commit is contained in:
Mark Olesen
2009-01-29 14:08:33 +01:00
18 changed files with 633 additions and 63 deletions

View File

@ -39,63 +39,11 @@ Description
Foam::Istream& Foam::operator>>(Istream& is, bool& b)
{
// we could also process everything via Switch
// The error messages are the problem: they are from SwitchIO.C
// Switch sw(is);
//
// if (is.good())
// {
// b = sw;
// }
//
// return is;
//
//
token t(is);
if (!t.good())
if (is.good())
{
is.setBad();
return is;
b = Switch(is);
}
if (t.isLabel())
{
b = bool(t.labelToken());
}
else if (t.isWord())
{
// allow invalid values, but catch after for correct error message
Switch::switchType sw = Switch::asEnum(t.wordToken(), true);
if (sw == Switch::INVALID)
{
is.setBad();
FatalIOErrorIn("operator>>(Istream&, bool&)", is)
<< "expected 'true/false', 'on/off', found " << t.wordToken()
<< exit(FatalIOError);
return is;
}
else
{
b = Switch::asBool(sw);
}
}
else
{
is.setBad();
FatalIOErrorIn("operator>>(Istream&, bool/Switch&)", is)
<< "wrong token type - expected bool found " << t
<< exit(FatalIOError);
return is;
}
// Check state of Istream
is.check("Istream& operator>>(Istream&, bool&)");
return is;
}

View File

@ -2342,8 +2342,8 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::zonify
}
// Make sure namedSurfaceIndex is unset inbetween same cell cell zones.
makeConsistentFaceIndex(cellToZone, namedSurfaceIndex);
//// Make sure namedSurfaceIndex is unset inbetween same cell cell zones.
//makeConsistentFaceIndex(cellToZone, namedSurfaceIndex);
// Topochange container

View File

@ -93,6 +93,7 @@ $(derivedFvPatchFields)/directMappedFixedValue/directMappedFixedValueFvPatchFiel
$(derivedFvPatchFields)/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
$(derivedFvPatchFields)/fan/fanFvPatchFields.C
$(derivedFvPatchFields)/fixedFluxBuoyantPressure/fixedFluxBuoyantPressureFvPatchScalarField.C
$(derivedFvPatchFields)/fixedFluxBoussinesqBuoyantPressure/fixedFluxBoussinesqBuoyantPressureFvPatchScalarField.C
$(derivedFvPatchFields)/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C
$(derivedFvPatchFields)/fixedInternalValueFvPatchField/fixedInternalValueFvPatchFields.C
$(derivedFvPatchFields)/fixedNormalSlip/fixedNormalSlipFvPatchFields.C

View File

@ -0,0 +1,149 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "fixedFluxBoussinesqBuoyantPressureFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField::
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedGradientFvPatchScalarField(p, iF)
{}
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField::
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField
(
const fixedFluxBoussinesqBuoyantPressureFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedGradientFvPatchScalarField(ptf, p, iF, mapper)
{}
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField::
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary&
)
:
fixedGradientFvPatchScalarField(p, iF)
{
fvPatchField<scalar>::operator=(patchInternalField());
gradient() = 0.0;
}
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField::
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField
(
const fixedFluxBoussinesqBuoyantPressureFvPatchScalarField& wbppsf
)
:
fixedGradientFvPatchScalarField(wbppsf)
{}
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField::
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField
(
const fixedFluxBoussinesqBuoyantPressureFvPatchScalarField& wbppsf,
const DimensionedField<scalar, volMesh>& iF
)
:
fixedGradientFvPatchScalarField(wbppsf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void fixedFluxBoussinesqBuoyantPressureFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
const dictionary& environmentalProperties
= db().lookupObject<IOdictionary>("environmentalProperties");
dimensionedVector g(environmentalProperties.lookup("g"));
const dictionary& transportProperties
= db().lookupObject<IOdictionary>("transportProperties");
dimensionedScalar beta(transportProperties.lookup("beta"));
const fvPatchField<scalar>& T =
patch().lookupPatchField<volScalarField, scalar>("T");
gradient() = beta.value()*T.snGrad()*(g.value() & patch().Cf());
fixedGradientFvPatchScalarField::updateCoeffs();
}
void fixedFluxBoussinesqBuoyantPressureFvPatchScalarField::write
(
Ostream& os
) const
{
fixedGradientFvPatchScalarField::write(os);
writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeField
(
fvPatchScalarField,
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,148 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::fixedFluxBoussinesqBuoyantPressureFvPatchScalarField
Description
Boundary condition on pressure for use with buoyant solvers employing the
Boussinesq approximation to balance the flux generated by the temperature
gradient.
SourceFiles
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef fixedFluxBoussinesqBuoyantPressureFvPatchScalarFields_H
#define fixedFluxBoussinesqBuoyantPressureFvPatchScalarFields_H
#include "fvPatchFields.H"
#include "fixedGradientFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class fixedFluxBoussinesqBuoyantPressureFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class fixedFluxBoussinesqBuoyantPressureFvPatchScalarField
:
public fixedGradientFvPatchScalarField
{
public:
//- Runtime type information
TypeName("fixedFluxBoussinesqBuoyantPressure");
// Constructors
//- Construct from patch and internal field
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// fixedFluxBoussinesqBuoyantPressureFvPatchScalarField onto a new
// patch
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField
(
const fixedFluxBoussinesqBuoyantPressureFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField
(
const fixedFluxBoussinesqBuoyantPressureFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new fixedFluxBoussinesqBuoyantPressureFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
fixedFluxBoussinesqBuoyantPressureFvPatchScalarField
(
const fixedFluxBoussinesqBuoyantPressureFvPatchScalarField&,
const DimensionedField<scalar, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchScalarField> clone
(
const DimensionedField<scalar, volMesh>& iF
) const
{
return tmp<fvPatchScalarField>
(
new fixedFluxBoussinesqBuoyantPressureFvPatchScalarField
(
*this,
iF
)
);
}
// Member functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //