ENH: semiPermeableBaffle: Added two new boundary conditions and a tutorial

Two boundary conditions for the modelling of semi-permeable baffles have
been added. These baffles are permeable to a number of species within
the flow, and are impermeable to others. The flux of a given species is
calculated as a constant multipled by the drop in mass fraction across
the baffle.

The species mass-fraction condition requires the transfer constant and
the name of the patch on the other side of the baffle:

boundaryField
{
    // ...

    membraneA
    {
        type            semiPermeableBaffleMassFraction;
        samplePatch     membranePipe;
        c               0.1;
        value           uniform 0;
    }
    membraneB
    {
        type            semiPermeableBaffleMassFraction;
        samplePatch     membraneSleeve;
        c               0.1;
        value           uniform 1;
    }
}

If the value of c is omitted, or set to zero, then the patch is
considered impermeable to the species in question. The samplePatch entry
can also be omitted in this case.

The velocity condition does not require any special input:

boundaryField
{
    // ...

    membraneA
    {
        type            semiPermeableBaffleVelocity;
        value           uniform (0 0 0);
    }
    membraneB
    {
        type            semiPermeableBaffleVelocity;
        value           uniform (0 0 0);
    }
}

These two boundary conditions must be used in conjunction, and the
mass-fraction condition must be applied to all species in the
simulation. The calculation will fail with an error message if either is
used in isolation.

A tutorial, combustion/reactingFoam/RAS/membrane, has been added which
demonstrates this transfer process.

This work was done with support from Stefan Lipp, at BASF.
This commit is contained in:
Will Bainbridge 2017-10-19 10:00:36 +01:00 committed by Andrew Heather
parent 83026d2546
commit 79ad0f0613
38 changed files with 2197 additions and 0 deletions

View File

@ -81,6 +81,7 @@ wmake $targetType sixDoFRigidBodyMotion
wmake $targetType sixDoFRigidBodyState
wmake $targetType rigidBodyDynamics
wmake $targetType rigidBodyMeshMotion
wmake $targetType semiPermeableBaffle
# Needs access to Turbulence

View File

@ -0,0 +1,4 @@
derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.C
derivedFvPatchFields/semiPermeableBaffleVelocity/semiPermeableBaffleVelocityFvPatchVectorField.C
LIB = $(FOAM_LIBBIN)/libsemiPermeableBaffle

View File

@ -0,0 +1,17 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude
LIB_LIBS = \
-lfiniteVolume \
-lmeshTools \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \
-lreactionThermophysicalModels \
-lturbulenceModels

View File

@ -0,0 +1,190 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 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 "semiPermeableBaffleMassFractionFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "turbulenceModel.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::semiPermeableBaffleMassFractionFvPatchScalarField::
semiPermeableBaffleMassFractionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF
)
:
mappedPatchBase(p.patch()),
mixedFvPatchScalarField(p, iF),
c_(0),
phiName_("phi")
{
refValue() = Zero;
refGrad() = Zero;
valueFraction() = Zero;
}
Foam::semiPermeableBaffleMassFractionFvPatchScalarField::
semiPermeableBaffleMassFractionFvPatchScalarField
(
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const dictionary& dict
)
:
mappedPatchBase(p.patch(), NEARESTPATCHFACE, dict),
mixedFvPatchScalarField(p, iF),
c_(dict.lookupOrDefault<scalar>("c", scalar(0))),
phiName_(dict.lookupOrDefault<word>("phi", "phi"))
{
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
refValue() = Zero;
refGrad() = Zero;
valueFraction() = Zero;
}
Foam::semiPermeableBaffleMassFractionFvPatchScalarField::
semiPermeableBaffleMassFractionFvPatchScalarField
(
const semiPermeableBaffleMassFractionFvPatchScalarField& ptf,
const fvPatch& p,
const DimensionedField<scalar, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
mappedPatchBase(p.patch(), ptf),
mixedFvPatchScalarField(ptf, p, iF, mapper),
c_(ptf.c_),
phiName_(ptf.phiName_)
{}
Foam::semiPermeableBaffleMassFractionFvPatchScalarField::
semiPermeableBaffleMassFractionFvPatchScalarField
(
const semiPermeableBaffleMassFractionFvPatchScalarField& ptf
)
:
mappedPatchBase(ptf.patch().patch(), ptf),
mixedFvPatchScalarField(ptf),
c_(ptf.c_),
phiName_(ptf.phiName_)
{}
Foam::semiPermeableBaffleMassFractionFvPatchScalarField::
semiPermeableBaffleMassFractionFvPatchScalarField
(
const semiPermeableBaffleMassFractionFvPatchScalarField& ptf,
const DimensionedField<scalar, volMesh>& iF
)
:
mappedPatchBase(ptf.patch().patch(), ptf),
mixedFvPatchScalarField(ptf, iF),
c_(ptf.c_),
phiName_(ptf.phiName_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::scalarField>
Foam::semiPermeableBaffleMassFractionFvPatchScalarField::phiY() const
{
if (c_ == scalar(0))
{
return tmp<scalarField>(new scalarField(patch().size(), Zero));
}
const word& YName = internalField().name();
const label nbrPatchi = samplePolyPatch().index();
const fvPatch& nbrPatch = patch().boundaryMesh()[nbrPatchi];
const fvPatchScalarField& nbrYp =
nbrPatch.lookupPatchField<volScalarField, scalar>(YName);
scalarField nbrYc(nbrYp.patchInternalField());
mappedPatchBase::map().distribute(nbrYc);
return c_*patch().magSf()*(patchInternalField() - nbrYc);
}
void Foam::semiPermeableBaffleMassFractionFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
const scalarField& phip =
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
const turbulenceModel& turbModel =
db().lookupObject<turbulenceModel>
(
turbulenceModel::propertiesName
);
const scalarField muEffp(turbModel.muEff(patch().index()));
const scalarField AMuEffp(patch().magSf()*muEffp);
valueFraction() = phip/(phip - patch().deltaCoeffs()*AMuEffp);
refGrad() = - phiY()/AMuEffp;
mixedFvPatchScalarField::updateCoeffs();
}
void Foam::semiPermeableBaffleMassFractionFvPatchScalarField::write
(
Ostream& os
) const
{
fvPatchScalarField::write(os);
mappedPatchBase::write(os);
writeEntryIfDifferent<scalar>(os, "c", scalar(0), c_);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
writeEntry("value", os);
}
// * * * * * * * * * * * * * * Build Macro Function * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchScalarField,
semiPermeableBaffleMassFractionFvPatchScalarField
);
}
// ************************************************************************* //

View File

@ -0,0 +1,202 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 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::semiPermeableBaffleMassFractionFvPatchScalarField
Group
grpGenericBoundaryConditions
Description
This is a mass-fraction boundary condition for a semi-permeable baffle.
This condition models a baffle which is permeable to a some species and
impermeable to others. It must be used in conjunction with the
corresponding velocity condition,
semiPermeableBaffleVelocityFvPatchVectorField.
The mass flux of a species is calculated as a coefficient multiplied by the
difference in mass fraction across the baffle.
\f[
\phi_{Yi} = c A (Y_i - Y_{i,n})
\f]
where
\vartable
\phi_{Yi} | flux of the permeable species [kg/s]
c | transfer coefficient [kg/m2/s]
A | patch face area [m2]
Y_i | mass fraction on the patch []
Y_{i,n} | mass fraction on the neighbour patch []
\endvartable
A species that the baffle is permable to will, therefore, have a
coefficient greater than zero, whilst a species that does not transfer will
have a coefficient equal to zero.
This condition calculates the species flux. The fluxes are summed up by the
velocity consition to generate the net mass transfer across the baffle.
This mass-fraction condition then generates a corrective diffusive flux to
ensure that the correct amounts of the permeable species are transferred.
Usage
\table
Property | Description | Req'd? | Default
c | Transfer coefficient | no | 0
phi | Name of the flux field | no | phi
\endtable
See also
Foam::semiPermeableBaffleVelocityFvPatchVectorField
SourceFiles
semiPermeableBaffleMassFractionFvPatchScalarField.C
\*---------------------------------------------------------------------------*/
#ifndef semiPermeableBaffleMassFractionFvPatchScalarField_H
#define semiPermeableBaffleMassFractionFvPatchScalarField_H
#include "mappedPatchBase.H"
#include "mixedFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class semiPermeableBaffleMassFractionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/
class semiPermeableBaffleMassFractionFvPatchScalarField
:
public mappedPatchBase,
public mixedFvPatchScalarField
{
// Private data
//- Transfer coefficient
const scalar c_;
//- Name of the flux field
const word phiName_;
public:
//- Runtime type information
TypeName("semiPermeableBaffleMassFraction");
// Constructors
//- Construct from patch and internal field
semiPermeableBaffleMassFractionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&
);
//- Construct from patch, internal field and dictionary
semiPermeableBaffleMassFractionFvPatchScalarField
(
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const dictionary&
);
//- Construct by mapping given fixedValueTypeFvPatchField
// onto a new patch
semiPermeableBaffleMassFractionFvPatchScalarField
(
const semiPermeableBaffleMassFractionFvPatchScalarField&,
const fvPatch&,
const DimensionedField<scalar, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
semiPermeableBaffleMassFractionFvPatchScalarField
(
const semiPermeableBaffleMassFractionFvPatchScalarField&
);
//- Construct and return a clone
virtual tmp<fvPatchScalarField> clone() const
{
return tmp<fvPatchScalarField>
(
new semiPermeableBaffleMassFractionFvPatchScalarField(*this)
);
}
//- Construct as copy setting internal field reference
semiPermeableBaffleMassFractionFvPatchScalarField
(
const semiPermeableBaffleMassFractionFvPatchScalarField&,
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 semiPermeableBaffleMassFractionFvPatchScalarField
(
*this,
iF
)
);
}
// Member functions
// Evaluation functions
//- Return the flux of this species through the baffle
tmp<scalarField> phiY() const;
//- Update the coefficients associated with the patch field
virtual void updateCoeffs();
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,187 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 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 "semiPermeableBaffleVelocityFvPatchVectorField.H"
#include "semiPermeableBaffleMassFractionFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H"
#include "fvPatchFieldMapper.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "psiReactionThermo.H"
#include "rhoReactionThermo.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
const Foam::basicSpecieMixture&
Foam::semiPermeableBaffleVelocityFvPatchVectorField::composition() const
{
const word& name = basicThermo::dictName;
if (db().foundObject<psiReactionThermo>(name))
{
return db().lookupObject<psiReactionThermo>(name).composition();
}
else if (db().foundObject<rhoReactionThermo>(name))
{
return db().lookupObject<rhoReactionThermo>(name).composition();
}
else
{
FatalErrorInFunction
<< "Could not find a multi-component thermodynamic model."
<< exit(FatalError);
return NullObjectRef<basicSpecieMixture>();
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::semiPermeableBaffleVelocityFvPatchVectorField::
semiPermeableBaffleVelocityFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF
)
:
fixedValueFvPatchVectorField(p, iF),
rhoName_("rho")
{}
Foam::semiPermeableBaffleVelocityFvPatchVectorField::
semiPermeableBaffleVelocityFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF),
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
{
fvPatchVectorField::operator==(vectorField("value", dict, p.size()));
}
Foam::semiPermeableBaffleVelocityFvPatchVectorField::
semiPermeableBaffleVelocityFvPatchVectorField
(
const semiPermeableBaffleVelocityFvPatchVectorField& ptf,
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchVectorField(ptf, p, iF, mapper),
rhoName_(ptf.rhoName_)
{}
Foam::semiPermeableBaffleVelocityFvPatchVectorField::
semiPermeableBaffleVelocityFvPatchVectorField
(
const semiPermeableBaffleVelocityFvPatchVectorField& ptf
)
:
fixedValueFvPatchVectorField(ptf),
rhoName_(ptf.rhoName_)
{}
Foam::semiPermeableBaffleVelocityFvPatchVectorField::
semiPermeableBaffleVelocityFvPatchVectorField
(
const semiPermeableBaffleVelocityFvPatchVectorField& ptf,
const DimensionedField<vector, volMesh>& iF
)
:
fixedValueFvPatchVectorField(ptf, iF),
rhoName_(ptf.rhoName_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::semiPermeableBaffleVelocityFvPatchVectorField::updateCoeffs()
{
if (updated())
{
return;
}
typedef semiPermeableBaffleMassFractionFvPatchScalarField YBCType;
const scalarField& rhop =
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
const PtrList<volScalarField>& Y = composition().Y();
scalarField phip(patch().size(), Zero);
forAll(Y, i)
{
const fvPatchScalarField& Yp = Y[i].boundaryField()[patch().index()];
if (!isA<YBCType>(Yp))
{
FatalErrorInFunction
<< "The mass-fraction condition on patch " << patch().name()
<< " is not of type " << YBCType::typeName << "."
<< exit(FatalError);
}
phip += refCast<const YBCType>(Yp).phiY();
}
this->operator==(patch().nf()*phip/(rhop*patch().magSf()));
fixedValueFvPatchVectorField::updateCoeffs();
}
void Foam::semiPermeableBaffleVelocityFvPatchVectorField::write
(
Ostream& os
) const
{
fvPatchVectorField::write(os);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
writeEntry("value", os);
}
// * * * * * * * * * * * * * * Build Macro Function * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchVectorField,
semiPermeableBaffleVelocityFvPatchVectorField
);
}
// ************************************************************************* //

View File

@ -0,0 +1,182 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 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::semiPermeableBaffleVelocityFvPatchVectorField
Group
grpGenericBoundaryConditions
Description
This is a velocity boundary condition for a semi-permeable baffle.
This is a velocity boundary condition for baffles which are permeable to a
some species and impermeable to others. It must be used in conjunction
with the corresponding mass-fraction condition,
semiPermeableBaffleMassFractionFvPatchScalarField.
This condition sums the species fluxes generated by the the mass-fraction
conditions, and uses this total to set the velocity.
Usage
\table
Property | Description | Req'd? | Default
rho | Name of the density field | no | rho
\endtable
See also
Foam::semiPermeableBaffleMassFractionFvPatchScalarField
SourceFiles
semiPermeableBaffleVelocityFvPatchVectorField.C
\*---------------------------------------------------------------------------*/
#ifndef semiPermeableBaffleVelocityFvPatchVectorField_H
#define semiPermeableBaffleVelocityFvPatchVectorField_H
#include "mappedPatchBase.H"
#include "fixedValueFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
class basicSpecieMixture;
/*---------------------------------------------------------------------------*\
Class semiPermeableBaffleVelocityFvPatchVectorField Declaration
\*---------------------------------------------------------------------------*/
class semiPermeableBaffleVelocityFvPatchVectorField
:
public fixedValueFvPatchVectorField
{
// Private data
//- Name of the density field
const word rhoName_;
// Private Member Functions
//- Return the composition
const basicSpecieMixture& composition() const;
public:
//- Runtime type information
TypeName("semiPermeableBaffleVelocity");
// Constructors
//- Construct from patch and internal field
semiPermeableBaffleVelocityFvPatchVectorField
(
const fvPatch&,
const DimensionedField<vector, volMesh>&
);
//- Construct from patch, internal field and dictionary
semiPermeableBaffleVelocityFvPatchVectorField
(
const fvPatch&,
const DimensionedField<vector, volMesh>&,
const dictionary&
);
//- Construct by mapping given fixedValueTypeFvPatchField
// onto a new patch
semiPermeableBaffleVelocityFvPatchVectorField
(
const semiPermeableBaffleVelocityFvPatchVectorField&,
const fvPatch&,
const DimensionedField<vector, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
semiPermeableBaffleVelocityFvPatchVectorField
(
const semiPermeableBaffleVelocityFvPatchVectorField&
);
//- Construct and return a clone
virtual tmp<fvPatchVectorField> clone() const
{
return tmp<fvPatchVectorField>
(
new semiPermeableBaffleVelocityFvPatchVectorField(*this)
);
}
//- Construct as copy setting internal field reference
semiPermeableBaffleVelocityFvPatchVectorField
(
const semiPermeableBaffleVelocityFvPatchVectorField&,
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 semiPermeableBaffleVelocityFvPatchVectorField
(
*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
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,69 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object CH4;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include"
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
inletSleeve
{
type fixedValue;
value uniform $:sleeve.CH4;
}
inletPipe
{
type fixedValue;
value uniform $:pipe.CH4;
}
outletSleeve
{
type inletOutlet;
inletValue uniform $:sleeve.CH4;
value uniform $:sleeve.CH4;
}
outletPipe
{
type inletOutlet;
inletValue uniform $:pipe.CH4;
value uniform $:pipe.CH4;
}
wall
{
type zeroGradient;
}
membraneSleeve
{
type semiPermeableBaffleMassFraction;
samplePatch membranePipe;
c 0.1;
value uniform $:sleeve.CH4;
}
membranePipe
{
type semiPermeableBaffleMassFraction;
samplePatch membraneSleeve;
c 0.1;
value uniform $:pipe.CH4;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,65 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object N2;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include"
dimensions [0 0 0 0 0 0 0];
internalField uniform 1;
boundaryField
{
inletSleeve
{
type fixedValue;
value uniform $:sleeve.N2;
}
inletPipe
{
type fixedValue;
value uniform $:pipe.N2;
}
outletSleeve
{
type inletOutlet;
inletValue uniform $:sleeve.N2;
value uniform $:sleeve.N2;
}
outletPipe
{
type inletOutlet;
inletValue uniform $:pipe.N2;
value uniform $:pipe.N2;
}
wall
{
type zeroGradient;
}
membraneSleeve
{
type semiPermeableBaffleMassFraction;
value uniform $:sleeve.N2;
}
membranePipe
{
type semiPermeableBaffleMassFraction;
value uniform $:pipe.N2;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,65 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object O2;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "include"
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
inletSleeve
{
type fixedValue;
value uniform $:sleeve.O2;
}
inletPipe
{
type fixedValue;
value uniform $:pipe.O2;
}
outletSleeve
{
type inletOutlet;
inletValue uniform $:sleeve.O2;
value uniform $:sleeve.O2;
}
outletPipe
{
type inletOutlet;
inletValue uniform $:pipe.O2;
value uniform $:pipe.O2;
}
wall
{
type zeroGradient;
}
membraneSleeve
{
type semiPermeableBaffleMassFraction;
value uniform $:sleeve.O2;
}
membranePipe
{
type semiPermeableBaffleMassFraction;
value uniform $:pipe.O2;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 1 0 0 0];
internalField uniform 293;
boundaryField
{
inlet
{
type fixedValue;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
"(wall|membrane).*"
{
type zeroGradient;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,56 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (0 0 0);
boundaryField
{
inletSleeve
{
type fixedValue;
value uniform (1 0 0);
}
inletPipe
{
type fixedValue;
value uniform (0 0 1);
}
outlet
{
type pressureInletOutletVelocity;
value $internalField;
}
wall
{
type noSlip;
}
membraneSleeve
{
type semiPermeableBaffleVelocity;
value $internalField;
}
membranePipe
{
type semiPermeableBaffleVelocity;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,52 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object Ydefault;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 0 0 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type fixedValue;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
wall
{
type zeroGradient;
}
membraneSleeve
{
type semiPermeableBaffleMassFraction;
value $internalField;
}
membranePipe
{
type semiPermeableBaffleMassFraction;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type fixedValue;
value $internalField;
}
outlet
{
type zeroGradient;
}
"(wall|membrane).*"
{
type compressible::alphatWallFunction;
Prt 0.85;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -3 0 0 0 0];
internalField uniform 0.012;
boundaryField
{
inlet
{
type turbulentMixingLengthDissipationRateInlet;
mixingLength 0.1;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
"(wall|membrane).*"
{
type epsilonWallFunction;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,33 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "0";
object include;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
sleeve
{
CH4 0;
N2 0.79;
O2 0.21;
}
pipe
{
CH4 0.5;
O2 0;
N2 0.5;
}
// ************************************************************************* //

View File

@ -0,0 +1,44 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0.00375;
boundaryField
{
inlet
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.05;
value $internalField;
}
outlet
{
type inletOutlet;
inletValue $internalField;
value $internalField;
}
"(wall|membrane).*"
{
type kqRWallFunction;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField uniform 0;
boundaryField
{
inlet
{
type calculated;
value $internalField;
}
outlet
{
type calculated;
value $internalField;
}
"(wall|membrane).*"
{
type nutkWallFunction;
value $internalField;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,40 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField uniform 1e5;
boundaryField
{
inlet
{
type fixedFluxPressure;
}
outlet
{
type totalPressure;
p0 $internalField;
}
"(wall|membrane).*"
{
type fixedFluxPressure;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,7 @@
#!/bin/sh
cd ${0%/*} || exit 1
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
rm -rf 0 constant/triSurface/membrane-*.stl.gz && cleanCase

View File

@ -0,0 +1,20 @@
#!/bin/sh
cd ${0%/*} || exit 1 cd ${0%/*} || exit 1
. $WM_PROJECT_DIR/bin/tools/RunFunctions
cp \
$FOAM_TUTORIALS/resources/geometry/membrane-boundaries.stl.gz \
$FOAM_TUTORIALS/resources/geometry/membrane-membrane.stl.gz \
constant/triSurface
runApplication blockMesh
runApplication snappyHexMesh -overwrite
runApplication createBaffles -overwrite
cp -r 0.orig 0
runApplication setFields
runApplication reactingFoam

View File

@ -0,0 +1,35 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object chemistryProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
chemistryType
{
chemistrySolver EulerImplicit;
chemistryThermo psi;
}
chemistry off;
initialChemicalTimeStep 1e-07;
EulerImplicitCoeffs
{
cTauChem 1;
equilibriumRateLimiter off;
}
// ************************************************************************* //

View File

@ -0,0 +1,21 @@
/*-----------------m---------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object combustionProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
combustionModel noCombustion<psiThermoCombustion>;
// ************************************************************************* //

View File

@ -0,0 +1,40 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class IOobject;
location "constant";
object reactions;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
species
(
O2
H2O
CH4
CO2
N2
);
reactions
{
methaneReaction
{
type irreversibleArrheniusReaction;
reaction "CH4 + 2O2 = CO2 + 2H2O";
A 5.2e16;
beta 0;
Ta 14906;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,124 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermo.compressibleGas;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
O2
{
specie
{
molWeight 31.9988;
}
thermodynamics
{
Tlow 200;
Thigh 5000;
Tcommon 1000;
highCpCoeffs ( 3.69758 0.00061352 -1.25884e-07 1.77528e-11 -1.13644e-15 -1233.93 3.18917 );
lowCpCoeffs ( 3.21294 0.00112749 -5.75615e-07 1.31388e-09 -8.76855e-13 -1005.25 6.03474 );
}
transport
{
As 1.67212e-06;
Ts 170.672;
}
}
H2O
{
specie
{
molWeight 18.0153;
}
thermodynamics
{
Tlow 200;
Thigh 5000;
Tcommon 1000;
highCpCoeffs ( 2.67215 0.00305629 -8.73026e-07 1.201e-10 -6.39162e-15 -29899.2 6.86282 );
lowCpCoeffs ( 3.38684 0.00347498 -6.3547e-06 6.96858e-09 -2.50659e-12 -30208.1 2.59023 );
}
transport
{
As 1.67212e-06;
Ts 170.672;
}
}
CH4
{
specie
{
molWeight 16.0428;
}
thermodynamics
{
Tlow 200;
Thigh 6000;
Tcommon 1000;
highCpCoeffs ( 1.63543 0.0100844 -3.36924e-06 5.34973e-10 -3.15528e-14 -10005.6 9.9937 );
lowCpCoeffs ( 5.14988 -0.013671 4.91801e-05 -4.84744e-08 1.66694e-11 -10246.6 -4.64132 );
}
transport
{
As 1.67212e-06;
Ts 170.672;
}
}
CO2
{
specie
{
molWeight 44.01;
}
thermodynamics
{
Tlow 200;
Thigh 5000;
Tcommon 1000;
highCpCoeffs ( 4.45362 0.00314017 -1.27841e-06 2.394e-10 -1.66903e-14 -48967 -0.955396 );
lowCpCoeffs ( 2.27572 0.00992207 -1.04091e-05 6.86669e-09 -2.11728e-12 -48373.1 10.1885 );
}
transport
{
As 1.67212e-06;
Ts 170.672;
}
}
N2
{
specie
{
molWeight 28.0134;
}
thermodynamics
{
Tlow 200;
Thigh 5000;
Tcommon 1000;
highCpCoeffs ( 2.92664 0.00148798 -5.68476e-07 1.0097e-10 -6.75335e-15 -922.798 5.98053 );
lowCpCoeffs ( 3.29868 0.00140824 -3.96322e-06 5.64152e-09 -2.44486e-12 -1020.9 3.95037 );
}
transport
{
As 1.67212e-06;
Ts 170.672;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,38 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object thermophysicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
thermoType
{
type hePsiThermo;
mixture reactingMixture;
transport sutherland;
thermo janaf;
energy sensibleEnthalpy;
equationOfState perfectGas;
specie specie;
}
inertSpecie N2;
chemistryReader foamChemistryReader;
foamChemistryFile "$FOAM_CASE/constant/reactions";
foamChemistryThermoFile "$FOAM_CASE/constant/thermo.compressibleGas";
// ************************************************************************* //

View File

@ -0,0 +1,4 @@
Directory to house tri-surfaces
The Allrun script copies the surface from the $FOAM_TUTORIALS/resources/geometry
directory

View File

@ -0,0 +1,28 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object turbulenceProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
simulationType RAS;
RAS
{
RASModel kEpsilon;
turbulence on;
printCoeffs on;
}
// ************************************************************************* //

View File

@ -0,0 +1,49 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
convertToMeters 1;
vertices
(
(-2.5 -1.2 -3.0)
( 2.5 -1.2 -3.0)
(-2.5 1.2 -3.0)
( 2.5 1.2 -3.0)
(-2.5 -1.2 3.0)
( 2.5 -1.2 3.0)
(-2.5 1.2 3.0)
( 2.5 1.2 3.0)
);
blocks
(
hex (0 1 3 2 4 5 7 6) (50 24 60) simpleGrading (1 1 1)
);
edges
(
);
boundary
(
);
mergePatchPairs
(
);
// ************************************************************************* //

View File

@ -0,0 +1,55 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
application reactingFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 10;
deltaT 1e-3;
writeControl adjustableRunTime;
writeInterval 0.1;
purgeWrite 0;
writeFormat binary;
writePrecision 6;
writeCompression off;
timeFormat general;
timePrecision 6;
runTimeModifiable true;
adjustTimeStep yes;
maxCo 1;
libs ( "libsemiPermeableBaffle.so" );
// ************************************************************************* //

View File

@ -0,0 +1,43 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object createBafflesDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
internalFacesOnly true;
baffles
{
membrane
{
type faceZone;
zoneName membrane;
patches
{
master
{
name membranePipe;
type wall;
}
slave
{
name membraneSleeve;
type wall;
}
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
ddtSchemes
{
default Euler;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
div(phi,U) Gauss limitedLinearV 1;
div(phi,Yi_h) Gauss limitedLinear 1;
div(phi,K) Gauss limitedLinear 1;
div(phid,p) Gauss limitedLinear 1;
div(phi,epsilon) Gauss limitedLinear 1;
div(phi,k) Gauss limitedLinear 1;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
}
laplacianSchemes
{
default Gauss linear orthogonal;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default orthogonal;
}
// ************************************************************************* //

View File

@ -0,0 +1,69 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
solvers
{
"rho.*"
{
solver diagonal;
}
p
{
solver PCG;
preconditioner DIC;
tolerance 1e-6;
relTol 0.1;
}
pFinal
{
$p;
tolerance 1e-6;
relTol 0.0;
}
"(U|h|k|epsilon)"
{
solver PBiCGStab;
preconditioner DILU;
tolerance 1e-6;
relTol 0.1;
}
"(U|h|k|epsilon)Final"
{
$U;
relTol 0;
}
Yi
{
$hFinal;
}
}
PIMPLE
{
momentumPredictor yes;
nOuterCorrectors 1;
nCorrectors 2;
nNonOrthogonalCorrectors 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,20 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object meshQualityDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#includeEtc "caseDicts/meshQualityDict"
// ************************************************************************* //

View File

@ -0,0 +1,42 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "../0.orig/include"
defaultFieldValues
(
volScalarFieldValue CH4 $:sleeve.CH4
volScalarFieldValue N2 $:sleeve.N2
volScalarFieldValue O2 $:sleeve.O2
);
regions
(
zoneToCell
{
name pipe;
fieldValues
(
volScalarFieldValue CH4 $:pipe.CH4
volScalarFieldValue N2 $:pipe.N2
volScalarFieldValue O2 $:pipe.O2
);
}
);
// ************************************************************************* //

View File

@ -0,0 +1,168 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg"
castellatedMesh true;
snap true;
addLayers false;
geometry
{
boundaries
{
type triSurfaceMesh;
file "membrane-boundaries.stl";
regions
{
inletSleeve
{
name inletSleeve;
}
inletPipe
{
name inletPipe;
}
outletSleeve
{
name outletSleeve;
}
outletPipe
{
name outletPipe;
}
wallSleeve
{
name wallSleeve;
}
wallPipe
{
name wallPipe;
}
}
}
membrane
{
type triSurfaceMesh;
file "membrane-membrane.stl";
}
};
castellatedMeshControls
{
features ();
refinementSurfaces
{
boundaries
{
level (0 0);
regions
{
inletSleeve
{
level (0 0);
patchInfo
{
type patch;
inGroups (inlet);
}
}
inletPipe
{
level (0 0);
patchInfo
{
type patch;
inGroups (inlet);
}
}
outletSleeve
{
level (0 0);
patchInfo
{
type patch;
inGroups (outlet);
}
}
outletPipe
{
level (0 0);
patchInfo
{
type patch;
inGroups (outlet);
}
}
wallSleeve
{
level (0 0);
patchInfo
{
type wall;
inGroups (wall);
}
}
wallPipe
{
level (0 0);
patchInfo
{
type wall;
inGroups (wall);
}
}
}
}
membrane
{
level (0 0);
cellZone pipe;
faceZone membrane;
cellZoneInside insidePoint;
insidePoint (0 0 0);
}
}
refinementRegions {}
locationInMesh (0 0 0);
}
snapControls
{
implicitFeatureSnap true;
}
addLayersControls
{
relativeSizes true;
minThickness 0.25;
finalLayerThickness 0.3;
expansionRatio 1.0;
layers {}
}
meshQualityControls
{
#includeEtc "caseDicts/mesh/generation/meshQualityDict.cfg"
}
// ************************************************************************* //

Binary file not shown.