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

Error while compiling a solidParticle library based on interFoam in OF5x

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 30, 2022, 05:05
Smile Error while compiling a solidParticle library based on interFoam in OF5x
  #1
New Member
 
Feng
Join Date: Apr 2017
Posts: 9
Rep Power: 9
wind_ is on a distinguished road
In order to simulate the movement of bubbles in fluids, I am trying to couple the solidParticle library based on the interFoam. Follow the steps of this tutorial,http://www.tfd.chalmers.se/~hani/kur...Ghahramani.pdf and compile successfully in OF3.0.0.
But when I compile the same code in the new version OF5.x, I get the following compilation error,
Code:
solidParticleCloudI.H:77:79: error: no match for ‘operator=’ (operand types are ‘const Internal {aka const Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh>}’ and ‘Foam::tmp<Foam::Field<Foam::Vector<double> > >’)
   tsource().internalField() = -smom_/(mesh_.time().deltaT().value()*mesh_.V());
                                                                              ^
In file included from /home/fxr/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/DimensionedField.H:366:0,
                 from /home/fxr/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude/fvMesh.H:58,
                 from /home/fxr/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude/fvCFD.H:7,
                 from interFoam.C:40:
/home/fxr/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/DimensionedField.C:424:6: note: candidate: void Foam::DimensionedField<Type, GeoMesh>::operator=(const Foam::DimensionedField<Type, GeoMesh>&) [with Type = Foam::Vector<double>; GeoMesh = Foam::volMesh]
 void DimensionedField<Type, GeoMesh>::operator=
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fxr/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/DimensionedField.C:424:6: note:   no known conversion for argument 1 from ‘Foam::tmp<Foam::Field<Foam::Vector<double> > >’ to ‘const Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh>&’
/home/fxr/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/DimensionedField.C:445:6: note: candidate: void Foam::DimensionedField<Type, GeoMesh>::operator=(const Foam::tmp<Foam::DimensionedField<Type, GeoMesh> >&) [with Type = Foam::Vector<double>; GeoMesh = Foam::volMesh]
 void DimensionedField<Type, GeoMesh>::operator=
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fxr/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/DimensionedField.C:445:6: note:   no known conversion for argument 1 from ‘Foam::tmp<Foam::Field<Foam::Vector<double> > >’ to ‘const Foam::tmp<Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> >&’
/home/fxr/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/DimensionedField.C:469:6: note: candidate: void Foam::DimensionedField<Type, GeoMesh>::operator=(const Foam::dimensioned<Type>&) [with Type = Foam::Vector<double>; GeoMesh = Foam::volMesh]
 void DimensionedField<Type, GeoMesh>::operator=
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fxr/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/DimensionedField.C:469:6: note:   no known conversion for argument 1 from ‘Foam::tmp<Foam::Field<Foam::Vector<double> > >’ to ‘const Foam::dimensioned<Foam::Vector<double> >&’
In file included from solidParticleCloud.H:153:0,
                 from interFoam.C:47:
solidParticleCloudI.H: In member function ‘Foam::tmp<Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> > Foam::solidParticleCloud::AddToU() const’:
solidParticleCloudI.H:146:31: error: no match for ‘operator=’ (operand types are ‘const Internal {aka const Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh>}’ and ‘const vectorField {aka const Foam::Field<Foam::Vector<double> >}’)
   Usource().internalField() = correctU_;
                               ^~~~~~~~~
In file included from /home/fxr/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/DimensionedField.H:366:0,
                 from /home/fxr/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude/fvMesh.H:58,
                 from /home/fxr/OpenFOAM/OpenFOAM-5.x/src/finiteVolume/lnInclude/fvCFD.H:7,
                 from interFoam.C:40:
/home/fxr/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/DimensionedField.C:424:6: note: candidate: void Foam::DimensionedField<Type, GeoMesh>::operator=(const Foam::DimensionedField<Type, GeoMesh>&) [with Type = Foam::Vector<double>; GeoMesh = Foam::volMesh]
 void DimensionedField<Type, GeoMesh>::operator=
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fxr/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/DimensionedField.C:424:6: note:   no known conversion for argument 1 from ‘const vectorField {aka const Foam::Field<Foam::Vector<double> >}’ to ‘const Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh>&’
/home/fxr/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/DimensionedField.C:445:6: note: candidate: void Foam::DimensionedField<Type, GeoMesh>::operator=(const Foam::tmp<Foam::DimensionedField<Type, GeoMesh> >&) [with Type = Foam::Vector<double>; GeoMesh = Foam::volMesh]
 void DimensionedField<Type, GeoMesh>::operator=
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fxr/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/DimensionedField.C:445:6: note:   no known conversion for argument 1 from ‘const vectorField {aka const Foam::Field<Foam::Vector<double> >}’ to ‘const Foam::tmp<Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh> >&’
/home/fxr/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/DimensionedField.C:469:6: note: candidate: void Foam::DimensionedField<Type, GeoMesh>::operator=(const Foam::dimensioned<Type>&) [with Type = Foam::Vector<double>; GeoMesh = Foam::volMesh]
 void DimensionedField<Type, GeoMesh>::operator=
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/fxr/OpenFOAM/OpenFOAM-5.x/src/OpenFOAM/lnInclude/DimensionedField.C:469:6: note:   no known conversion for argument 1 from ‘const vectorField {aka const Foam::Field<Foam::Vector<double> >}’ to ‘const Foam::dimensioned<Foam::Vector<double> >&’
/home/fxr/OpenFOAM/OpenFOAM-5.x/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt64Opt/interFoam.o' failed
make: *** [Make/linux64GccDPInt64Opt/interFoam.o] Error 1
And the part of source code solidParticleCloudI.H:
Code:
// 2Way Coupling- Momentum Source:
inline tmp<volVectorField> solidParticleCloud::momentumSource() const
{
	tmp<volVectorField> tsource
	(
	    new volVectorField
	    (
	       IOobject
	       (
	          "smom",
	          mesh_.time().timeName(),
	          mesh_,
	          IOobject::NO_READ,
	          IOobject::NO_WRITE
	       ),
	       mesh_,
	       dimensionedVector
	          (
	             "zero",
	             dimensionSet(1, -2, -2, 0, 0),
	             vector::zero
	          )
	    )
   );
   tsource().internalField() = -smom_/(mesh_.time().deltaT().value()*mesh_.V());

 //tsource().primitiveFieldRef() = -smom_/(mesh_.time().deltaT().value()*mesh_.V());

   return tsource;
}
Anyone can help me?
Thanks in advance
wind_ is offline   Reply With Quote

Reply

Tags
bubble cavitation, lagrangian bubble, openfoam5.x, solidparticle


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
New solver based in interFoam claudiocor OpenFOAM Programming & Development 7 December 31, 2020 22:05
simpleFoam with gravity, based on interFoam JonW OpenFOAM 1 May 9, 2019 11:08
Weird Problem while compiling new library ashish.vinayak OpenFOAM Programming & Development 3 March 15, 2019 11:39
dynamic mesh case based of an interFoam case maxonline OpenFOAM Running, Solving & CFD 3 February 21, 2016 15:13
k-e & GAMG interFoam Schemitisation Stability Issue JFM OpenFOAM Running, Solving & CFD 3 December 1, 2015 06:58


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