|
[Sponsors] |
Fortran user: not able to figure out how not two points overlap in space |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 8, 2015, 09:57 |
Fortran user: not able to figure out how not two points overlap in space
|
#1 |
New Member
sARTHAK
Join Date: Dec 2015
Posts: 5
Rep Power: 10 |
Hi,
My goal is to Generate some random points in space which I have done. But I am not able to figure out how not two points overlap in space(mainly not two points should be in vicinity of other till raidus =1). How to do it !!! |
|
December 8, 2015, 16:42 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143 |
What are the points for? Monitor points? particle seed points? Something else?
|
|
December 9, 2015, 04:30 |
|
#3 |
New Member
sARTHAK
Join Date: Dec 2015
Posts: 5
Rep Power: 10 |
||
December 9, 2015, 05:40 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143 |
Are they seed points for a particle tracking model?
|
|
December 10, 2015, 05:10 |
|
#5 |
New Member
sARTHAK
Join Date: Dec 2015
Posts: 5
Rep Power: 10 |
I dont know what is Particle tracking model. I am trying to generate model in which I generate Random particle in confined space and then by some potential they interact,potential is only position dependent there should be a finite distance between every particles and that is 1 unit in any direction.
I dont know how to generate coordinates of Particles such that no two particles are in vicinity of each other. Please help |
|
December 10, 2015, 06:36 |
|
#6 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143 |
Some explanation of what you are doing would help.
Are you generating these points in the solver, post processor, a solid modelling package or the mesher? How do the points interact? Do they interact with a fluid? If so then how? |
|
December 10, 2015, 10:09 |
|
#7 |
New Member
sARTHAK
Join Date: Dec 2015
Posts: 5
Rep Power: 10 |
They are interacting via Lenard-Jones potential,with each Iteration there position is changed but with is the confined Volume !! Suppose it as like a gas molecules in box but here they interact with L-J potential.
|
|
December 10, 2015, 15:56 |
|
#8 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143 |
The L-J potential is an atomic scale effect. CFX cannot model atomic scale effects. It sounds like you are using the wrong software.
|
|
December 11, 2015, 07:35 |
|
#9 |
New Member
sARTHAK
Join Date: Dec 2015
Posts: 5
Rep Power: 10 |
I am writting CODE in fortran and then plot my points in gnuplot !!
And I think I know the solution now what you do is generate 1000 or whatever no of particles you want to generate and then calculate distance btw each pair and if it is less than your raidus of paricle or atom replace one of the particles one of the coordinate and it may happen now where you have putted your particle it is in vicinity of any other particle so again do the above thing untill tou find a place where there is no particle in its vicinity. here's my code for it !================================================= ===============================================! !========================ELIMINATING OVER LAPPING OF POINTS======================================! !================================================= ===============================================! subroutine Eliminate_overlap(n,x,y,z,sizee) implicit none integer::n real::x(n),y(n),z(n),sizee integer::i,j real::xr,yr,zr,dis integer::m do i=1,n-1 do j=i+1,n xr=(x(i)-x(j)) !Distance of ith particle from all particles in X direction yr=(y(i)-y(j)) !Distance of ith particle from all particles in Y direction zr=(z(i)-z(j)) !Distance of ith particle from all particles in Z direction dis=( ((xr)*(xr))+((yr)*(yr))+((zr)*(zr)) )**(0.5) if ((dis)>1) then else if ((dis)<=1) then call replace(i,j,x,y,z,n,sizee) end if end if end do end do return end subroutine subroutine replace(i,j,x,y,z,n,sizee) implicit none integer::n real::x(n),y(n),z(n),sizee integer::i,j REAL :: r CALL init_random_seed() CALL RANDOM_NUMBER(r) x(i)=(r*sizee) call Eliminate_overlap(n,x,y,z,sizee) return end subroutine !================================================= ===============================================! Thanks for you help bro/sis, if there is any problem in this algorithm please tell me. |
|
December 11, 2015, 16:46 |
|
#10 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,703
Rep Power: 143 |
If you are not using CFX then why are you posting on the CFX forum?
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
User fortran error when running CFX-10 in parallel | CFDworker | CFX | 3 | September 22, 2015 08:59 |
User Fortran - stack overflow problem | D.ko | CFX | 2 | November 12, 2013 05:56 |
User monitor points raw file | aerost | CFX | 1 | November 19, 2012 16:47 |
Can use PVM in User Fortran | LIU Yu | CFX | 0 | November 29, 2008 22:10 |
CFX11.0 cannot find dll in User Fortran | brunoc | CFX | 0 | April 4, 2007 10:42 |