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

Adding quantity to lagrangian particles

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 24, 2024, 09:24
Default Adding quantity to lagrangian particles
  #1
New Member
 
Christoph Wilms
Join Date: Jun 2024
Posts: 2
Rep Power: 0
ChristophWilms is on a distinguished road
Hi everyone,


I am working with DPMFoam (v2012) to simulate a particle-laden turbulent duct flow using a direct numerical simulation.


Adding the missing fvOptions support to the solver was straightforward, see How to add a source term for driving the flow in periodic model by DPMFoam?


At the moment I am trying to add another quantity to the particles. So I looked up the place in the source code where the default quantities like diameter, rho, age, ... are defined. It is in the template base class KinematicCloud ($FOAM_SRC/lagrangian/intermediate/parcels/Templates/KinematicParcel).


I duplicated the lines of 'age' in all four relevant files (KinematicParcel.C, KinematicParcel.H, KinematicParcelI.H, KinematicParcelIO.C) and renamed 'age' to 'myVar' (see attached files).
Unfortunately, the solver crashes during the collision calculation:


Code:
#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigSegv::sigHandler(int) at ??:?
#2  ? in /lib/x86_64-linux-gnu/libc.so.6
#3  Foam::List<Foam::PairCollisionRecord<Foam::Vector<double> > >::doResize(int) at ??:?
#4  Foam::CollisionRecordList<Foam::Vector<double>, Foam::Vector<double> >::matchPairRecord(int, int) at ??:?
#5  Foam::PairSpringSliderDashpot<Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cloud<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > >::evaluatePair(Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> >&, Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> >&) const at ??:?
#6  Foam::PairCollision<Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cloud<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > >::realRealInteraction() at ??:?
#7  Foam::PairCollision<Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cloud<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > >::parcelInteraction() at ??:?
#8  Foam::PairCollision<Foam::CollidingCloud<Foam::KinematicCloud<Foam::Cloud<Foam::CollidingParcel<Foam::KinematicParcel<Foam::particle> > > > > >::collide() at ??:?
#9  ? in ~/OpenFOAM/wilms02-v2012/platforms/linux64GccDPInt32Opt/bin/myDPMFoam
#10  ? in ~/OpenFOAM/wilms02-v2012/platforms/linux64GccDPInt32Opt/bin/myDPMFoam
#11  ? in ~/OpenFOAM/wilms02-v2012/platforms/linux64GccDPInt32Opt/bin/myDPMFoam
#12  ? in ~/OpenFOAM/wilms02-v2012/platforms/linux64GccDPInt32Opt/bin/myDPMFoam
#13  ? in ~/OpenFOAM/wilms02-v2012/platforms/linux64GccDPInt32Opt/bin/myDPMFoam
#14  ? in /lib/x86_64-linux-gnu/libc.so.6
#15  __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
#16  ? in ~/OpenFOAM/wilms02-v2012/platforms/linux64GccDPInt32Opt/bin/myDPMFoam
Segmentation fault

I also changed the order of the variables, as the following thread gives the hint that the order in the constructor should solve the problem, for me without success: Adding Properties to Lagrangian Particle - IOstream problems


Also, when I use the MPPICFoam solver instead of DPMFoam, the calculation runs without errors, but 'myVar' is not saved in the time steps.


Unluckily, the solver crashes in debug mode even without modifications:


Code:
--> FOAM FATAL ERROR: (openfoam-2012)
Tensor is not invertible due to the zero determinant:det(Tensor) = 3.60858e-20

    From Foam::Tensor<Cmpt> Foam::inv(const Foam::Tensor<Cmpt>&, Cmpt) [with Cmpt = double]
    in file /home/wilms02/OpenFOAM/OpenFOAM-v2012/src/OpenFOAM/lnInclude/TensorI.H at line 738.

Does anyone have any idea how to solve this problem or how to implement a new Lagrangian set?

Thanks in advance and best regards
Christoph
Attached Files
File Type: c KinematicParcel.C (13.2 KB, 3 views)
File Type: h KinematicParcel.H (21.3 KB, 1 views)
File Type: h KinematicParcelI.H (10.2 KB, 1 views)
File Type: c KinematicParcelIO.C (12.5 KB, 1 views)
ChristophWilms is offline   Reply With Quote

Old   June 27, 2024, 08:41
Default
  #2
New Member
 
Christoph Wilms
Join Date: Jun 2024
Posts: 2
Rep Power: 0
ChristophWilms is on a distinguished road
I tried the same approach in different OpenFOAM versions with the following results
v2012: The problem described above
v2312: Same as v2012

v8: Same as v2012
v11: It works without problems

I haven't tested it, but I think it should work from v9 onwards, as the lagrangian library has been restructured in v9 (the intermediate folder no longer exists).

However, I would still prefer the esi version as it does not write the particles in barycentric coordinate format (which cannot be read by paraview).
ChristophWilms is offline   Reply With Quote

Reply

Tags
kinematiccloud, lagrangian, particle


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
Looping Over Active Lagrangian Particles cjc96 OpenFOAM Programming & Development 3 March 2, 2021 02:56
Radiation heating of lagrangian particles in reactingParcelFoam CHUIKOV OpenFOAM Running, Solving & CFD 0 February 28, 2021 15:53
multiRegionHeater error ordinary OpenFOAM Running, Solving & CFD 2 June 9, 2020 18:43
How to get Path lines for lagrangian particles? vidyadhar OpenFOAM Post-Processing 0 January 31, 2017 06:38
chtMultiRegionSimpleFoam samiam1000 OpenFOAM Running, Solving & CFD 39 March 31, 2016 09:43


All times are GMT -4. The time now is 21:17.