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

Problem Creating Splash Interaction model

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 9, 2014, 08:45
Question Problem Creating Splash Interaction model
  #1
Member
 
bilal
Join Date: Mar 2014
Location: Germany
Posts: 30
Rep Power: 12
brbbhatti is on a distinguished road
Hello Everyone,

I am implementing the new splash submodel in Patchinteractionmodel. I am using some equations from Patchinteractionmodel and some from Thermosurfacefilmmodel.

I have created a new submodel name splash. Then add that in Patchinteractionmodel also. Then in cloud folder inside templates folder in Kinematic cloud files i add new class with name Splash-patchData. This class is called by splash model and its working but i have some error in compiling the library.

In Kinematic cloud.H file it is using a function name "cached rndGen" number. It is using this as
Quote:
//- Random number generator - used by some injection routines
cachedRandom rndGen_;
and on the same file it is using this with '&' pointer

Quote:
//- Return reference to the random object
inline cachedRandom& rndGen();
And in thermosurfacefilmmodel it is also using this rndGen. number as

Quote:
cachedRandom& rndGen()
So when i try to write some equations from thermosurfacefilmmodel in kinematic cloud.C file it give error related to some reference of random number rndGen. And also the same case happens when i use this function in splash.C file.

Error is :

Quote:
I/home/bhb8fe/OpenFOAM/bhb8fe-2.1.0/lib/OpenFOAM/lnInclude -I/home/bhb8fe/OpenFOAM/bhb8fe-2.1.0/lib/meshTools/lnInclude -I/home/bhb8fe/OpenFOAM/bhb8fe-2.1.0/lib/lagrangian_new/distributionModels/lnInclude -I/usr/local/openfoam/OpenFOAM-2.1.0/src/thermophysicalModels/specie/lnInclude -I/usr/local/openfoam/OpenFOAM-2.1.0/src/thermophysicalModels/basic/lnInclude -I/usr/local/openfoam/OpenFOAM-2.1.0/src/thermophysicalModels/properties/liquidProperties/lnInclude -I/usr/local/openfoam/OpenFOAM-2.1.0/src/thermophysicalModels/properties/liquidMixtureProperties/lnInclude -I/usr/local/openfoam/OpenFOAM-2.1.0/src/thermophysicalModels/properties/solidProperties/lnInclude -I/usr/local/openfoam/OpenFOAM-2.1.0/src/thermophysicalModels/properties/solidMixtureProperties/lnInclude -I/usr/local/openfoam/OpenFOAM-2.1.0/src/thermophysicalModels/reactionThermo/lnInclude -I/usr/local/openfoam/OpenFOAM-2.1.0/src/thermophysicalModels/SLGThermo/lnInclude -I/usr/local/openfoam/OpenFOAM-2.1.0/src/thermophysicalModels/radiationModels/lnInclude -I/usr/local/openfoam/OpenFOAM-2.1.0/src/turbulenceModels -I/usr/local/openfoam/OpenFOAM-2.1.0/src/transportModels -I/usr/local/openfoam/OpenFOAM-2.1.0/src/regionModels/regionModel/lnInclude -I/usr/local/openfoam/OpenFOAM-2.1.0/src/regionModels/surfaceFilmModels/lnInclude -I/usr/local/openfoam/OpenFOAM-2.1.0/src/dynamicFvMesh/lnInclude -I/usr/local/openfoam/OpenFOAM-2.1.0/src/sampling/lnInclude -IlnInclude -I. -I/usr/local/openfoam/OpenFOAM-2.1.0/src/OpenFOAM/lnInclude -I/usr/local/openfoam/OpenFOAM-2.1.0/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/makeBasicKinematicParcelSubmodels.o
In file included from lnInclude/KinematicCloud.H:644:0,
from lnInclude/basicKinematicCloud.H:36,
from parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C:26:
lnInclude/KinematicCloud.C: In member function 'void Foam::KinematicCloud<CloudType>::patchData_splash( const parcelType&, const Foam::polyPatch&, const Foam::tetIndices&, Foam::scalar, Foam::scalar, Foam::scalar, Foam::scalar, bool&) [with CloudType = Foam::Cloud<Foam::KinematicParcel<Foam::particle> >, Foam::KinematicCloud<CloudType>::parcelType = Foam::KinematicParcel<Foam::particle>, Foam::scalar = double]':
lnInclude/Splash.C:86:3: instantiated from 'bool Foam::Splash<CloudType>::correct(typename CloudType::parcelType&, const Foam::polyPatch&, bool&, Foam::scalar, const Foam::tetIndices&) [with CloudType = Foam::KinematicCloud<Foam::Cloud<Foam::KinematicPa rcel<Foam::particle> > >, typename CloudType::parcelType = Foam::KinematicParcel<Foam::particle>, Foam::scalar = double]'
parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C:49:1: instantiated from here
lnInclude/KinematicCloud.C:860:13: warning: unused variable 'patchI' [-Wunused-variable]
lnInclude/KinematicCloud.C:985:18: warning: unused variable 'mDash' [-Wunused-variable]
lnInclude/KinematicCloud.C: In member function 'Foam::vector Foam::KinematicCloud<CloudType>::tangentVector(con st vector&) const [with CloudType = Foam::Cloud<Foam::KinematicParcel<Foam::particle> >, Foam::vector = Foam::Vector<double>]':
lnInclude/KinematicCloud.C:875:44: instantiated from 'void Foam::KinematicCloud<CloudType>::patchData_splash( const parcelType&, const Foam::polyPatch&, const Foam::tetIndices&, Foam::scalar, Foam::scalar, Foam::scalar, Foam::scalar, bool&) [with CloudType = Foam::Cloud<Foam::KinematicParcel<Foam::particle> >, Foam::KinematicCloud<CloudType>::parcelType = Foam::KinematicParcel<Foam::particle>, Foam::scalar = double]'
lnInclude/Splash.C:86:3: instantiated from 'bool Foam::Splash<CloudType>::correct(typename CloudType::parcelType&, const Foam::polyPatch&, bool&, Foam::scalar, const Foam::tetIndices&) [with CloudType = Foam::KinematicCloud<Foam::Cloud<Foam::KinematicPa rcel<Foam::particle> > >, typename CloudType::parcelType = Foam::KinematicParcel<Foam::particle>, Foam::scalar = double]'
parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C:49:1: instantiated from here
lnInclude/KinematicCloud.C:838:49: error: passing 'const Foam::cachedRandom' as 'this' argument of 'Type Foam::cachedRandom::sample01() [with Type = Foam::Vector<double>]' discards qualifiers [-fpermissive]
make: *** [Make/linux64GccDPOpt/makeBasicKinematicParcelSubmodels.o] Error 1
when i comment out the equation that is using this function then its compiling properly. but i need that function for my model.

I have also attached the kinematic cloud.c file which i try to compile.
Please check that it is giving the error on line 838 where it uses this rndGen_. function.

Anyone have any idea what is wrong or what should i do.

Best Regards,

Bilal
Attached Files
File Type: c KinematicCloud.C (25.4 KB, 17 views)
brbbhatti is offline   Reply With Quote

Old   July 11, 2014, 05:42
Default
  #2
Member
 
bilal
Join Date: Mar 2014
Location: Germany
Posts: 30
Rep Power: 12
brbbhatti is on a distinguished road
Hello ,

no one have any idea what is wrong??
brbbhatti is offline   Reply With Quote

Old   July 11, 2014, 06:43
Default
  #3
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,

in fact the error is quite self explanatory rndGen_ is a constant, while sample01 method modifies the instance of the class. I wasn't able to figure out why it is constant for the source you've provided.
alexeym is offline   Reply With Quote

Old   July 3, 2015, 04:31
Default Any fix for this issue??
  #4
Member
 
Ananda Kannan
Join Date: Feb 2014
Location: Göteborg, Sweden
Posts: 55
Rep Power: 12
ansubru is on a distinguished road
Hi!!

I have encountered the same problem while trying to initialize a Gaussian random number within the class Wallspringsliderdashpot, used in Lagrangian particle tracking... .../src/lagrangian..

Here is the screen stack trace of the error reported while compiling the code -
Code:
lnInclude/WallSpringSliderDashpotvib.C:118:5: error: passing ‘const Foam::Random’ as ‘this’ argument of ‘Foam::scalar Foam::Random::GaussNormal()’ discards qualifiers [-fpermissive]
lnInclude/WallSpringSliderDashpotvib.C:122:5: error: passing ‘const Foam::Random’ as ‘this’ argument of ‘Foam::scalar Foam::Random::scalar01()’ discards qualifiers [-fpermissive]
lnInclude/WallSpringSliderDashpotvib.C:392:9:   instantiated from ‘void Foam::WallSpringSliderDashpotvib<CloudType>::evaluateWall(typename CloudType::parcelType&, const Foam::List<Foam::Vector<double> >&, const Foam::List<Foam::WallSiteData<Foam::Vector<double> > >&, const Foam::List<Foam::Vector<double> >&, const Foam::List<Foam::WallSiteData<Foam::Vector<double> > >&) const [with CloudType = Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cloud<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > >, typename CloudType::parcelType = Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> >]’
parcels/derived/basicKinematicCollidingParcel/makeBasicKinematicCollidingParcelSubmodels.C:53:1:   instantiated from here
Any tips on how to resolve this issue. My initial thoughts are that I should maybe try to declare the random number generator differently..

Btw, here is my current code modification to the class wallspringsliderdashpot -
Code:
template<class CloudType>
void Foam::WallSpringSliderDashpot<CloudType>::evaluateWall
(
    typename CloudType::parcelType& p,
    const point& site,
    const WallSiteData<vector>& data,
    scalar pREff,
    scalar kN,
    bool cohesion
) const
{
.......   
alphaR = sigmar*GaussGen.GaussNormal();  // Gaussian normal distributed polar angle

    // Sample uniformly between 0 and 360 [0 - 2pi]//

    phieR = 360.0*RanGen.scalar01();  // Gaussian normal distributed azimuthal angle

    scalar normalYcomp= rHat_PW.y(); 

    scalar normalZcomp= rHat_PW.z(); 

    vector t_a = vector(0.0, -normalYcomp, normalZcomp);
.......
Any ideas guys??
ansubru is offline   Reply With Quote

Reply

Tags
kinematic cloud, rndgen, splash


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
Centrifugal pump OpenFOAM, convergence problem, ANSA model RDD OpenFOAM Running, Solving & CFD 0 July 5, 2014 10:12
manualInjection model in sprayFoam Mentalo OpenFOAM Running, Solving & CFD 1 April 2, 2014 10:29
problem in glass radiation model (DO model) wunan805 FLUENT 0 October 10, 2012 06:06
Problem in Buoyancy Model? dhrubo CFX 3 June 5, 2010 06:32
A model is used to model particle interaction with the geometry dungsidietquy FLUENT 0 November 4, 2009 17:05


All times are GMT -4. The time now is 04:01.