|
[Sponsors] |
January 21, 2016, 09:45 |
|
#61 |
New Member
Alejandro López
Join Date: Mar 2013
Location: Bilbao
Posts: 16
Rep Power: 13 |
Aye, my bad! I think it's ok now!
__________________
Alex |
|
January 22, 2016, 05:18 |
|
#62 |
Senior Member
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 240
Rep Power: 17 |
Thanks Alex!
What I can't understand is how you get two-way coupling when you include the particle momentum neighter in the UEqn nor in the pressure equation, only in the momentum predictor which is just a beginning guess for a desired divergence free velocity field. Any term in the momentum predictor that isn't somwhere in the pressure velocity coupling of the PISO should vanish in the iteration, right? However, I am fighting with the p_rgh when trying to implement two-way coupling via a source term in the pressure equation... |
|
January 22, 2016, 08:17 |
|
#63 | |
New Member
Alejandro López
Join Date: Mar 2013
Location: Bilbao
Posts: 16
Rep Power: 13 |
Quote:
You're probably right. I compiled this solver for OF22x two years ago just roughly following Aurelia Vallier's instructions and recompiled the same for 23x, since apparently, a common problem seems to be upgrading it to 23x. For two-way coupled simulations I'm currently using either a solver linked to the intermediate library in 22x or DPMFoam in 23x. In there, you implement two-way coupling via a source term in the momentum equation. I did the course in Chalmers and went over the Lagrangian intermediate library of OF22x two years ago in this link: http://www.tfd.chalmers.se/~hani/kur...ing_report.pdf . It's not the best report but I tried to include as much as I could back then. Not sure if you'll find it useful though!
__________________
Alex |
||
February 4, 2016, 06:57 |
4-way coupling of interFOAM to Lagrangian Particle Cloud
|
#64 |
Senior Member
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 240
Rep Power: 17 |
Hi all,
OK I managed to do the 4way coupling for my version of interMixingFoam in agreement with DPMFoam, and the Goldschmidt test case looks fine. However, I get a shift in phase concentrations where the flow leaves a cell with parcels, and that causes negative concentrations within the phase derived by 1 -first solved phase fraction - second solved phase fraction. Anyone has an idea about that? I solve the phase transport equations in the alphaEqns the usual way to get my phase-averaged viscosity and density field, but then I create a modified phase-averaged field to account for the particles as alphac = 1.0 - kinematicCloud.theta() and a modified density field rhoc = alphac * rho and the corresponding surfaceScalarFields and rhoPhic to feed into the momentum equation in UEqn.H. The flux phi is calculated in the PISO loop with: HbyA = rAU*UEqn.H(); surfaceScalarField phiHbyA ( "phiHbyA" (fvc::interpolate(HbyA) & mesh.Sf()) + alphacf*fvc::interpolate(rhoc*rAU)*fvc::ddtCorr(U, phi) ); adjustPhi(phiHbyA, U, p_rgh); phiHbyA += phig; //phig contains source terms gravity, drag... while (pimple.correctNonOrthogonal()) { fvScalarMatrix p_rghEqn ( fvm::laplacian(alphacf*rAUf, p_rgh) == fvc::div(alphacf*phiHbyA) ); p_rghEqn.setReference (...); p_rghEqn.solve(...); if (pimple.finalNonOrthogonalIter()) { phi = phiHbyA - p_rghEqn.flux()/alphacf; U = HbyA + rAU*fvc::reconstruct((phig - p_rghEqn.flux()/alphacf)/rAUf); ... } } |
|
March 18, 2016, 11:04 |
Particles per cell
|
#65 |
Member
HM
Join Date: Apr 2015
Posts: 30
Rep Power: 11 |
Hi foamers,
I am using solidParticle class and I am trying to calculate the number of particles in each cell at certain times. I want to combine all of the particles in a cell. Any suggestions? Thanks, Last edited by hojjat.m; April 1, 2016 at 11:23. |
|
April 28, 2016, 05:34 |
|
#66 |
New Member
Ebrahim
Join Date: Mar 2010
Posts: 28
Rep Power: 16 |
Hi Everybody,
I'm trying to implement the Aurelia's code in OF 3, but facing some problems in post-processing. For code validation, I simulate the same flow field as Aurelia's (boxLPT), but when I open the results via paraview, I face this warning: " different time directories with the same time value X and Y found. Y will be ignored " (this warning is repeated for about 30 times). Also, I can see just 4 time step data with time intervals equal to 1, while I should have 60 time steps with time intervals of 2.5 e-5 . If I load the results via parafoam command (instead of paraview), I don't see such a warning. However, only Eulerian data will be loaded! Any suggestion is appreciated! |
|
May 12, 2016, 03:50 |
|
#67 | |
Member
Ping Chang
Join Date: Feb 2016
Location: Perth
Posts: 93
Rep Power: 10 |
Quote:
did you rewrite the solver? I mean did you add the particles track functions to the simpleFoam solver or you just used the given solver by OF? |
||
February 7, 2017, 04:59 |
|
#68 | |
New Member
Kryss
Join Date: Dec 2016
Posts: 9
Rep Power: 10 |
Quote:
I`ve downloaded your files and tried to make them work, but I`m confused. On which case do I use it on? Am I supposed to create my own case using your additionalFiles? I need to use particletracking for the olaFOAM (wave generating) solver, using a given geometry. And I`m desperate for help! Cheers, Kryss |
||
February 7, 2017, 10:17 |
|
#69 | |
New Member
Alejandro López
Join Date: Mar 2013
Location: Bilbao
Posts: 16
Rep Power: 13 |
Quote:
If you need lagrangian particles I would recommend using the tutorial in the Chalmers website. At the end of the report, there is a blockMeshDict for generating a square section elbow on which to run a simple case. You can read through the tutorial and try doing the same in olaFoam. The coupling is fairly easy to achieve. I would recommend that you use the intermediate library because of it's enhanced functionality if compared to solidParticle. There are also other options such as swak4FOAM for adding lagrangian particles. The tutorial on the Chalmers webpage is for OpenFOAM 2.2.x. If you want coupling in, lets say, OF3.0.x, you could have a look at DPMFoam and compare it with pimpleFoam to see what the differences are and how to add the lagrangian library. It's very similar to the tutorial files although with some small changes because of the version. There is also training about the Lagrangian Intermediate Library here from the last OpenFOAM workshop. There should be a case on which to run the tutorial too. If you still have trouble you can send me a private and I'll try to help you.
__________________
Alex |
||
March 8, 2017, 09:06 |
adding lagrangian particle tracking to multiphaseEulerFoam
|
#70 |
Member
Thomas Flint
Join Date: Jan 2016
Posts: 60
Rep Power: 10 |
Hi,
I know this thread has not been touched in a while but I thought someone may be able to help me. I am trying to implement the lagrangian solid particle tracking described in this thread into the multiphaseeulerfoam solver. I have followed the steps provided and the solver compiles ok. However, when I attempt to run a case I get an error from the "inject" function through the "move" function. My inject function is: Code:
void Foam::solidParticleCloud::inject(solidParticle::trackingData &td) { label celli=1; label tetFacei=1; label tetPtI=1; mesh_.findCellFacePt(td.cloud().posP1_, celli, tetFacei, tetPtI); solidParticle* pPtr1=new solidParticle(mesh_,td.cloud().posP1_,celli,tetFacei,tetPtI,td.cloud().dP1_,td.cloud().UP1_); Foam::Cloud<solidParticle>::addParticle(pPtr1); //mesh_.findCellFacePt(td.cloud().posP1_, cellI, tetFaceI, tetPtI); //solidParticle* pPtr2=new solidParticle(mesh_,td.cloud().posP2_,cellI,tetFaceI,tetPtI,td.cloud().dP2_,td.cloud().UP2_); //Foam::Cloud<solidParticle>::addParticle(pPtr2); } Code:
void Foam::solidParticleCloud::move(const dimensionedVector& g) { const volScalarField& rho = mesh_.lookupObject<const volScalarField>("rho"); const volVectorField& U = mesh_.lookupObject<const volVectorField>("U"); const volScalarField& nu = mesh_.lookupObject<const volScalarField>("nu"); interpolationCellPoint<scalar> rhoInterp(rho); interpolationCellPoint<vector> UInterp(U); interpolationCellPoint<scalar> nuInterp(nu); solidParticle::trackingData td(*this, rhoInterp, UInterp, nuInterp, g.value()); Cloud<solidParticle>::move(td, mesh_.time().deltaTValue()); //if(mesh.time().value()>td.spc().tInjStart&&mesh.time().value()<td.spc().tInjEnd)//ORIGINAL //{ //this->inject(td); //} if(mesh_.time().value()>td.cloud().tInjStart_&&mesh_.time().value()<td.cloud().tInjEnd_) { this->inject(td); } } Code:
Foam::Cloud<solidParticle>::addParticle(pPtr1); The fault I am getting when I run the case is: 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 double Foam::particle::trackToFace<Foam::solidParticle::trackingData>(Foam::Vector<double> const&, Foam::solidParticle::trackingData&) at ??:? #4 Foam::solidParticle::move(Foam::solidParticle::trackingData&, double) at ??:? #5 void Foam::Cloud<Foam::solidParticle>::move<Foam::solidParticle::trackingData>(Foam::solidParticle::trackingData&, double) at ??:? #6 Foam::solidParticleCloud::move(Foam::dimensioned<Foam::Vector<double> > const&) at ??:? #7 ? at ??:? #8 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #9 ? at ??:? Segmentation fault (core dumped) Thanks in advance. |
|
March 8, 2017, 10:32 |
|
#71 |
Member
Mahdi
Join Date: Jul 2012
Posts: 53
Rep Power: 14 |
If the solver compiles without error, one possible reason for this problem might be the initial values you provide in the //constant/particleProperties. If I'm not mistaken, this error seems to happen in cases with problem in numerical singularities (e.g. when a number is divided by zero somewhere in the code)
|
|
March 8, 2017, 11:00 |
thankyou
|
#72 |
Member
Thomas Flint
Join Date: Jan 2016
Posts: 60
Rep Power: 10 |
Thankyou so much Mahdi,
You are absolutely correct, I was injecting particles outside my domain. Many thanks. Have a nice day, Tom |
|
March 9, 2017, 07:25 |
another problem; implementing two-way coupling in openfoam4
|
#73 |
Member
Thomas Flint
Join Date: Jan 2016
Posts: 60
Rep Power: 10 |
Hello again everyone,
I'm afraid I have run into another obstacle. I believe this is because I am using openfoam version 4 and some of the syntax has changed. This line of code is giving me problems in the momentumsource in solidParticleCloudI.H: Code:
tsource().internalField() = - smom_/(mesh_.time().deltaT().value()*mesh_.V()); however the RHS of the equation is giving me real problems. Has something changed between the versions of openfoam to cause this, or am I being silly. The error I get is: Code:
In file included from solidParticleCloud.H:144:0, from ParticlemultiphaseEulerFoam.C:47: solidParticleCloudI.H: In member function ‘Foam::tmp<Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> > Foam::solidParticleCloud::momentumSource() const’: solidParticleCloudI.H:122:16: error: no match for ‘operator=’ (operand types are ‘Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>’ and ‘Foam::tmp<Foam::Field<Foam::Vector<double> > >’) tsource.ref() =(- smom_/(mesh_.time().deltaT().value()*mesh_.V()));// - smom_/(mesh_.time().deltaT().value()*mesh_.V()); I'd really appreciate any help. Thankyou, Tom |
|
April 3, 2017, 03:45 |
|
#74 | |
New Member
Tinashe Mabikire
Join Date: Feb 2017
Posts: 4
Rep Power: 9 |
Quote:
Sent from my LG-H955 using CFD Online Forum mobile app |
||
April 3, 2017, 13:54 |
|
#75 | |
New Member
Tinashe Mabikire
Join Date: Feb 2017
Posts: 4
Rep Power: 9 |
Quote:
Sent from my LG-H955 using CFD Online Forum mobile app |
||
April 14, 2017, 03:30 |
|
#76 |
Member
AJAY BHANDARI
Join Date: Jul 2015
Location: INDIA
Posts: 57
Rep Power: 11 |
Hi houvy,
Exactly similar problem i am facing. DId you find solution of that. or somebody please tell me that by following the chalmers tutorial mentioned in above links how it can be upgraded to openFoam version 2.4.0 regarding particle injection. Or how to use swak4Foam to couple lagrangian with an eulerian solver. Any help will be appreciated. Best Ajay |
|
April 24, 2017, 14:10 |
cloud size=0??
|
#77 |
New Member
Laura Sumner
Join Date: Mar 2017
Posts: 13
Rep Power: 9 |
Hi All
I have followed the Chalmers tutorial to merge pimpleDyMFoam and solidParticle. I updated it to run on OF3.0.1 and it compiles fine. However when I run the simulation the Cloud Size=0. I havent looked into particle coupling yet, and have literally copied the tutorial, the only changes i made were syntax based due to running a different version. I also made sure that: label cellI=1; label tetFaceI=1; label tetPtI=1; in solidParticleCloud.C as this was advised on here somewhere. I thought it could be a problem within the particleProperties file but I dont know what the problem could be. Does the position of the particle need to be at a grid intersection? I made sure this was the case. Also I said my injection start time was 0 and end time was after one timestep. I have changed this a few times and it makes no difference. I really don't see why the particles aren't present, so if anyone has any tips that would be great! Laura |
|
April 24, 2017, 15:04 |
Injection function
|
#78 |
Member
Thomas Flint
Join Date: Jan 2016
Posts: 60
Rep Power: 10 |
Hi Laura,
What does your injection function look like, I don't have my laptop with me at the moment but that is where the particles are added if I remember correctly. I can send you all my solid particle files tomorrow when I get back into the fluids dungeon if you have t cracked it by then. Also are you calling the move/inject functions properly? I had an issue where I was injecting particles outside of the domain but that gave a segmentation fault so I don't think that is your issue. I suspect it's your injection function or a lack of a call to that function. All the best, Tom |
|
April 25, 2017, 09:11 |
|
#79 |
New Member
Laura Sumner
Join Date: Mar 2017
Posts: 13
Rep Power: 9 |
Hey Tom,
I think you are right in that the problem is the calling of the injection function. I have a line which says particles.move(g) in the main solver, but no corresponding particles.inject(??) i tried playing around with this but must admit i'm a newcomer to C++ and couldn't work out what the argument for the inject function should be, so decided to just ask on here! Something else: I had to use #include... for the C codes like solidParticle.C instead of adding to my options file, as this just did not work. Could this be an issue? I thought that if they are included in the main solver then they can be called without any problems. I have no compilation errors so figured this is fine. Thanks! Laura edit: also my inject function is: void Foam::solidParticleCloud::inject(solidParticle::tr ackingData &td) { label cellI=1; label tetFaceI=1; label tetPtI=1; mesh_.findCellFacePt(td.cloud().posP1_, cellI, tetFaceI, tetPtI); solidParticle* ptr1=new solidParticle(mesh_,td.cloud().posP1_,cellI,tetFac eI,tetPtI,td.cloud().dP1_,td.cloud().UP1_); Cloud<solidParticle>::addParticle(ptr1); mesh_.findCellFacePt(td.cloud().posP2_, cellI, tetFaceI, tetPtI); solidParticle* ptr2=new solidParticle(mesh_,td.cloud().posP2_,cellI,tetFac eI,tetPtI,td.cloud().dP2_,td.cloud().UP2_); Cloud<solidParticle>::addParticle(ptr2); } |
|
April 25, 2017, 09:31 |
|
#80 |
Member
Thomas Flint
Join Date: Jan 2016
Posts: 60
Rep Power: 10 |
Yes I think you should have:
-I$(LIB_SRC)/lagrangian/basic/lnInclude in your Make/options file under the EXE_INC=\ heading, its the last line in mine and then: -llagrangian \ -lsolidParticle \ in EXE_LIBS=\ Then if you have added all the SolidParticle* files that should be fine. Then the injection function is called from the move function. So in your SolidParticleCloud.H you should have: void inject(solidParticle::trackingData &td); in the member functions. Then in SolidParticleCloud.C the functions should be something like: Code:
void Foam::solidParticleCloud::move(const dimensionedVector& g) { const volScalarField& rho = mesh_.lookupObject<const volScalarField>("rho"); const volVectorField& U = mesh_.lookupObject<const volVectorField>("U"); const volScalarField& nu = mesh_.lookupObject<const volScalarField>("nu"); interpolationCellPoint<scalar> rhoInterp(rho); interpolationCellPoint<vector> UInterp(U); interpolationCellPoint<scalar> nuInterp(nu); smom_=vector::zero; solidParticle::trackingData td(*this, rhoInterp, UInterp, nuInterp, g.value()); Cloud<solidParticle>::move(td, mesh_.time().deltaTValue()); //if(mesh.time().value()>td.spc().tInjStart&&mesh.time().value()<td.spc().tInjEnd)//ORIGINAL //{ //this->inject(td); //} if(mesh_.time().value()>td.cloud().tInjStart_&&mesh_.time().value()<td.cloud().tInjEnd_) { this->inject(td); } } void Foam::solidParticleCloud::inject(solidParticle::trackingData &td)// THE PROBLEM WILL BE HERE { label celli=1; label tetFacei=1; label tetPtI=1; mesh_.findCellFacePt(td.cloud().posP1_, celli, tetFacei, tetPtI); solidParticle* pPtr1=new solidParticle(mesh_,td.cloud().posP1_,celli,tetFacei,tetPtI,td.cloud().dP1_,td.cloud().UP1_); Foam::Cloud<solidParticle>::addParticle(pPtr1); mesh_.findCellFacePt(td.cloud().posP2_, celli, tetFacei, tetPtI); solidParticle* pPtr2=new solidParticle(mesh_,td.cloud().posP2_,celli,tetFacei,tetPtI,td.cloud().dP2_,td.cloud().UP2_); Foam::Cloud<solidParticle>::addParticle(pPtr2); } |
|
Tags |
interfoam, lagrangian, move, solidparticle |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
lagrangian solid particle tracking - OFv2.1 | PelusDadidus | OpenFOAM Programming & Development | 7 | August 21, 2015 10:05 |
Questions regarding Particle Tracking and Rotating Frame of reference | Maxime Gauthier | CFX | 1 | May 9, 2011 16:07 |
DPM UDF particle position using the macro P_POS(p)[i] | dm2747 | FLUENT | 0 | April 17, 2009 02:29 |
Particle tracking - Domain interface / FrozenRotor | mohanrao | CFX | 4 | January 23, 2008 04:39 |
restarting lagrange (particle tracking) simulation | dbdias | CFX | 0 | September 22, 2007 20:26 |