Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
laurence
2012-03-27 17:11:30 +01:00
7 changed files with 453 additions and 2 deletions

View File

@ -1590,7 +1590,11 @@ Foam::conformalVoronoiMesh::collapseFace
// collapseToPtI = faceBoundaryPts[0];
//
// collapseToPt =
// 0.5*(pts[faceBoundaryPts[0]] + pts[faceBoundaryPts[1]]);
// 0.5
// *(
// pts[faceBoundaryPts[0]]
// + pts[faceBoundaryPts[1]]
// );
// }
// else if (faceBoundaryPts.size() < f.size())
// {
@ -1646,7 +1650,11 @@ Foam::conformalVoronoiMesh::collapseFace
// collapseToPtI = faceBoundaryPts[0];
//
// collapseToPt =
// 0.5*(pts[faceBoundaryPts[0]] + pts[faceBoundaryPts[1]]);
// 0.5
// *(
// pts[faceBoundaryPts[0]]
// + pts[faceBoundaryPts[1]]
// );
// }
// else if (faceBoundaryPts.size() < f.size())
// {

View File

@ -124,6 +124,7 @@ $(derivedFvPatchFields)/mappedFixedPushedInternalValue/mappedFixedPushedInternal
$(derivedFvPatchFields)/mappedFixedValue/mappedFixedValueFvPatchFields.C
$(derivedFvPatchFields)/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C
$(derivedFvPatchFields)/mappedFlowRate/mappedFlowRateFvPatchVectorField.C
$(derivedFvPatchFields)/fixedMean/fixedMeanFvPatchFields.C
$(derivedFvPatchFields)/fan/fanFvPatchFields.C
$(derivedFvPatchFields)/fanPressure/fanPressureFvPatchScalarField.C
$(derivedFvPatchFields)/buoyantPressure/buoyantPressureFvPatchScalarField.C

View File

@ -0,0 +1,142 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "fixedMeanFvPatchField.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
fixedValueFvPatchField<Type>(p, iF),
meanValue_(pTraits<Type>::zero)
{}
template<class Type>
fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
(
const fixedMeanFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchField<Type>(ptf, p, iF, mapper),
meanValue_(ptf.meanValue_)
{}
template<class Type>
fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchField<Type>(p, iF, dict),
meanValue_(pTraits<Type>(dict.lookup("meanValue")))
{}
template<class Type>
fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
(
const fixedMeanFvPatchField<Type>& ptf
)
:
fixedValueFvPatchField<Type>(ptf),
meanValue_(ptf.meanValue_)
{}
template<class Type>
fixedMeanFvPatchField<Type>::fixedMeanFvPatchField
(
const fixedMeanFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
fixedValueFvPatchField<Type>(ptf, iF),
meanValue_(ptf.meanValue_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void fixedMeanFvPatchField<Type>::updateCoeffs()
{
if (this->updated())
{
return;
}
Field<Type> newValues(this->patchInternalField());
Type meanValuePsi =
gSum(this->patch().magSf()*newValues)
/gSum(this->patch().magSf());
if (mag(meanValue_) > SMALL && mag(meanValuePsi)/mag(meanValue_) > 0.5)
{
newValues *= mag(meanValue_)/mag(meanValuePsi);
}
else
{
newValues += (meanValue_ - meanValuePsi);
}
this->operator==(newValues);
fixedValueFvPatchField<Type>::updateCoeffs();
}
template<class Type>
void fixedMeanFvPatchField<Type>::write(Ostream& os) const
{
fvPatchField<Type>::write(os);
os.writeKeyword("meanValue") << meanValue_ << token::END_STATEMENT << nl;
this->writeEntry("value", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,158 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
Class
Foam::fixedMeanFvPatchField
Description
Extrapolates field to the patch using the near-cell values and adjusts
the distribution to match the specified meanValue.
SourceFiles
fixedMeanFvPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef fixedMeanFvPatchField_H
#define fixedMeanFvPatchField_H
#include "fixedValueFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class fixedMeanFvPatch Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class fixedMeanFvPatchField
:
public fixedValueFvPatchField<Type>
{
protected:
// Protected data
//- MeanValue value the field is adjusted to maintain
Type meanValue_;
public:
//- Runtime type information
TypeName("fixedMean");
// Constructors
//- Construct from patch and internal field
fixedMeanFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
fixedMeanFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given fixedMeanFvPatchField
// onto a new patch
fixedMeanFvPatchField
(
const fixedMeanFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
fixedMeanFvPatchField
(
const fixedMeanFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new fixedMeanFvPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
fixedMeanFvPatchField
(
const fixedMeanFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
(
new fixedMeanFvPatchField<Type>(*this, iF)
);
}
// Member functions
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "fixedMeanFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "fixedMeanFvPatchFields.H"
#include "volMesh.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(fixedMean);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef fixedMeanFvPatchFields_H
#define fixedMeanFvPatchFields_H
#include "fixedMeanFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(fixedMean);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef fixedMeanFvPatchFieldsFwd_H
#define fixedMeanFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class fixedMeanFvPatchField;
makePatchTypeFieldTypedefs(fixedMean);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //