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

Adding List to kinematicParcel

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 18, 2019, 10:55
Default Adding List to kinematicParcel
  #1
Member
 
Joaquín Neira
Join Date: Oct 2017
Posts: 38
Rep Power: 8
cojua8 is on a distinguished road
Hello!,

I'm working on a lagrangian project in which I need to add a List member to kinematicParcel. This list is of type List<tuple2<scalar, vector>> :

KinematicParcel.H
Code:
...
// Basset
            //- storage of dt [s] and Ur [m/s]
            List<Tuple2<scalar, vector>> BassetList_;
...
In KinematicParcel.C, I have:
Code:
...
       if
        (
            p.age()
         <= td.cloud().constProps().dtB()*(td.cloud().constProps().NB() + 1)
        )
        {
            p.BassetList().resize(p.BassetList().size() + 1);
        }
        // rota la lista: el mas reciente se ubicara al principio
        inplaceRotateList(p.BassetList(), 1);

        p.BassetList().first().first() = dt;
        p.BassetList().first().second() = p.Uc() - p.U();
...
with NB = 2000 and dtB = 0.0001, BassetList has a max size of about 200000.

In file KinematicParcelIO.C, i have:
Code:
...
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

template<class ParcelType>
Foam::string Foam::KinematicParcel<ParcelType>::propertyList_ =
    Foam::KinematicParcel<ParcelType>::propertyList();

template<class ParcelType>
const std::size_t Foam::KinematicParcel<ParcelType>::sizeofFields_
(
    offsetof(KinematicParcel<ParcelType>, BassetList_)
  - offsetof(KinematicParcel<ParcelType>, active_)
);


// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //

template<class ParcelType>
Foam::KinematicParcel<ParcelType>::KinematicParcel
(
    const polyMesh& mesh,
    Istream& is,
    bool readFields
)
:
    ParcelType(mesh, is, readFields),
    active_(false),
    typeId_(0),
    nParticle_(0.0),
    d_(0.0),
    dTarget_(0.0),
    U_(Zero),
    rho_(0.0),
    age_(0.0),
    tTurb_(0.0),
    UTurb_(Zero),
    BassetList_(),
    rhoc_(0.0),
    Uc_(Zero),
    muc_(0.0),
    curlUc_(Zero)
...
(I do not write BassetList to file, since it writes big sized files (200k lines per particle, for thousands of particles).

The problem is that when I run my case with just 50 particles, I get a memory error (running on cluster) after a second of simulation
cojua8 is offline   Reply With Quote

Reply

Tags
lagrangian, list, memory error


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
[swak4Foam] funkyDoCalc with OF2.3 massflow NiFl OpenFOAM Community Contributions 14 November 25, 2020 03:30
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 ordinary OpenFOAM Installation 19 September 3, 2019 18:13
[Other] How to use finite area method in official OpenFOAM 2.2.0? Detian Liu OpenFOAM Meshing & Mesh Conversion 4 November 3, 2015 03:04
[foam-extend.org] problem when installing foam-extend-1.6 Thomas pan OpenFOAM Installation 7 September 9, 2015 21:53
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


All times are GMT -4. The time now is 16:48.