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

Assign a Euler value to a lagrangian particle

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 22, 2018, 14:13
Default Assign a Euler value to a lagrangian particle
  #1
New Member
 
Davide
Join Date: Jun 2018
Posts: 10
Rep Power: 8
Lighto is on a distinguished road
Hello foamers,

I have a simple question (even though I'm struggling to find an answer...)

I want to assign a value coming from an Euler volume field to a lagrangian particle. The idea is that if a particle belongs to a cell where, from the solution of the Euler equation, there is a certain value of U, fvc::grad(U), and so on, that particle should have assigned that U, fvc::grad(U), etc...

I searched in the lagrangian libraries and I found that in the folder Intermediate > parcels > Templates > KinematicParcel there are some files that do that (for example) for the velocity U. I want to do the same for another scalar volume field that I have created on my own, but I didn't managed to do so.

I copied-paste all the lines that include U and replaced "U" with my scalar volume field "Stress" (also replaced "vector" with "scalar" when necessary). For example in file KinematicParcel.C I've added the lines
Code:
Stress_(p.Stress)
in the constructors.
In the file KinematicParcel.H (that is called at the very first lines of the file *.C) I've added
Code:
scalar Stress_
in the Parcel properties. In the same file, in access and edit sections
Code:
// Access
    [...]
    //- Return const access to scalar stress
    inline scalar Stress() const
    [...]

// Edit
    [...]
    //- Return access to scalar stress
    inline scalar& Stress()
Finally, to write a output file for Scalar I've also modified (with the same "phylosophy" above) the file KinematicParcelIO.H

But, when I try to compile with wmake all, the error is:
Code:
lnInclude/KinematicParcel.H:438:27: warning: inline function ‘Foam::scalar Foam::KinematicParcel<ParcelType>::Stress() const [with ParcelType = Foam::particle; Foam::scalar = double]’ used but never defined [enabled by default]
             inline scalar Stress() const;
I have already defined Scalar in the createFields.H file.

Any idea to fix that?

Regards,
Davide
Lighto is offline   Reply With Quote

Reply

Tags
kinematicparcel, lagrangian, openfoam 4.0 extend, output, volscalafield


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
Assign Particle Size in java for Polyhedral Partcles Vee STAR-CCM+ 1 April 22, 2018 10:45
Particle tracking error alchem OpenFOAM Bugs 5 May 6, 2017 17:30
Lagrangian Particle Tracking in Eulerian-Eulerian Multiphase Flow DarrenC CFX 5 April 7, 2016 15:50
injection problem Mark New FLUENT 0 August 4, 2013 02:30
DPM UDF particle position using the macro P_POS(p)[i] dm2747 FLUENT 0 April 17, 2009 02:29


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