|
[Sponsors] |
defining particle positions by manualInjection in icoLagrangianFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 19, 2014, 07:16 |
defining particle positions by manualInjection in icoLagrangianFoam
|
#1 |
Member
Alireza Atrian
Join Date: May 2014
Posts: 39
Rep Power: 11 |
Hello
I am a new begginer to openFoam and working on particle tracking in order to simulate sediment transport. i have choosen icoLagrangianFoam solver in openFOAM-ext 3.0. This solver includes a case (channelParticles) which by default injects the particles at SOI but I want to settle the particles on bed randomely in order to simulate bedload transport. I guess I can get it done using src\lagrangian\intermediate\submodels\Kinematic\In jectionModel\ManualInjection and making "positionFile" dictionary. but unfortunately i don't know how it is exactly possible. which files I have to change and what files I have to add?! The other question of mine is that is it possible to define friction for all the particles (to simulate sediment) I will be very thankful if someone shows me the way. |
|
October 20, 2014, 05:18 |
|
#2 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20 |
Hi,
I'm not an expert either, but I can tell you the following, which might help: ManualInjection can solely be used for instant injections; Have a look at the "timeEnd()" method of: Code:
vi $FOAM_SRC/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C A question which might help you: Is your bed on a patch? Because if so, you might want to have a look at PatchInjection, which does allow for time-dependent injection (and there are tutorial cases which use it). Otherwisely, maybe KinematicLookupTableInjection might have something useful. (I never used it, but given its name and given that it does have a time-dependency, it might have what you want.) The only alternative I see to the above (someone else might know more than me), is to write your own InjectionModel based of ManualInjection. |
|
October 20, 2014, 08:44 |
|
#3 |
Member
Alireza Atrian
Join Date: May 2014
Posts: 39
Rep Power: 11 |
Hi Kevin
thanks for your kind guidance I should say that in file "manualInjection.H" , in Description part, its mentioned that parcel positions can be specified through the file named "positionFile". so i made a "dictionary" class type file in 0/lagrangian directoy (i dont know whether it should be in this location or not) and specified the particle positions in this format: Code:
90 ( (0.803837 0.0226777 0.005) (0.763517 0.0123323 0.005) (0.792514 0.0204512 0.005) (0.940018 0.0663434 0.005) (0.788872 0.0131514 0.005) ) Code:
injectionModel { type manualInjection; massTotal 0.0001; parcelBasisType mass; SOI 0; positionsFile "PositionsFile"; U0 ( 0 0 0 ); parcelPDF { pdfType RosinRammler; RosinRammlerPDF { minValue 50.0e-06; maxValue 100.0e-06; d (75.0e-06); n (0.5); } } } Code:
Reading g Constructing kinematicCloud --> FOAM Warning : From function Cloud<ParticleType>::initCloud(const bool checkClass) in file /home/alireza/foam/foam-extend-3.0/src/lagrangian/basic/lnInclude/CloudIO.C at line 124 Cannot read particle positions file "/home/alireza/Desktop/icoLagrangianFoam/channelParticles/0/lagrangian/kinematicCloud" assuming the initial cloud contains 0 particles. mybe i can inject the paticles in a very short period of time (e.g 0.001 sec.) so the particles wont move but the simulation run is going on (water movement on particles) is there any idea? thax a lottt |
|
October 20, 2014, 09:45 |
|
#4 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20 |
Position file:
Your position file needs to be in the constant directory, right next to your properties file. For example, if you have: "particleProperties" and "particlePositions" for your filenames, you'd have (copied from a case of mine (OF v2.3.x), adapt it to your case): Code:
in constant/particleProperties file injectionModels { model1 { type manualInjection; massTotal 1; //unused when parcelBasisType=fixed. parcelBasisType fixed; nParticle 1; //number of particles per parcel SOI 0; //start-time of the injection positionsFile "particlePositions"; U0 (0 0 0); sizeDistribution { type uniform; uniformDistribution { minValue 20e-06; maxValue 20e-06; } } } } Code:
in constant/particlePositions file (...Header...) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ( (0.004463 0.028349 0.000000) (-0.002976 0.020872 0.000000) (-0.007233 0.029628 0.000000) (-0.001094 0.020986 0.000000) (-0.004087 0.023335 0.000000) (-0.004742 0.023012 0.000000) ) It is certainly possible to enforce particles to be static for some amount of time. It is even possible to randomize it such that particles "come loose" over time, independently. However, I'm not aware of any OF feature that can do so, meaning you'd need a custom CloudFunctionObject (CCFO) for that task. It is, however, easier to write a custom ManualInjection model by simply copying it, and including a time-dependency than to write such a CCFO. Though, if it is possible for you to use it, PatchInjection would be your best call, since it already allows you do inject particles at a random position as a function of time (provided your bed is on a patch). So if possible, I'd highly recommend taking a look at this first. |
|
October 21, 2014, 05:46 |
|
#5 |
Member
Alireza Atrian
Join Date: May 2014
Posts: 39
Rep Power: 11 |
Hi kevin
from the errors, I found that the particle positin file should be in “positions” file name and should be placed in 0/lagrangian/kinematicCloud/ directory and also should be in the following format: Code:
1000 ( (0.195632 0.0414094 0.005) 419 (0.189153 0.0619011 0.005) 618 (0.194084 0.039347 0.005) 319 . . . ) Code:
InjectionModel ManualInjection; ManualInjectionCoeffs { massTotal massTotal [ 1 0 0 0 0] 2.0e-4; parcelBasisType mass; SOI 0; positionsFile "positionsFile"; U0 ( 0 0 0 ); sizeDistribution { type fixedValue; fixedValueDistribution { value 5e-06; } } } but now I recieve the following errors: Code:
file: /home/alireza/Desktop/icoLagrangianFoam/channelParticles/constant/positionsFile at line 0. From function regIOobject::readStream() in file db/regIOobject/regIOobjectRead.C at line 61. FOAM exiting The error arises from the following lines (in file regIOobjectRead.C): // Construct object stream and read header if not already constructed if (!isPtr_) { if (!(isPtr_ = objectStream())) { FatalIOError ( "regIOobject::readStream()", __FILE__, __LINE__, objectPath(), 0 ) << "cannot open file" << exit(FatalIOError); } I guess, maybe, it is because of the class name of position file wich I have inserted all of these 3 type: ManualInjection<CloudType> dictionary and Cloud<basicKinematicParcel> but no progress. The other question of mine is that what are the numbers (419 ,618, 319) after paranthesis (the position coordination) in “positions” file stand for and means? when I delete one of them I will receive the following error: Code:
wrong token type - expected int found on line 25 the punctuation token '(' file: /home/alireza/Desktop/icoLagrangianFoam/channelParticles/0/lagrangian/kinematicCloud/positions at line 25. From function operator>>(Istream&, int&) in file primitives/ints/int/intIO.C at line 68. thanks alot |
|
October 21, 2014, 06:13 |
|
#6 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20 |
I know little about OF 3.0-ext (I'm solely using OF 2.3.x), hence we may have had some differences in the posts above.
However, I did find the following for you (which is for "foam-extend-3.0", which is what you're using, right?): Tutorial case (coalChemistryFoam) which uses ManualInjection: http://sourceforge.net/p/openfoam-ex...mplifiedSiwek/ Position file in constant/ directory: http://sourceforge.net/p/openfoam-ex...loud1Positions Properties file in constant/ directory: http://sourceforge.net/p/openfoam-ex...oud1Properties From this I learn that:
I'd say, move your position file to the appropriate directory (following the tutorial case I linked), and see if the error disappears. |
|
October 21, 2014, 14:18 |
|
#7 |
Member
Alireza Atrian
Join Date: May 2014
Posts: 39
Rep Power: 11 |
thanxxx alot for your kindly guidance kevin, you made my solver Starting time loop (but no conclusion!)
I made these changes: 1. I put the "positions" file in constant directory 2. (from the tutorial case you showd me) I changed the positions file in this format: Code:
FoamFile { version 2.0; format ascii; class vectorField; location "constant"; object positions; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // ( (0.005 0.05 0.005) (0.010 0.05 0.005) (0.015 0.05 0.005) ) Code:
ManualInjectionCoeffs { massTotal massTotal [ 1 0 0 0 0] 2.0e-4; parcelBasisType mass; SOI 0; positionsFile "positions"; U0 ( 0 0 0 ); sizeDistribution { type fixedValue; fixedValueDistribution { value 5e-06; } } parcelPDF { pdfType RosinRammler; RosinRammlerPDF { minValue 50.0e-06; maxValue 100.0e-06; d (75.0e-06); n (0.5); } } } Code:
Reading g Constructing kinematicCloud --> FOAM Warning : From function Cloud<ParticleType>::initCloud(const bool checkClass) in file /home/alireza/foam/foam-extend-3.0/src/lagrangian/basic/lnInclude/CloudIO.C at line 124 Cannot read particle positions file "/home/alireza/Desktop/icoLagrangianFoam/ManualInjection/channelParticles/0/lagrangian/kinematicCloud" assuming the initial cloud contains 0 particles. Selecting DispersionModel none Selecting DragModel SphereDrag Selecting InjectionModel ManualInjection Constructing 2-D injection Selecting pdfType RosinRammler Selecting PatchInteractionModel StandardWallInteraction Selecting PostProcessingModel PatchPostProcessing Selecting U IntegrationScheme Euler Starting time loop Time = 0.001 Courant Number mean: 0 max: 0.2 velocity magnitude: 1 Evolving kinematicCloud --> Cloud: kinematicCloud Added 27 new parcels Cloud: kinematicCloud Total number of parcels added = 27 Total mass introduced = 0.0002 Current number of parcels = 27 Current mass in system = 0.0002 Code:
Evolving kinematicCloud now my questions are: - is it clear for you what is problem - are the 'class' and 'location' values in the header of positions file correct? and is it necessary to specify the 'location' option in the header? I add that the file "CloudIO.C" (mentioned in the log) contains: Code:
void Foam::Cloud<ParticleType>::initCloud(const bool checkClass) { readCloudUniformProperties(); IOPosition<ParticleType> ioP(*this); if (ioP.headerOk()) { ioP.readData(*this, checkClass); ioP.close(); if (this->size()) { readFields(); } } else { WarningIn("Cloud<ParticleType>::initCloud(const bool checkClass)") << "Cannot read particle positions file " << nl << " " << ioP.path() << nl << " assuming the initial cloud contains 0 particles." << endl; } I'm really thankful |
|
October 21, 2014, 15:13 |
|
#8 |
Member
Alireza Atrian
Join Date: May 2014
Posts: 39
Rep Power: 11 |
Hi Kevin
I think I found why run stops suddenly I think the particle numbers which should be added finishes before the endTime of run because I introduced only 27 particles totally. ofcourse this is my hypothesis! I mentioned this matter not to waste your time absurdly but i still have the other questions i mentioned |
|
October 22, 2014, 03:40 |
|
#9 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20 |
I don't know, but a few things I can suggest are:
|
|
October 23, 2014, 16:49 |
|
#10 |
Member
Alireza Atrian
Join Date: May 2014
Posts: 39
Rep Power: 11 |
Hi kevin
My hypothesis was completely right and simulation running stoped only because of very low number of particles. I generated 6000 random positions by Excel and inserted them in position file so everything resolved and I run the solver without annnyyy error and this was ofcourse for the sake of your guidelines. Thnx 1. Yes, sizeDistribution works exactly the same as parcelPDF (in of-exd 3.0). so I deleted the sizeDistribution in my kinematicCloudProperties file. 2. About the “parcelBasisType” function: we have three parameters “totalMass”, “density” and “number of parcels”. My guess is that openfoam changes the particle diameters to keep totalMass constant (as value you specified). Because, according to No. of Par. and particle distribution method, openFoam determines each particle diameter. So diameters changes in relevant to No. of Pars. My evidence to claim this is that: whether when I put “Total number of parcels added = 20” or 2000 or 6000 I will always have the constant “Total mass introduced = 0.0002” for all three cases. 3. About the warning I get I have to say that occurs even in the default tutorial case. So I ignored it! About simulation beginning time In controlDict: startFrom firstTime; startTime 0; and in kinematicCloudPros: SOI (start of injection) 0 4. ‘location’ in the header of position file has noooo effect on the result. I can even disable it! - At last, my last finding was that when injection is Manual, duration option has noooooooo influence of the result, so injection is at a moment and "parcelPerSecond" and "volumeFlowRate" does not make any sense too. I hope I have you in contact in case of problems thnx |
|
October 24, 2014, 03:27 |
|
#11 | ||
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20 |
I'm glad that you have your simulation running.
Concerning ManualInjection: it does not support a time-dependency, as can be seen in the source-code: Quote:
Quote:
|
|||
November 4, 2014, 15:28 |
virtualMass
|
#12 |
Member
Alireza Atrian
Join Date: May 2014
Posts: 39
Rep Power: 11 |
Hi kevin again
I intend to implement virtual mass force in icolagrangianFoam solver (foam-exd 3.0) as explained in: HTML Code:
http://www.cfd-online.com/Forums/openfoam-programming-development/143543-virtual-mass-force-implementation-icolagrangianfoam-foam_exd-3-0-a.html would you please guide me and mention even small hints if you know anything about the problem?! |
|
November 5, 2014, 03:03 |
|
#13 |
Senior Member
Kevin van As
Join Date: Sep 2014
Location: TU Delft, The Netherlands
Posts: 252
Rep Power: 20 |
No, I don't. It is significantly different than OF2.3.x's implementation.
However, by the looks of it, the answer is very simple: "not implemented". What you are trying to do is not available in the OF version you are using. While I have never used the virtual mass force before, by a quick look into the source code, it does seem to be implemented in OF2.3.x. |
|
July 12, 2016, 07:16 |
kinematic cloud properties-Regd
|
#14 |
Member
GS
Join Date: Mar 2016
Posts: 81
Rep Power: 10 |
Hi,
I would like to understand what is the meaning of "rhoMin" & "rho0" in the kinematic Cloud properties file in Lagrangian solver of foam-extend3.2 I want to specify and vary the density of the particles that I inject. For this, where should I make changes. Please let me know if you are aware of this... Also, please let me know these: "minParticleMass" & "RosinRammlerPDF" Thank you. |
|
July 14, 2016, 04:21 |
|
#15 | |
Member
Ping Chang
Join Date: Feb 2016
Location: Perth
Posts: 93
Rep Power: 10 |
Quote:
rho0 is the particle density, and RosinRammlerPDF is a kind of distribution for the particles. |
||
July 14, 2016, 07:35 |
|
#16 | |
Member
GS
Join Date: Mar 2016
Posts: 81
Rep Power: 10 |
Quote:
Thanks for the information. Could you please tell the difference between 'rho' & 'rho0' given in the kinematicCloudProperties file. Is there a limit on the value of rho0. Because, if i am changing the default values, foam is giving errors(FLOATING POINT EXCEPTION). Also, for moderate values of rho0, the solution is running only upto a limited number of time steps than mentioned in the controlDict file. Thanks |
||
April 13, 2017, 03:54 |
How to inject solid particles in mesh in openFOam2.4.0 for particle tracking
|
#17 |
Member
AJAY BHANDARI
Join Date: Jul 2015
Location: INDIA
Posts: 57
Rep Power: 10 |
Hi all,
I think my post best fits here. I want to do particle tracking of a solid particle injected from a specified position in mesh. Then after adding the injector i want to couple the lagrangian solution with the eulerian one just like icolagrangian foam. In my case it is not icoFoam but it is poroussimpleFoam as i am simulated flow through porous media. I am working in openFoam2.4.0 Any suggestions how should i start with the lagrangian part and how i inject the particles. Right now i am following this link to inject particles in my computational domain and then coupling with the eulerian solution to do particle tracking http://www.tfd.chalmers.se/~hani/kur...tonPersson.pdf (Please see Page no 19 of this) But its not working due to openFoam version problem. Can anybody tell how to inject particles in openFoam2.4.0 version. or what should i change in the above mentioned link to make it work for openFoam 2.4.0 Best Ajay |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Error during reconstructing lagarangian fields | ybapat | OpenFOAM | 9 | November 17, 2014 07:52 |
decomposePar field transfer of particle positions failed | sophie_l | OpenFOAM Running, Solving & CFD | 2 | October 28, 2014 20:46 |
injection problem | Mark New | FLUENT | 0 | August 4, 2013 01:30 |
Check particle impaction with User Fortran | Julian K. | CFX | 3 | January 12, 2012 09:46 |
DPM UDF particle position using the macro P_POS(p)[i] | dm2747 | FLUENT | 0 | April 17, 2009 01:29 |