Beispiel #1
0
    def __init__(self, nr, rho, xmin, xmax, nNodePerh=2.01, numbins=10000):
        GenerateNodeProfile1d.__init__(nx=nr,
                                       rho=rho,
                                       xmin=xmin,
                                       xmax=xmax,
                                       nNodePerh=nNodePerh,
                                       numbins=numbins)

        # Convert the mass for spherical shells
        self.m = [mi * ri * ri for mi, ri in zip(self.m, self.x)]

        return
Beispiel #2
0
        Pi = P1 + (P2 - P1)/(1.0 + exp((-xi - x1)/hfold))
    elif xi <= x1:
        Pi = P1
    else:
        Pi = P2
    return Pi/((gammaGas - 1.0)*rhoi)

#-------------------------------------------------------------------------------
# Set the node properties.
#-------------------------------------------------------------------------------
from GenerateNodeProfile import GenerateNodeProfile1d
from VoronoiDistributeNodes import distributeNodes1d
if numNodeLists == 1:
    gen = GenerateNodeProfile1d(nx = nx1 + nx2,
                                rho = rho_initial,
                                xmin = x0,
                                xmax = x2,
                                nNodePerh = nPerh)
    distributeNodes1d((nodes1, gen))
else:
    if hsmooth > 0:
        gen1 = GenerateNodeProfile1d(nx = nx1,
                                     rho = rho_initial,
                                     xmin = x0,
                                     xmax = x1,
                                     nNodePerh = nPerh)
        gen2 = GenerateNodeProfile1d(nx = nx2,
                                     rho = rho_initial,
                                     xmin = x1,
                                     xmax = x2,
                                     nNodePerh = nPerh)