CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

MembraneFOAM RO BC warning

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 25, 2020, 12:17
Default MembraneFOAM RO BC warning
  #1
New Member
 
Join Date: Mar 2020
Posts: 2
Rep Power: 0
JF.R.Piche is on a distinguished road
Hello everyone,

I'm trying to use the reverse osmosis boundary condition from MembraneFOAM, but I'm getting a warning when compiling.

I'm using OpenFOAM v1912, and I dl the branch OF5 from MembraneFOAM git, available here, as suggested in a previous thread. I already did some changes :
- syntax of writeIfDifferent function, which I copy-pasted from another BC (something like writeIfDifferent<word>( os , ... ) became os.writeIfDifferent<word>( ... ) )
- deleted the reference to the triSurface lib (because it's not in src anymore, I'll try with a dummy case see if it's a problem)
- deleted the fm_ attribute and the calcFaceMapping() function. This is because I would like to use it as a boundary, and not a baffle.

I essentially need the RO BC, so that's where we'll stick for now (except if something else is needed).

So I want to compile the RO BC (sources files are attached), and I get a warning related to each constructor, as following :

Code:
RO_BC/explicitROmembraneSolute/explicitROmembraneSoluteFvPatchScalarField.C:136:18:  warning:  ‘Foam::dimensioned<Type>::dimensioned(Foam::Istream&) [with  Type = double]’ is deprecated: Since 2018-11 [-Wdeprecated-declarations]
     GBC_(p.size())
                  ^
In file included from /home/leo/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/dimensionedType.H:565:0,
                 from /home/leo/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/DimensionedField.H:46,
                 from /home/leo/OpenFOAM/OpenFOAM-v1912/src/finiteVolume/lnInclude/fvPatchField.H:51,
                 from RO_BC/explicitROmembraneSolute/explicitROmembraneSoluteFvPatchScalarField.H:65,
                 from RO_BC/explicitROmembraneSolute/explicitROmembraneSoluteFvPatchScalarField.C:27:
/home/leo/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/dimensionedType.C:275:1: note: declared here
 Foam::dimensioned<Type>::dimensioned(Istream& is)
 ^~~~
Here GBC is defined as
Code:
        //- gradientBoundaryCoefficients
        Field<scalar> GBC_;
and the constructor involed is :
Code:
explicitROmembraneSoluteFvPatchScalarField::explicitROmembraneSoluteFvPatchScalarField
(
    const fvPatch& p,
    const DimensionedField<scalar, volMesh>& iF,
    const dictionary& dict
)
:
    fvPatchField<scalar>(p, iF),
    transProps_
    (
        IOobject
        (
            "transportProperties",
            this->db().time().constant(),
            this->db(),
            IOobject::MUST_READ,
            IOobject::NO_WRITE,
            true
        )
    ),
    UName_(dict.lookupOrDefault<word>("U", "U")),
    R_(readScalar(dict.lookup("R"))),
    D_AB_Min_(transProps_.lookup("D_AB_Min")),
    D_AB_Coeff_(transProps_.lookup("D_AB_Coeff")),
    D_AB_mACoeff_(transProps_.lookup("D_AB_mACoeff")),
    rho0_(transProps_.lookup("rho0")),
    rho_mACoeff_(transProps_.lookup("rho_mACoeff")),
    VIC_(p.size()),
    VBC_(p.size()),
    GIC_(p.size()),
    GBC_(p.size())
{
    if (dict.found("value"))
    {
        fvPatchField<scalar>::operator=
        (
            scalarField("value", dict, p.size())
        );
    }
    else
    {
        // initialise the field to 0.0 if no information is given
        fvPatchField<scalar>::operator=(pTraits<scalar>::zero);
    }
}
From what I understood so far, that mean that the dimensionedDouble class doesn't exist anymore. But I'm never calling one on them. However, I do call dimensionedScalar, and it could be that Scalar = Double (if think I read it somewhere in my researches).

Even if it's not a critical problem (I can compile) I would be interested to correct this, and my very basic knowledge of C++ doesn't allow me to do so.

Thank you in advance for your help!

Léo
Attached Files
File Type: zip myBoundaryConditionsCFDOnline.zip (145.1 KB, 3 views)
JF.R.Piche is offline   Reply With Quote

Old   March 26, 2020, 05:23
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

If fact the warning is about these lines:

Code:
    D_AB_Min_(transProps_.lookup("D_AB_Min")),
    D_AB_Coeff_(transProps_.lookup("D_AB_Coeff")),
    D_AB_mACoeff_(transProps_.lookup("D_AB_mACoeff")),
    rho0_(transProps_.lookup("rho0")),
    rho_mACoeff_(transProps_.lookup("rho_mACoeff")),
they should become:

Code:
    D_AB_Min_("D_AB_Min", transProps_),
    ...
You can find correct constructor here: https://openfoam.com/documentation/g...mensioned.html.
JF.R.Piche and Liangyuan like this.
alexeym is offline   Reply With Quote

Old   March 26, 2020, 05:41
Smile
  #3
New Member
 
Join Date: Mar 2020
Posts: 2
Rep Power: 0
JF.R.Piche is on a distinguished road
Indeed, it works!
Thank you very much for your help!



For anyone passing by, I might commit these change to MembraneFoam in the future!


Léo
JF.R.Piche is offline   Reply With Quote

Reply

Tags
boundary condition, membrane, programming, reverse osmosis


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Caffa 3D code Waliur Rahman Main CFD Forum 0 May 29, 2018 01:53
[swak4Foam] installation problem with version 0.2.3 Claudio87 OpenFOAM Community Contributions 9 May 8, 2013 11:20
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 05:37
Compilation errors in ThirdPartymallochoard feng_w OpenFOAM Installation 1 January 25, 2009 07:59
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00


All times are GMT -4. The time now is 15:11.