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

How to modify the particle patchInjection model to a position injection model?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 20, 2018, 07:55
Default How to modify the particle patchInjection model to a position injection model?
  #1
New Member
 
Matthew
Join Date: Aug 2017
Posts: 28
Rep Power: 9
zhangxc0223 is on a distinguished road
Sorry that I am pretty new about the C++ code in OpenFOAM. I am currently trying to simulate a particle-laden flow with the lagrangian particles injecting into the domain from a section at a certain position. The geometry of the section is as same as the inject patch, but it is 100mm away from the inject patch in the downstream domain (shown in the figure). Can it be achieved by simply modifying the codes related to “position” as below in the "patchInjection.C" file? If it is achievable, how to modify them?


Code:
    if ((time0 >= 0.0) && (time0 < duration_))
    {
        scalar nParcels = (time1 - time0)*parcelsPerSecond_;

        cachedRandom& rnd = this->owner().rndGen();

        label nParcelsToInject = floor(nParcels);

        // Inject an additional parcel with a probability based on the
        // remainder after the floor function
        if
        (
            nParcelsToInject > 0
         && (
               nParcels - scalar(nParcelsToInject)
             > rnd.globalPosition(scalar(0), scalar(1))
            )
        )
        {
            ++nParcelsToInject;
        }

        return nParcelsToInject;
    }
    else
    {
        return 0;
    }
By the way, is there any different way to achieve this kind of injection? I have tried many different ways, including the cellZoneInjection. But none of them works fine. Because I would like to perform a random and continuous particle injection during a long-time interval at this desired position.

Thank in advance and kind regards.
Attached Images
File Type: jpg screenshot_20181220_225330.jpg (56.9 KB, 37 views)
zhangxc0223 is offline   Reply With Quote

Reply


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
Particle Tracking (DPM Model) kaveh0a FLUENT 2 July 5, 2018 02:25
How to simulate the eulerian multiphase model about particle jhlee9622 STAR-CCM+ 2 November 24, 2016 12:37
Multiphase flow - incorrect velocity on inlet Mike_Tom CFX 6 September 29, 2016 02:27
problem with solving lagrange reaction cloud Polli OpenFOAM Running, Solving & CFD 0 April 30, 2014 08:53
Water subcooled boiling Attesz CFX 7 January 5, 2013 04:32


All times are GMT -4. The time now is 12:26.