View Issue Details

IDProjectCategoryView StatusLast Update
0003554OpenFOAMPatchpublic2020-09-29 15:16
Reporterwyldckat Assigned Towill  
PrioritynormalSeverityminorReproducibilitysometimes
Status resolvedResolutionfixed 
Summary0003554: semiPermeableBaffleMassFraction includes a declaration of 'composition(...)' but not the definition
DescriptionIn the file 'src/specieTransfer/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.H' is declared:

        static const basicSpecieMixture& composition(const objectRegistry& db);

But it's not defined in the '.C' file what it does. It looks like there was a bit of an incomplete copy-paste from the class 'specieTransferMassFractionFvPatchScalarField' from which 'semiPermeableBaffleMassFractionFvPatchScalarField' inherits from, but this static method seems to be simple enough to not require a redefinition.

Attached is the proposed patch 'proposed_fix_v1.patch' and the respective updated file, namely to remove the declaration from said file.
Additional InformationFound this when compiling on Windows with MSys2 + GCC 10.2.
TagsNo tags attached.

Activities

wyldckat

2020-09-23 10:29

updater  

proposed_fix_v1.patch (890 bytes)   
diff --git a/src/specieTransfer/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.H b/src/specieTransfer/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.H
index d1a033d..2324f5d 100644
--- a/src/specieTransfer/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.H
+++ b/src/specieTransfer/derivedFvPatchFields/semiPermeableBaffleMassFraction/semiPermeableBaffleMassFractionFvPatchScalarField.H
@@ -110,12 +110,6 @@ public:
     TypeName("semiPermeableBaffleMassFraction");
 
 
-    // Static member functions
-
-        //- Access the composition for the given database
-        static const basicSpecieMixture& composition(const objectRegistry& db);
-
-
     // Constructors
 
         //- Construct from patch and internal field
proposed_fix_v1.patch (890 bytes)   
semiPermeableBaffleMassFractionFvPatchScalarField.H (6,727 bytes)   
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Copyright (C) 2017-2019 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

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 a
    specieTransferVelocityFvPatchVectorField velocity condition, and a
    specieTransferTemperatureFvPatchScalarField  temperature condition.

    The mass flux of a species is calculated as a coefficient multiplied by the
    difference in a property across the baffle.
        \f[
            \phi_{Yi} = c A (\psi_i - \psi_{i,n})
        \f]
        where
        \vartable
            \phi_{Yi}  | Flux of the permeable specie [kg/s]
            c          | Transfer coefficient [kg/m^2/s/<property-dimensions>]
            A          | Patch face area [m^2]
            \psi_i     | Property on the patch [<property-dimensions>]
            \psi_{i,n} | Property on the neighbour patch [<property-dimensions>]
        \endvartable

    A species that the baffle is permeable to will, therefore, have a
    coefficient greater than zero, whilst a species that does not transfer will
    have a coefficient equal to zero.

Usage
    \table
        Property | Description                | Req'd? | Default
        c        | Transfer coefficient       | no     | 0
        property | Property used to drive the transfer; massFraction, \\
        moleFraction, molarConcentration, or partialPressure | if c is \\
        non-zero |
        phi      | Name of the flux field     | no     | phi
        U        | Name of the velocity field | no     | U
    \endtable

    Example of the boundary condition specification:
    \verbatim
    <patchName>
    {
        type            semiPermeableBaffleMassFraction;
        property        molarConcentration;
        c               1e-3;
        value           $internalField;
    }
    \endverbatim

See also
    Foam::specieTransferMassFractionFvPatchScalarField
    Foam::specieTransferVelocityFvPatchVectorField
    Foam::specieTransferTemperatureFvPatchScalarField

SourceFiles
    semiPermeableBaffleMassFractionFvPatchScalarField.C

\*---------------------------------------------------------------------------*/

#ifndef semiPermeableBaffleMassFractionFvPatchScalarField_H
#define semiPermeableBaffleMassFractionFvPatchScalarField_H

#include "mappedPatchBase.H"
#include "specieTransferMassFractionFvPatchScalarField.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

class basicSpecieMixture;

/*---------------------------------------------------------------------------*\
      Class semiPermeableBaffleMassFractionFvPatchScalarField Declaration
\*---------------------------------------------------------------------------*/

class semiPermeableBaffleMassFractionFvPatchScalarField
:
    public mappedPatchBase,
    public specieTransferMassFractionFvPatchScalarField
{
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&
        );

        //- Copy constructor
        semiPermeableBaffleMassFractionFvPatchScalarField
        (
            const semiPermeableBaffleMassFractionFvPatchScalarField&
        );

        //- Construct and return a clone
        virtual tmp<fvPatchScalarField> clone() const
        {
            return tmp<fvPatchScalarField>
            (
                new semiPermeableBaffleMassFractionFvPatchScalarField(*this)
            );
        }

        //- Copy constructor 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
            virtual tmp<scalarField> calcPhiYp() const;


        //- Write
        virtual void write(Ostream&) const;
};


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


#endif

// ************************************************************************* //

wyldckat

2020-09-23 10:29

updater   ~0011521

I forgot to mention that this is applicable to OpenFOAM 8 and dev.

will

2020-09-29 15:16

manager   ~0011551

Thanks for the report. Fixed in 8 and dev.

https://github.com/OpenFOAM/OpenFOAM-8/commit/a3389546b5b598cf4065b0729b2b4df8b12eeecd
https://github.com/OpenFOAM/OpenFOAM-dev/commit/b0d91b53a70ef8a3450abbfe6a6ad53073ed4815

Issue History

Date Modified Username Field Change
2020-09-23 10:29 wyldckat New Issue
2020-09-23 10:29 wyldckat Status new => assigned
2020-09-23 10:29 wyldckat Assigned To => henry
2020-09-23 10:29 wyldckat File Added: proposed_fix_v1.patch
2020-09-23 10:29 wyldckat File Added: semiPermeableBaffleMassFractionFvPatchScalarField.H
2020-09-23 10:29 wyldckat Note Added: 0011521
2020-09-29 15:16 will Assigned To henry => will
2020-09-29 15:16 will Status assigned => resolved
2020-09-29 15:16 will Resolution open => fixed
2020-09-29 15:16 will Fixed in Version => 8
2020-09-29 15:16 will Note Added: 0011551