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

Create particle clouds at runtime

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   April 13, 2010, 04:35
Default Create particle clouds at runtime
  #1
Member
 
Cedric Van Holsbeke
Join Date: Dec 2009
Location: Belgium
Posts: 81
Rep Power: 16
CedricVH is on a distinguished road
The standard way of defining a kinematic cloud is by creating a createClouds.H file with following constructor:

Code:
Info<< "Constructing kinematicCloud1" << endl;
basicKinematicCloud kinematicCloud1
(
    "kinematicCloud1",
    rho, 
    U,
    mu,
    g
);
However, all clouds must be specified at compile time which is not a good programming practice. To define it at run time, it is better to create a dictionary file constant/kinematicCloudList which specifies the clouds:

Code:
kinematicCloudNames        kinematicCloud1 kinematicCloud2;
I want to read in this file in the createClouds.H file to see which clouds have to be created at runtime:

Code:
Info<< "Reading kinematicCloudList\n" << endl;

IOdictionary kinematicCloudList
(
        IOobject
        (
        "kinematicCloudList",
        runTime.constant(),
        mesh,
        IOobject::MUST_READ,
        IOobject::NO_WRITE
        )
);

List<word> kinematicCloudNames(kinematicCloudList.lookup("kinematicCloudNames"));
Now I want to use this information to create a Map or a List of these clouds which I can use in my main solver (to evolve the cloud):

Code:
Map<kinematicCloud> kinematicClouds(kinematicCloudNames.size());

forAll(kinematicCloudNames, cloudI)
{
    Info<< "Constructing " << kinematicCloudNames[cloudI] << endl;
    kinematicClouds.set(kinematicCloudNames[cloudI], new basicKinematicCloud
    (
        kinematicCloudNames[cloudI],
        rho, 
        U,
        mu,
        g
    ),true);
}
But when compiling, I get following error:

Code:
createClouds.H: In function ‘int main(int, char**)’:
createClouds.H:29: fout: no matching function for call to ‘Foam::Map<Foam::kinematicCloud>::set(Foam::word&, Foam::basicKinematicCloud*, bool)’
/home/cedric/OpenFOAM/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude/HashTable.C:256: note: kandidaten zijn: bool Foam::HashTable<T, Key, Hash>::set(const Key&, const T&, bool) [with T = Foam::kinematicCloud, Key = int, Hash = Foam::Hash<int>]
/home/cedric/OpenFOAM/OpenFOAM-1.6.x/src/OpenFOAM/lnInclude/HashTableI.H:88: note:                  bool Foam::HashTable<T, Key, Hash>::set(const Key&, const T&) [with T = Foam::kinematicCloud, Key = int, Hash = Foam::Hash<int>]
It seems that the constructor of Map does not work with the type kinematicCloud. I have also tried it with List<kinematicCloud>, but this gave the same error.

Is there a better system of grouping clouds? Or is there a better system to create clouds at runtime?
CedricVH is offline   Reply With Quote

 


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
Meshing a Sphere Ajay FLUENT 10 September 3, 2016 14:18
Actuator disk model audrich FLUENT 0 September 21, 2009 07:06
Where's the singularity/mesh flaw? audrich FLUENT 3 August 4, 2009 01:07
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 01:29
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55


All times are GMT -4. The time now is 00:58.