CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Creating New Solver: For particle-laden compressible jets (http://www.cfd-online.com/Forums/openfoam-solving/74625-creating-new-solver-particle-laden-compressible-jets.html)

sankarv April 5, 2010 07:03

Creating New Solver: For particle-laden compressible jets
 
1 Attachment(s)
Hello OpenFoamers

I am a new user of OpenFoam and I am trying to set-up a particle-laden
under-expanded supersonic jet issuing into an open atmosphere.
Note, before I started OpenFoam, I ran fluent and got a converged
solution for this problem

Here are details of OpenFoam simulation:
---------------------------------------
Solver: rhoCentralFoam
Grid: axi-symmetric grid imported from Fluent using fluentMeshtoFoam
I.C: I used the converged Fluent solution as initial condition for openFoam
I managed to get a converged steady state solution for this
problem without particles


Particle laden jets:
!----------------------------------
Now I am trying to run a particle-laden jets. Since the solver
rhoCentralFoam does not have Lagrangian Particle Tracking in it, I realized
that I have to create a new solver.
I came across the icoLagrangianFoam solver which is basically a particle
tracking solver for an incompressible flow.

I found a nice tutorial "Tutorial icoLagrangianFoam/SolidParticle" by Auerlia Vallier
(google for file name: Tutorial_icoLagrangianFoam_reviewed.pdf).
I used that and managed to implement particle tracking
in the rhoCentralFoam solver (which is a compressible solver).
I called this new solver rhoCentralParticleFoam

This works well. But the problem is that the drag model in the original
icoLagrangianFoam is a very simple constant drag model.
I want to implement the standard drag model which is a function of
particle Reynolds number based on the stokesian drag for spherical particles.

Chapter 5 in the tutorial (Tutorial_icoLagrangianFoam_reviewed.pdf)describes how to implement this drag model.
When I did these changes I get some compilation errors that I cannot comprehend. I admit that I don't know c++ and I am not able to figure out the exact problem.

Can someone help me to fix these compilation errors ?
I have attached a tar file which contains the codes I am using for
this solver. If you just compile this code, you will be able to reproduce the
errors. Please help.

Thanks
Vaidya

matejfor April 6, 2010 03:39

Dear sankarv,

you did not specify the version of openfoam you are using, so I'm not sure I do have the same compilation errors, but it is not that hard to read them. For example, during my compilation (with OF 1.6) I got this error in compiler output:
IncompressibleCloud.C:118: error: no matching function for call to ' here's the function'
candidates are: ' candidates functions'.
It's most common compilation error I met, where I'm calling wrong number or wrong type of arguments. What you need to do is to look at the candidates (there may be more of them due to function overloading) and see what's wrong with your function parameters. Until you solve first error in output there's no reason to look for others.
Sorry I do not have an answer to your compilation error.

There's another question you may have consider. You have compressible flow, there is heat transfer, I guess, do the particles take part in that? If so, there might be a more clever way of implementing lagrangian particles into foam. It's the intermediate lagrangian class, which is quite versatile, for example drag calculation. You find it in $FOAM/src/lagrangian/intermediate and tutorial in FOAM/tutorial/lagrangian/rhoPisoTwinParcelFoam.
You will find there solver and tutorial with 2 clouds. One is kinematic, one is thermo (can do all the kinematic magic + heat transfer).


hope this helps

matej

sankarv April 6, 2010 05:32

Dear Mr. Matej

Thank you very much for your reply. I am using version 1.5.x

I will look into the first compilation error today.

About your question on particles and heat transfer, I am not interested in the heat transfer to the particles. These are inert particles. I am only interested in using the correct drag models with 2 way coupling (from gas phase to particle phase and vice versa).

I will look into the rhoPisoTwinParcelFoam solver today.
Does this solver has injector ?

I will let you know when I make some progress

Thanks again
Vaidya

alberto April 6, 2010 15:58

Hello,

Matej's suggestion is correct and will save you some time because the drag laws are already implemented in kinematicCloud.
The Lagrangian stack has been improved significantly in OF 1.5 and 1.6, making it easier to use with respect to what done in the original icoLagrangianFoam.

You can select the InjectionModel ( http://foam.sourceforge.net/doc/Doxy...tionModel.html ) too (see the tutorial simplifiedSiwek, in kinematicCloud1Properties).

Best,

sankarv April 7, 2010 12:23

Deat Matej & Alberto

Thank you very much for your suggestions. As per your recommendation, I used the lagrangian/intermediate cloud class and the it seems to be working well.

I have a question about the injectionModel.

In the kinematicCloudProperties, I could set ManualInjection or Coneinjection.
ManualInjection, injects at only one instant (SOI) and then just evolves the particles. On the other hand coneinjector injects in a cone based on flow rate starting from an instant (SOI) for a certain "duration".

For my problem, the particles are coming from a jet inlet, i,e they are released along the entire inlet patch, not just in a cone like in the coneinjector. They are also released continuously not just at one instant

Can you tell me how I can do this ?

Thanks
Vaidya

alberto April 7, 2010 12:46

There is a patchInjection (check the doxygen link above).

Best,

mihir1310 April 7, 2010 14:48

Sankarv



have you implemented the intermediate class in Rhocentral ? Could you share the file with me . Ive been trying to implement a lagrangian model since long and getting the same compiling error you posted. I havent been able to add the solidparticle class due to some issues with the Make folder :http://www.cfd-online.com/Forums/ope...-new-post.html . Maybe your help will save me some time and will be appreciated .

sankarv April 7, 2010 15:21

1 Attachment(s)
mihir,

Here it is ..Hope it helps.

V

sankarv April 10, 2010 19:50

Alberto

Does the patchinjection work with OpenFoam 1.5.x

(1) I downloaded the patchInjection.C and patchInjection.H
(2) I created a new directory PatchInjection in src/lagrangian/intermediate/submodel/Kinematic/InjectionModel/
(3) I placed the files patchInjection.C and patchInjection.H in the diretory PatchInjection
(4) I added the following lines in the code
src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/makeBasicKinematicParcelInjectionModels.C

#include "PatchInjection.H"

makeInjectionModelType
(
PatchInjection,
KinematicCloud,
basicKinematicParcel
);

(5) I made the same changes in the codes
src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelInjectionModels.C
src/lagrangian/intermediate/parcels/derived/basicThermoParcel/makeBasicThermoParcelInjectionModels.C

From /src/lagrandian directory, I compiled using Allwmake

(6) I get the following compilation error

lnInclude/PatchInjection.C: In instantiation of ‘Foam::PatchInjection<Foam::KinematicCloud<Foam::b asicKinematicParcel> >’:
parcels/derived/basicKinematicParcel/makeBasicKinematicParcelInjectionModels.C:57: instantiated from here
lnInclude/PatchInjection.C:182: error: no type named ‘parcelType’ in ‘class Foam::KinematicCloud<Foam::basicKinematicParcel>’
lnInclude/InjectionModel.H: In static member function ‘static Foam::autoPtr<Foam::InjectionModel<CloudType> > Foam::InjectionModel<CloudType>::adddictionaryCons tructorToTable<InjectionModelType>::New(const Foam::dictionary&, CloudType&) [with InjectionModelType = Foam::PatchInjection<Foam::KinematicCloud<Foam::ba sicKinematicParcel> >, CloudType = Foam::KinematicCloud<Foam::basicKinematicParcel>]’:
lnInclude/InjectionModel.H:129: instantiated from ‘Foam::InjectionModel<CloudType>::adddictionaryCon structorToTable<InjectionModelType>::adddictionary ConstructorToTable(const Foam::word&) [with InjectionModelType = Foam::PatchInjection<Foam::KinematicCloud<Foam::ba sicKinematicParcel> >, CloudType = Foam::KinematicCloud<Foam::basicKinematicParcel>]’
parcels/derived/basicKinematicParcel/makeBasicKinematicParcelInjectionModels.C:62: instantiated from here
lnInclude/InjectionModel.H:119: error: cannot allocate an object of abstract type ‘Foam::PatchInjection<Foam::KinematicCloud<Foam::b asicKinematicParcel> >’
lnInclude/PatchInjection.H:68: note: because the following virtual functions are pure within ‘Foam::PatchInjection<Foam::KinematicCloud<Foam::b asicKinematicParcel> >’:
lnInclude/InjectionModel.H:103: note: Foam::label Foam::InjectionModel<CloudType>::nParcelsToInject( Foam::scalar, Foam::scalar) const [with CloudType = Foam::KinematicCloud<Foam::basicKinematicParcel>]
lnInclude/InjectionModel.H:217: note: Foam::vector Foam::InjectionModel<CloudType>::position(Foam::la bel, Foam::scalar, const Foam::polyMeshInfo&) [with CloudType = Foam::KinematicCloud<Foam::basicKinematicParcel>]
lnInclude/InjectionModel.H:225: note: Foam::vector Foam::InjectionModel<CloudType>::velocity(Foam::la bel, Foam::scalar, const Foam::polyMeshInfo&) [with CloudType = Foam::KinematicCloud<Foam::basicKinematicParcel>]
lnInclude/InjectionModel.H:232: note: Foam::scalar Foam::InjectionModel<CloudType>::d0(Foam::label, Foam::scalar) const [with CloudType = Foam::KinematicCloud<Foam::basicKinematicParcel>]
make: *** [Make/linux64GccDPOpt/makeBasicKinematicParcelInjectionModels.o] Error 1


I cannot figure out the issue. Can someone help ?
Alberto, do you have any idea ?

Thanks
Vaidya

alberto April 11, 2010 00:22

Quote:

Originally Posted by sankarv (Post 254113)
Alberto

Does the patchinjection work with OpenFoam 1.5.x

It was introduced in the 1.6 release.

Best,

matejfor April 11, 2010 01:09

This will not work. You have to download 1.6. There were some changes like redefinition of lagrangian particles, where parcelType and ID were defined. You would need to reprogram the whole lagrangian class. It's much easier to download 1.6 version.

good luck
matej

sankarv April 17, 2010 14:46

Patch Injection questions
 
Dear matej / alberto

I installed 1.6.x and and I now have a solver for running lagrangian particles in a compressible flow.

I am little confused about the inputs for patch injection
In the file constant/kinematicCloud1Properties

PatchInjectionCoeffs
{
massTotal massTotal [ 1 0 0 0 0] 2.0e-4;
patchName Jet_inlet;
parcelBasisType mass ;
parcelsPerSecond 100000000;
SOI 0.000257;
duration 0.005;
volumeFlowRate constant 0.01;
U0 (100.0 0 0);
parcelPDF
{
pdfType RosinRammler;
RosinRammlerPDF
{
minValue 10.0e-06;
maxValue 100.0e-06;
d (45.0e-06);
n (0.5);
}
}
}

what does the following keywords mean ?
(1) massTotal
(2) parcelBasisType mass ;
(3) parcelsPerSecond
(4) volumeFlowRate

I understand that massTotal is the total mass injected between SOI and SOI + duration. Similarly volume flow rate is the volume of liquid flow rate.
What does the other 2 keywords mean ?

Can you please explain ?

Thanks
Vaidya

matejfor April 19, 2010 03:18

Hi,

good to hear thinks are working.
now to understand what the parameters means you better start to read the source code using doxygen.
To find more, look here: http://foam.sourceforge.net/doc/Doxy...tionModel.html

and here: http://foam.sourceforge.net/doc/Doxy...Injection.html


good look/luck

matej

statesman August 30, 2010 13:06

Sanrakv

I managed to add intermediate class to rhoCentralFoam in 1.5 , the way you have done in rhoCentralLagintFoam.

Howvwer I havent been succeffsul in compiling the same in 1.6 . I received the following compile error :

Quote:

Making dependency list for source file rhoCentralFoam.C
could not open file meshTools.H for source file rhoCentralFoam.C
could not open file readEnvironmentalProperties.H for source file rhoCentralFoam.C
SOURCE=rhoCentralFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/basic/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/basic/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/specie/lnInclude -IBCs/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/thermophysicalModels/radiation/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/sampling/lnInclude -IlnInclude -I. -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/usr/local/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/rhoCentralFoam.o
In file included from /usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/InjectionModel.H:363,
from /usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/KinematicCloud.C:33,
from /usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/KinematicCloud.H:381,
from /usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/basicKinematicCloud.H:39,
from rhoCentralFoam.C:39:
/usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/InjectionModel.C:29:23: error: meshTools.H: No such file or directory
rhoCentralFoam.C:50:55: error: readEnvironmentalProperties.H: No such file or directory
In file included from /usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/InjectionModel.H:363,
from /usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/KinematicCloud.C:33,
from /usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/KinematicCloud.H:381,
from /usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/basicKinematicCloud.H:39,
from rhoCentralFoam.C:39:
/usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/InjectionModel.C: In member function ‘void Foam::InjectionModel<CloudType>::inject(TrackData& )’:
/usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/InjectionModel.C:393: error: ‘meshTools’ has not been declared
/usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/InjectionModel.C:405: error: ‘meshTools’ has not been declared
In file included from /usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/KinematicParcel.H:551,
from /usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/basicKinematicParcel.H:39,
from /usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/basicKinematicCloud.H:40,
from rhoCentralFoam.C:39:
/usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/KinematicParcel.C: In member function ‘const Foam::vector Foam::KinematicParcel<ParcelType>::calcVelocity(Tr ackData&, Foam::scalar, Foam::label, Foam::scalar, const Foam::vector&, Foam::scalar, Foam::scalar, const Foam::vector&, Foam::vector&) const’:
/usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/KinematicParcel.C:179: error: ‘meshTools’ has not been declared
/usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/KinematicParcel.C:180: error: ‘meshTools’ has not been declared
/usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/KinematicParcel.C: In member function ‘bool Foam::KinematicParcel<ParcelType>::move(TrackData& )’:
/usr/local/OpenFOAM/OpenFOAM-1.6/src/lagrangian/intermediate/lnInclude/KinematicParcel.C:229: error: ‘meshTools’ has not been declared
rhoCentralFoam.C: In function ‘int main(int, char**)’:
rhoCentralFoam.C:150: error: ‘kinematicCloud1’ was not declared in this scope
/usr/local/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readTimeControls.H:40: warning: unused variable ‘maxCo’
/usr/local/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readTimeControls.H:43: warning: unused variable ‘maxDeltaT’
make: *** [Make/linux64GccDPOpt/rhoCentralFoam.o] Error 1

Could you please share your experience with compiling rhoCentralLagintfoam in 1.6 ?

sankarv September 1, 2010 17:03

I am not familiar with c++. So I am not sure how much I could help you with this. But by looking at the error message you posted, it looks like you are not including meshTools.h and reaEnvironmentalProperties.h in the options file of the make directory.

Please check that and see how if you can get it compiled

statesman September 1, 2010 17:07

Hey thanx

I actually solved the problem . You are right about the two files. I already included the "meshtools " directory . INstead of "readEnvironmentalProperties" , 1.6 invovled "readGravitationalAcceleration" . My code compiled smoothly.


May I know which drag law are you using ? I am trying to compile a drag law based on the mean free path , which needs P , T variables. Do you know if i have to change arguments of the kinematic cloud ?

sankarv September 1, 2010 17:25

Stateman,

Good to know that you solved the problem.
I think I used the spherical drag law. I did not change the arguments of the kinematic cloud for this law..

Quote:

Originally Posted by statesman (Post 273652)
Hey thanx

I actually solved the problem . You are right about the two files. I already included the "meshtools " directory . INstead of "readEnvironmentalProperties" , 1.6 invovled "readGravitationalAcceleration" . My code compiled smoothly.


May I know which drag law are you using ? I am trying to compile a drag law based on the mean free path , which needs P , T variables. Do you know if i have to change arguments of the kinematic cloud ?


P Sharma December 3, 2014 20:41

hi everyone,
I need to compile risingBubbleInterFoam but i got following error. Anyone know about that?



SOURCE=risingBubbleInterFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/prandtl/OpenFOAM/OpenFOAM-2.3.0/src/transportModels -I/home/prandtl/OpenFOAM/OpenFOAM-2.3.0/src/transportModels/incompressible/lnInclude -I/home/prandtl/OpenFOAM/OpenFOAM-2.3.0/src/transportModels/interfaceProperties/lnInclude -I/home/prandtl/OpenFOAM/OpenFOAM-2.3.0/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/prandtl/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude -I/home/prandtl/OpenFOAM/OpenFOAM-2.3.0/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/risingBubbleInterFoam.o
risingBubbleInterFoam.C:57:45: fatal error: readEnvironmentalProperties.H: No such file or directory
#include "readEnvironmentalProperties.H"
^
compilation terminated.
make: *** [Make/linux64GccDPOpt/risingBubbleInterFoam.o] Error 1


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