dummy bc for 1-D premixed flame

This commit is contained in:
ignis 2018-09-04 18:35:41 +09:00
parent 2746e92165
commit cf56850a5b
4 changed files with 372 additions and 0 deletions

View file

@ -0,0 +1,3 @@
flameControllingVelocityFvPatchVectorField.C
LIB = $(FOAM_USER_LIBBIN)/libFlameBC

View file

@ -0,0 +1,9 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
LIB_LIBS = \
-lOpenFOAM \
-ltriSurface \
-lmeshTools

View file

@ -0,0 +1,165 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 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 "flameControllingVelocityFvPatchVectorField.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
#include "fvPatchFieldMapper.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::flameControllingVelocityFvPatchVectorField::
flameControllingVelocityFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF
)
:
fixedValueFvPatchVectorField(p, iF),
refValue_(p.size())
{}
Foam::flameControllingVelocityFvPatchVectorField::
flameControllingVelocityFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
refValue_("refValue", dict, p.size())
{
fvPatchVectorField::operator=(refValue_*patch().nf());
}
Foam::flameControllingVelocityFvPatchVectorField::
flameControllingVelocityFvPatchVectorField
(
const flameControllingVelocityFvPatchVectorField& ptf,
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchVectorField(p, iF),
refValue_(ptf.refValue_, mapper)
{
// Note: calculate product only on ptf to avoid multiplication on
// unset values in reconstructPar.
fvPatchVectorField::operator=
(
vectorField
(
ptf.refValue_*ptf.patch().nf(),
mapper
)
);
}
Foam::flameControllingVelocityFvPatchVectorField::
flameControllingVelocityFvPatchVectorField
(
const flameControllingVelocityFvPatchVectorField& pivpvf
)
:
fixedValueFvPatchVectorField(pivpvf),
refValue_(pivpvf.refValue_)
{}
Foam::flameControllingVelocityFvPatchVectorField::
flameControllingVelocityFvPatchVectorField
(
const flameControllingVelocityFvPatchVectorField& pivpvf,
const DimensionedField<vector, volMesh>& iF
)
:
fixedValueFvPatchVectorField(pivpvf, iF),
refValue_(pivpvf.refValue_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::flameControllingVelocityFvPatchVectorField::autoMap
(
const fvPatchFieldMapper& m
)
{
fixedValueFvPatchVectorField::autoMap(m);
refValue_.autoMap(m);
}
void Foam::flameControllingVelocityFvPatchVectorField::rmap
(
const fvPatchVectorField& ptf,
const labelList& addr
)
{
fixedValueFvPatchVectorField::rmap(ptf, addr);
const flameControllingVelocityFvPatchVectorField& tiptf =
refCast<const flameControllingVelocityFvPatchVectorField>(ptf);
refValue_.rmap(tiptf.refValue_, addr);
}
void Foam::flameControllingVelocityFvPatchVectorField::updateCoeffs()
{
if (updated())
{
return;
}
fvPatchVectorField::operator=(refValue_*patch().nf());
fvPatchVectorField::updateCoeffs();
}
void Foam::flameControllingVelocityFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
refValue_.writeEntry("refValue", os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchVectorField,
flameControllingVelocityFvPatchVectorField
);
}
// ************************************************************************* //

View file

@ -0,0 +1,195 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 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::flameControllingVelocityFvPatchVectorField
Group
grpGenericBoundaryConditions grpInletBoundaryConditions
Description
This boundary condition provides a surface-normal vector boundary condition
by its magnitude.
Usage
\table
Property | Description | Required | Default value
refValue | reference value | yes |
\endtable
Example of the boundary condition specification:
\verbatim
<patchName>
{
type flameControllingVelocity;
refValue uniform -10; // 10 INTO the domain
}
\endverbatim
Note
Sign conventions:
- the value is positive for outward-pointing vectors
See also
Foam::fixedValueFvPatchField
SourceFiles
flameControllingVelocityFvPatchVectorField.C
\*---------------------------------------------------------------------------*/
#ifndef flameControllingVelocityFvPatchVectorField_H
#define flameControllingVelocityFvPatchVectorField_H
#include "fvPatchFields.H"
#include "fixedValueFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class flameControllingVelocityFvPatchVectorField Declaration
\*---------------------------------------------------------------------------*/
class flameControllingVelocityFvPatchVectorField
:
public fixedValueFvPatchVectorField
{
// Private data
scalarField refValue_;
public:
//- Runtime type information
TypeName("flameControllingVelocity");
// Constructors
//- Construct from patch and internal field
flameControllingVelocityFvPatchVectorField
(
const fvPatch&,
const DimensionedField<vector, volMesh>&
);
//- Construct from patch, internal field and dictionary
flameControllingVelocityFvPatchVectorField
(
const fvPatch&,
const DimensionedField<vector, volMesh>&,
const dictionary&
);
//- Construct by mapping given
// flameControllingVelocityFvPatchVectorField
// onto a new patch
flameControllingVelocityFvPatchVectorField
(
const flameControllingVelocityFvPatchVectorField&,
const fvPatch&,
const DimensionedField<vector, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
flameControllingVelocityFvPatchVectorField
(
const flameControllingVelocityFvPatchVectorField&
);
//- Construct and return a clone
virtual tmp<fvPatchVectorField> clone() const
{
return tmp<fvPatchVectorField>
(
new flameControllingVelocityFvPatchVectorField(*this)
);
}
//- Construct as copy setting internal field reference
flameControllingVelocityFvPatchVectorField
(
const flameControllingVelocityFvPatchVectorField&,
const DimensionedField<vector, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchVectorField> clone
(
const DimensionedField<vector, volMesh>& iF
) const
{
return tmp<fvPatchVectorField>
(
new flameControllingVelocityFvPatchVectorField
(
*this,
iF
)
);
}
// Member functions
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap
(
const fvPatchFieldMapper&
);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual void rmap
(
const fvPatchVectorField&,
const labelList&
);
// Evaluation functions
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //