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

Porting viscoelasticFluidFoam to Official OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 1, 2019, 17:30
Default Porting viscoelasticFluidFoam to Official OpenFOAM
  #1
Member
 
Join Date: Jun 2016
Posts: 99
Rep Power: 9
xuegy is on a distinguished road
Hello everyone,

I'm trying to move viscoelasticFluidFoam and its libraries from foam-extend-4.1 and compile it in official v1812. Foam-extend now has tons of compatibility issues and I need to use the official version for my second stage simulation so I have to port it.
After fixing so many syntax issues, I'm trapped by a weird error:
In /src/viscoelastic/viscoelasticLaws/multiMode/multiMode.C
Code:
Foam::multiMode::divTau(volVectorField& U) const
{
    tmp<fvVectorMatrix> divMatrix = models_[0].divTau(U);

    for (label i = 1; i < models_.size(); i++)
    {
        divMatrix() += models_[i].divTau(U);
    }

    return divMatrix;
}
The compiler gives the following error:
Code:
viscoelasticLaws/multiMode/multiMode.C: In member function ‘virtual Foam::tmp<Foam::fvMatrix<Foam::Vector<double> > > Foam::multiMode::divTau(Foam::volVectorField&) const’:
viscoelasticLaws/multiMode/multiMode.C:98:43: error: passing ‘const Foam::fvMatrix<Foam::Vector<double> >’ as ‘this’ argument discards qualifiers [-fpermissive]
         divMatrix() += models_[i].divTau(U);
I googled, and people say that the solution is adding a 'const' to the function. However, there's already a 'const'. I'm totally lost. How to fix this issue?

Thanks!
xuegy is offline   Reply With Quote

Old   March 2, 2019, 01:52
Default
  #2
Member
 
Join Date: Jun 2016
Posts: 99
Rep Power: 9
xuegy is on a distinguished road
I have successfully compiled the solver by removing multiMode model. However, I still want to fix this issue and maybe upload the revised compatible solver to GitHub.
xuegy is offline   Reply With Quote

Old   May 26, 2022, 03:29
Default
  #3
New Member
 
Xiaobo YAO
Join Date: Oct 2020
Posts: 9
Rep Power: 5
hdotyao is on a distinguished road
hi,
I am also compiling viscoelasticFluidFoam to official OpenFOAM. And I am facing the same issue. I need this multiMode so I don't want to delete it. Have you solved it?


Best
hdotyao is offline   Reply With Quote

Reply


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
OpenFOAM course for beginners Jibran OpenFOAM Announcements from Other Sources 2 November 4, 2019 08:51
OpenFOAM v3.0+ ?? SBusch OpenFOAM 22 December 26, 2016 14:24
openfoam official repository for unsupported code sail OpenFOAM 8 December 19, 2012 08:28
The OpenFOAM extensions project mbeaudoin OpenFOAM 16 October 9, 2007 09:33
OpenFOAM Debian packaging current status problems and TODOs oseen OpenFOAM Installation 9 August 26, 2007 13:50


All times are GMT -4. The time now is 20:03.