vishwesh |
November 3, 2017 02:31 |
Quote:
Originally Posted by vishwesh
(Post 670228)
Hi!
Sorry for jumping in the discussion. I am also working on something similar based on Aurelia's work. I have modified the inject and move functions though.
Instead of reading the positions, diameter, and velocity of Bubbles from particleProperties, I send them from interFoam as follows:
Code:
Info<< "Evolving cloud" << endl;
Info<<"g: " << g << " posP: " << posP << " dP: " << dP << " UP: " << UP << endl;
particles.move(g,posP,dP,UP);
Info<< "Cloud size = " << particles.size() << endl;
Code:
// Inject Function:
void Foam::solidParticleCloud::inject(solidParticle::trackingData &td, vector posP, scalar dP, vector UP)
{
Info<<"Inject function called"<<endl;
label cellI=1;
label tetFaceI=1;
label tetPtI=1;
Info<<"findCellFacePt starting"<<endl;
mesh_.findCellFacePt(posP, cellI, tetFaceI, tetPtI);
Info<<"findCellFacePt ended"<<endl;
Info<<"Adding a new particle"<<endl;
solidParticle* ptr1 = new solidParticle(mesh_, posP, cellI, tetFaceI, tetPtI, dP, UP);
Info<<"New particle added"<<endl;
Info<<"Initial equilibrium radius"<<endl;
ptr1->initialEquilibriumRadius(td);
Info<<"Finally add particle"<<endl;
Cloud<solidParticle>::addParticle(ptr1);
}
Code:
void Foam::solidParticleCloud::move(const dimensionedVector& g, vector posP, scalar dP, vector UP)
{
Info<<"Move function called"<<endl;
const volScalarField& rho = mesh_.lookupObject<const volScalarField>("rho");
const volVectorField& U = mesh_.lookupObject<const volVectorField>("U");
const volScalarField& nu = mesh_.lookupObject<const volScalarField>("nu");
const volScalarField& alphaW =
mesh_.lookupObject<const volScalarField>("alpha.water");
const volScalarField& p = mesh_.lookupObject<const volScalarField>("p");
interpolationCellPoint<scalar> rhoInterp(rho);
interpolationCellPoint<vector> UInterp(U);
interpolationCellPoint<scalar> nuInterp(nu);
interpolationCell<scalar> alphaWInterp(alphaW);
interpolationCellPoint<scalar> pInterp(p);
smom_ = vector::zero;
correctalphaW_=0;
correctU_=vector::zero;
solidParticle::trackingData
td(*this, rhoInterp, UInterp, nuInterp, alphaWInterp, pInterp, g.value());
Cloud<solidParticle>::move(td, mesh_.time().deltaTValue());
// Inject
this->inject(td, posP, dP, UP);
}
My solver is compiling successfully, but when I run it, this is what I get:
Code:
Evolving cloud
g: g [0 1 -2 0 0 0 0] (0 -9.81 0) posP: (0.00407471 0.00956261 -0.00510405) dP: 2 UP: (0 0 0)
Move function called
Inject function called
findCellFacePt starting
[1] #0 Foam::error::printStack(Foam::Ostream&)findCellFacePt ended
Adding a new particle
New particle added
Initial equilibrium radius
Finally add particle
Cloud size = 1
ExecutionTime = 314.7 s ClockTime = 315 s
in "/share/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt64Opt/lib/libOpenFOAM.so"
[1] #1 Foam::sigSegv::sigHandler(int) in "/share/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt64Opt/lib/libOpenFOAM.so"
[1] #2 ? at sigaction.c:0
[1] #3 Foam::polyMeshTetDecomposition::cellTetIndices(Foam::polyMesh const&, long) in "/share/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt64Opt/lib/libOpenFOAM.so"
[1] #4 Foam::cellPointWeight::findTetrahedron(Foam::polyMesh const&, Foam::Vector<double> const&, long) in "/share/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt64Opt/lib/libfiniteVolume.so"
[1] #5 Foam::cellPointWeight::cellPointWeight(Foam::polyMesh const&, Foam::Vector<double> const&, long, long) in "/share/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt64Opt/lib/libfiniteVolume.so"
[1] #6 ? in "/home/vshrima/OpenFOAM/vshrima-3.0.x/platforms/linux64GccDPInt64Opt/bin/VOF2LPT_basic_revised"
[1] #7 ? in "/home/vshrima/OpenFOAM/vshrima-3.0.x/platforms/linux64GccDPInt64Opt/bin/VOF2LPT_basic_revised"
[1] #8 ? in "/home/vshrima/OpenFOAM/vshrima-3.0.x/platforms/linux64GccDPInt64Opt/bin/VOF2LPT_basic_revised"
[1] #9 ? in "/home/vshrima/OpenFOAM/vshrima-3.0.x/platforms/linux64GccDPInt64Opt/bin/VOF2LPT_basic_revised"
[1] #10 __libc_start_main in "/lib64/libc.so.6"
[1] #11 ? in "/home/vshrima/OpenFOAM/vshrima-3.0.x/platforms/linux64GccDPInt64Opt/bin/VOF2LPT_basic_revised"
[cgscd000ggb3t92:38581] *** Process received signal ***
[cgscd000ggb3t92:38581] Signal: Segmentation fault (11)
[cgscd000ggb3t92:38581] Signal code: (-6)
[cgscd000ggb3t92:38581] Failing at address: 0x11e7d000096b5
[cgscd000ggb3t92:38581] [ 0] /lib64/libc.so.6[0x3eb7c32510]
[cgscd000ggb3t92:38581] [ 1] /lib64/libc.so.6(gsignal+0x35)[0x3eb7c32495]
[cgscd000ggb3t92:38581] [ 2] /lib64/libc.so.6[0x3eb7c32510]
[cgscd000ggb3t92:38581] [ 3] /share/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt64Opt/lib/libOpenFOAM.so(_ZN4Foam24polyMeshTetDecomposition14cellTetIndicesERKNS_8polyMeshEl+0x60)[0x7f5fb43689a0]
[cgscd000ggb3t92:38581] [ 4] /share/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt64Opt/lib/libfiniteVolume.so(_ZN4Foam15cellPointWeight15findTetrahedronERKNS_8polyMeshERKNS_6VectorIdEEl+0x52)[0x7f5fb63a6052]
[cgscd000ggb3t92:38581] [ 5] /share/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt64Opt/lib/libfiniteVolume.so(_ZN4Foam15cellPointWeightC2ERKNS_8polyMeshERKNS_6VectorIdEEll+0x89)[0x7f5fb63a77a9]
[cgscd000ggb3t92:38581] [ 6] VOF2LPT_basic_revised[0x4d7c0d]
[cgscd000ggb3t92:38581] [ 7] VOF2LPT_basic_revised[0x4e4204]
[cgscd000ggb3t92:38581] [ 8] VOF2LPT_basic_revised[0x4e622e]
[cgscd000ggb3t92:38581] [ 9] VOF2LPT_basic_revised[0x447e21]
[cgscd000ggb3t92:38581] [10] /lib64/libc.so.6(__libc_start_main+0xfd)[0x3eb7c1ed1d]
[cgscd000ggb3t92:38581] [11] VOF2LPT_basic_revised[0x43a759]
[cgscd000ggb3t92:38581] *** End of error message ***
--------------------------------------------------------------------------
mpirun noticed that process rank 1 with PID 38581 on node cgscd000ggb3t92 exited on signal 11 (Segmentation fault).
--------------------------------------------------------------------------
So as you can see, the position, diameter, velocity etc. being supplied to the move and inject functions are correct. Also, the findCellFacePt is being called properly. I guess there is some problem in the implementation of findCellFacePt only.
Can anyone please help me out with this?
|
I modified my code slightly:
Code:
/ Inject Function:
void Foam::solidParticleCloud::inject(solidParticle::trackingData &td, vector posP, scalar dP, vector UP)
{
Info<<"Inject function called"<<endl;
label cellI=1;
label tetFaceI=1;
label tetPtI=1;
Info<<"findCellFacePt starting"<<endl;
cellI = mesh_.findCell(posP);
Info<<"cellI: "<<cellI<<endl;
//mesh_.findCellFacePt(td.cloud().posP1_, cellI, tetFaceI, tetPtI);
mesh_.findCellFacePt(posP, cellI, tetFaceI, tetPtI);
Info<<"findCellFacePt ended"<<endl;
//solidParticle* ptr1 = new solidParticle(mesh_, td.cloud().posP1_, cellI,
// tetFaceI, tetPtI,td.cloud().dP1_, td.cloud().UP1_);
Info<<"Adding a new particle"<<endl;
solidParticle* ptr1 = new solidParticle(mesh_, posP, cellI, tetFaceI, tetPtI, dP, UP);
Info<<"New particle added"<<endl;
Info<<"Initial equilibrium radius"<<endl;
ptr1->initialEquilibriumRadius(td);
Info<<"Finally add particle"<<endl;
Cloud<solidParticle>::addParticle(ptr1);
/* mesh_.findCellFacePt(td.cloud().posP2_, cellI, tetFaceI, tetPtI);
solidParticle* ptr2 = new solidParticle(mesh_, td.cloud().posP2_, cellI,
tetFaceI, tetPtI, td.cloud().dP2_, td.cloud().UP2_);
ptr2->initialEquilibriumRadius(td);
Cloud<solidParticle>::addParticle(ptr2);
*/
}
Here are the revised results:
Code:
Evolving cloud
g: g [0 1 -2 0 0 0 0] (0 -9.81 0) posP: (0.00407471 0.00956261 -0.00510405) dP: 2 UP: (0 0 0)
Move function called
Inject function called
findCellFacePt starting
cellI: 1028095
findCellFacePt ended
Adding a new particle
New particle added
Initial equilibrium radius
Finally add particle
Cloud size = 1
ExecutionTime = 309.6 s ClockTime = 310 s
[1] #0 Foam::error::printStack(Foam::Ostream&) in "/share/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt64Opt/lib/libOpenFOAM.so"
[1] #1 Foam::sigSegv::sigHandler(int) in "/share/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt64Opt/lib/libOpenFOAM.so"
[1] #2 ? at sigaction.c:0
[1] #3 Foam::polyMeshTetDecomposition::cellTetIndices(Foam::polyMesh const&, long) in "/share/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt64Opt/lib/libOpenFOAM.so"
[1] #4 Foam::cellPointWeight::findTetrahedron(Foam::polyMesh const&, Foam::Vector<double> const&, long) in "/share/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt64Opt/lib/libfiniteVolume.so"
[1] #5 Foam::cellPointWeight::cellPointWeight(Foam::polyMesh const&, Foam::Vector<double> const&, long, long) in "/share/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt64Opt/lib/libfiniteVolume.so"
[1] #6 ? in "/home/vshrima/OpenFOAM/vshrima-3.0.x/platforms/linux64GccDPInt64Opt/bin/VOF2LPT_basic_revised"
[1] #7 ? in "/home/vshrima/OpenFOAM/vshrima-3.0.x/platforms/linux64GccDPInt64Opt/bin/VOF2LPT_basic_revised"
[1] #8 ? in "/home/vshrima/OpenFOAM/vshrima-3.0.x/platforms/linux64GccDPInt64Opt/bin/VOF2LPT_basic_revised"
[1] #9 ? in "/home/vshrima/OpenFOAM/vshrima-3.0.x/platforms/linux64GccDPInt64Opt/bin/VOF2LPT_basic_revised"
[1] #10 __libc_start_main in "/lib64/libc.so.6"
[1] #11 ? in "/home/vshrima/OpenFOAM/vshrima-3.0.x/platforms/linux64GccDPInt64Opt/bin/VOF2LPT_basic_revised"
[cgscd000ggb3t92:40309] *** Process received signal ***
[cgscd000ggb3t92:40309] Signal: Segmentation fault (11)
[cgscd000ggb3t92:40309] Signal code: (-6)
[cgscd000ggb3t92:40309] Failing at address: 0x11e7d00009d75
[cgscd000ggb3t92:40309] [ 0] /lib64/libc.so.6[0x3eb7c32510]
[cgscd000ggb3t92:40309] [ 1] /lib64/libc.so.6(gsignal+0x35)[0x3eb7c32495]
[cgscd000ggb3t92:40309] [ 2] /lib64/libc.so.6[0x3eb7c32510]
[cgscd000ggb3t92:40309] [ 3] /share/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt64Opt/lib/libOpenFOAM.so(_ZN4Foam24polyMeshTetDecomposition14cellTetIndicesERKNS_8polyMeshEl+0x60)[0x7fc57b9379a0]
[cgscd000ggb3t92:40309] [ 4] /share/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt64Opt/lib/libfiniteVolume.so(_ZN4Foam15cellPointWeight15findTetrahedronERKNS_8polyMeshERKNS_6VectorIdEEl+0x52)[0x7fc57d975052]
[cgscd000ggb3t92:40309] [ 5] /share/OpenFOAM/OpenFOAM-3.0.x/platforms/linux64GccDPInt64Opt/lib/libfiniteVolume.so(_ZN4Foam15cellPointWeightC2ERKNS_8polyMeshERKNS_6VectorIdEEll+0x89)[0x7fc57d9767a9]
[cgscd000ggb3t92:40309] [ 6] VOF2LPT_basic_revised[0x4d7c9d]
[cgscd000ggb3t92:40309] [ 7] VOF2LPT_basic_revised[0x4e42de]
[cgscd000ggb3t92:40309] [ 8] VOF2LPT_basic_revised[0x4e63ad]
[cgscd000ggb3t92:40309] [ 9] VOF2LPT_basic_revised[0x447eb1]
[cgscd000ggb3t92:40309] [10] /lib64/libc.so.6(__libc_start_main+0xfd)[0x3eb7c1ed1d]
[cgscd000ggb3t92:40309] [11] VOF2LPT_basic_revised[0x43a7e9]
[cgscd000ggb3t92:40309] *** End of error message ***
--------------------------------------------------------------------------
mpirun noticed that process rank 1 with PID 40309 on node cgscd000ggb3t92 exited on signal 11 (Segmentation fault).
--------------------------------------------------------------------------
|