Skip to content

avrachan1

Forum Replies Created

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • in reply to: Adding an arbitrary shaped particle. #8641
    avrachan1
    Participant

    Dear Jan,

    That works. My idea is to make the arbitrary shaped particle by adding cuboids of various sizes.

    Thanks.

    in reply to: Adding an arbitrary shaped particle. #8621
    avrachan1
    Participant

    Even if I try to create a simple shape composed of two overlapping spheres, I get the same error

    Vector<T,3> center(lengthX/2.,lengthY/2.,lengthZ/2.);
    442 std::shared_ptr<IndicatorSphere3D<T>> sphere1 ( new IndicatorSphere3D<T> (center,5*dx));
    443 center[0]=center[0]+5*dx;
    444 std::shared_ptr<IndicatorSphere3D<T>> sphere2 ( new IndicatorSphere3D<T> (center,5*dx));
    445 //IndicatorIdentity3D<T> combined(sphere1+sphere2);
    446 std::shared_ptr<IndicatorF3D<T>> cuboid2 = std::make_shared<IndicatorIdentity3D<T>>(sphere1+sphere2);
    447
    448 creators::addResolvedArbitraryShape3D(particleSystem,center,dx,cuboid2,2.*W0,1000.);

    What am I doing wrong ?

    PS: How do I paste code in the forum?

    • This reply was modified 1 week, 2 days ago by avrachan1.
    in reply to: Creating an IndicatorF from density #8574
    avrachan1
    Participant

    Dear Adrian,

    Thank you for your reply.

    I made the following class

    129 template <typename T, typename DESCRIPTOR>
    130 class myindicator : public SuperIndicatorF3D<T>
    131 {
    132 private :
    133 SuperLattice<T,DESCRIPTOR>& sLattice;
    134 public :
    135 myindicator(SuperLattice<T,DESCRIPTOR>& _sLattice, SuperGeometry<T,3>& superGeometry) : SuperIndicatorF3D<T>(superGeometry), sLattice(_sLattice)
    136 {
    137 ;
    138 this->getName() = “myindicator”;
    139 };
    140
    141 bool operator()(int iC,int iX,int iY,int iZ)
    142 {
    143 T phi=sLattice.getBlock(iC).get(iX,iY,iZ).computeRho();
    144 ;
    145 if(phi>0.5)
    146 return true;
    147 else
    148 return false;
    149 };
    150 };
    151

    What I need is an object of type IndicatorF3D to give as an argument for setResolvedArbitraryShape3D().

    Therefore I need to give (x,y,z) and get a true/false in return.

    But without the cuboid number, I cannot access the lattice site corresponding to (x,y,z).

    Am I understanding this correctly? How to go about this?

    Thanks again.

    PS: How do you paste code in this forum ?

    in reply to: Wall contact in particle simulation (dkt2d example) #8534
    avrachan1
    Participant

    Dear Jan,

    Thank you for your continued support.

    If I understand correctly, I have to loop over all particles and update the positions individually.

    in reply to: Wall contact in particle simulation (dkt2d example) #8502
    avrachan1
    Participant

    I have had to modify the code at two additional places. ( the last two arguments)

    processContacts<T, PARTICLETYPE, PARTICLECONTACTTYPE, WALLCONTACTTYPE, ContactProperties<T, 1>>(
    particleSystem, solidBoundaries, contactContainer, contactProperties,
    superGeometry, contactBoxResolutionPerDirection, static_cast<T>(4. / (3 * util::sqrt(M_PI))),periodicity_func<DESCRIPTOR::d>);

    coupleResolvedParticlesToLattice<T, DESCRIPTOR, PARTICLETYPE, PARTICLECONTACTTYPE, WALLCONTACTTYPE>(
    particleSystem, contactContainer, superGeometry, phaseField, converterPF, solidBoundaries, periodicity_func<DESCRIPTOR::d>);

    periodicity_func is a function which return (true,true,false) vector.

    With this the POROSITY fields behave correctly – it obeys the periodic boundary condition, however, the particle positions when accessed through particle.getField<GENERAL,POSITION> does not.

    I have gone through the code and I cannot figure out where the particle positions are updated according to the periodic boundary conditions.

    Any help in understanding this issue is appreciated.

    • This reply was modified 3 weeks, 2 days ago by avrachan1.
    in reply to: Wall contact in particle simulation (dkt2d example) #8501
    avrachan1
    Participant

    I am using

    Vector<T,3> periodicity(true,true,false);
    ParticleManager<T,DESCRIPTOR,PARTICLETYPE>particleManager(particleSystem,superGeometry,phaseField,converterPF,externalAcceleration,periodicity);

    in reply to: Wall contact in particle simulation (dkt2d example) #8500
    avrachan1
    Participant

    Dear Jan,

    Why doesn’t the particles obey the periodic boundary condition ?

    I can’t seem to find it anywhere in the documentation.

    Thanks.

    in reply to: Wall contact in particle simulation (dkt2d example) #8476
    avrachan1
    Participant

    Dear Jan,

    Thanks for the explanation. I understand it now.

    in reply to: An issue when running parallel simulations #8411
    avrachan1
    Participant

    Sorry my mistake,

    SuperLatticeField3D <T,DESCRIPTOR,POPULATION> populationPF(A);

    followed by

    B.definePopulations(bulkIndicator,populationPF);

    leads to the error.

    in reply to: An issue when running parallel simulations #8409
    avrachan1
    Participant

    Dear Adrian,

    Thanks!

    When I replace

    B.definePopulations(bulkIndicator,analyticalFpopA);
    with
    B.definePopulations(bulkIndicator,populationPF);
    I am getting errors, what is the correct way to define populations directly from SuperF ?

    ####################

    1 olb-1.6r0/src/core/blockLattice.hh:142:9: error: no matching function for call to object of type ‘BlockF<double, D2Q5<>::d>’ (aka ‘olb::BlockF2D<double>’)
    2 popF(pop, loc);
    3 ^~~~
    4 olb-1.6r0/src/core/superLattice.hh:321:17: note: in instantiation of member function ‘olb::BlockLattice<double, olb::descriptors::D2Q5<>>::definePopulations’ requested here
    5 _block[iC]->definePopulations(indicator->getBlockIndicatorF(iC), Pop.getBlockF(iC));
    6 ^
    7 error.cpp:175:4: note: in instantiation of member function ‘olb::SuperLattice<double, olb::descriptors::D2Q5<>>::definePopulations’ requested here
    8 B.definePopulations(bulkIndicator,populationPF);
    9 ^
    10 olb-1.6r0/src/functors/genericF.h:81:16: note: candidate function not viable: no known conversion from ‘LatticeR<D2Q5<>::d>’ (aka ‘Vector<int, 2U>’) to ‘const int *’ for 2nd argument
    11 virtual bool operator() (T output[], const S input[])=0;
    12 ^
    13 olb-1.6r0/src/functors/genericF.h:87:8: note: candidate function not viable: no known conversion from ‘LatticeR<D2Q5<>::d>’ (aka ‘Vector<int, 2U>’) to ‘int’ for 2nd argument
    14 bool operator() (T output[], S input0);
    15 ^
    16 olb-1.6r0/src/functors/genericF.h:86:8: note: candidate function not viable: requires single argument ‘output’, but 2 arguments were provided
    17 bool operator() (T output[]);
    18 ^
    19 olb-1.6r0/src/functors/genericF.h:88:8: note: candidate function not viable: requires 3 arguments, but 2 were provided
    20 bool operator() (T output[], S input0, S input1);
    21 ^
    22 olb-1.6r0/src/functors/genericF.h:89:8: note: candidate function not viable: requires 4 arguments, but 2 were provided
    23 bool operator() (T output[], S input0, S input1, S input2);
    24 ^
    25 olb-1.6r0/src/functors/genericF.h:90:8: note: candidate function not viable: requires 5 arguments, but 2 were provided
    26 bool operator() (T output[], S input0, S input1, S input2, S input3);
    27 ^
    28 2 warnings and 1 error generated.
    29 make: *** [error.o] Error 1
    30

    in reply to: An issue when running parallel simulations #8318
    avrachan1
    Participant

    Hi Adrian,

    Thanks for the reply.

    I am aware that it interpolates values, but I could not find an alternate way to define populations on the new lattice. It would be great if you can describe it!

    Also if you can elaborate on what does “communicate-to-all” mode does here?

    Thanks!

    in reply to: An issue when running parallel simulations #8316
    avrachan1
    Participant

    I think I have identified the issue to be

    AnalyticalFfromSuperF3D <T> analyticalFpopA(populationA,true,true);

    I get the correct results when I used

    AnalyticalFfromSuperF3D <T> analyticalFpopA(populationA);

    in reply to: Getting velocity distributions. #8104
    avrachan1
    Participant

    got it!

    You can edit the populations at each cell using,

    sLattice.definePopulations(…);

Viewing 13 posts - 1 through 13 (of 13 total)