You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
ΑΝΑΠΤΥΞΗ ΚΩ∆ΙΚΑ ΜΟΡΙΑΚΗΣ ∆ΥΝΑΜΙΚΗΣ<br />
242<br />
}<br />
else if (x > xBoundaryEnd)<br />
{<br />
result = xBoundaryStart + ((Math.abs(x - xBoundaryEnd)) % xBoundarySize);<br />
}<br />
return result;<br />
}<br />
public double yBoundary(double y)<br />
{<br />
double result = y;<br />
if (y < yBoundaryStart)<br />
{<br />
result = yBoundaryEnd - ((Math.abs(yBoundaryStart - y)) % yBoundarySize);<br />
}<br />
else if (y > yBoundaryEnd)<br />
{<br />
result = yBoundaryStart + ((Math.abs(y - yBoundaryEnd)) % yBoundarySize);<br />
}<br />
return result;<br />
}<br />
public double zBoundary(double z)<br />
{<br />
//special conditions apply here:<br />
// z bottom is reflecting<br />
double result = z;<br />
if (z > zBoundaryEnd)<br />
{<br />
result = zBoundaryEnd - Math.abs(z - zBoundaryEnd);<br />
}<br />
// z top is free<br />
if (z < 0 && MDCoordinator.DEBUG)<br />
System.out.println("Z NEGATIVE");<br />
return result;<br />
}<br />
Για τους άξονες x και y οι συνοριακές συνθήκες είναι περιοδικές, ενώ για τον άξονα z στην<br />
κάτω πλευρά της υπολογιστικής κυψελίδας αναφοράς, ανακλαστικά ενώ στην πάνω πλευρά<br />
της ελεύθερα. Κλείνοντας, µια ακόµα συνάρτηση που υλοποιείται είναι η ανάθεση ταχύτητας<br />
σύµφωνα µε την κατανοµή Maxwell-Boltzmann:<br />
/**<br />
* Used in MaxwellBoltzmann velocity to give UD[0,1]<br />
*/<br />
Random r = new Random(System.currentTimeMillis());<br />
public double getNextMaxwellBoltzmannVelocity()<br />
{<br />
double Xn = 0;