예제 #1
0
                                nonLocal,
                                mu,
                                omega,
                                gam0,
                                Dom,
                                nThreads=nThr)

    # Initialize Ewald for non-local velocities
    if (nonLocal > 0 and nonLocal < 4):
        Ewald = GPUEwaldSplitter(
            allFibers.getaRPY() * eps * Lf, mu,
            xi * 1.4 * (fibDisc.getNumDirect() / N)**(1 / 3), Dom,
            NupsampleForDirect * nFib)
    else:  # This is so it doesn't try to initialize a GPU code if there isn't a GPU
        Ewald = EwaldSplitter(allFibers.getaRPY() * eps * Lf, mu,
                              xi * 1.4 * (fibDisc.getNumDirect() / N)**(1 / 3),
                              Dom, NupsampleForDirect * nFib)

    # Initialize the fiber list (straight fibers)
    fibList = [None] * nFib
    print('Loading from steady state')
    try:
        XFile = 'DynamicStress/DynamicSSLocs' + inFile
        XsFile = 'DynamicStress/DynamicSSTanVecs' + inFile
        allFibers.initFibList(fibList,
                              Dom,
                              pointsfileName=XFile,
                              tanvecfileName=XsFile)
    except:
        print('Redirecting input file directory')
        XFile = 'DynamicRheo/Time60Locs' + inFile
예제 #2
0
    for giters in gits:
        for dt in dts:
            # Initialize the domain
            Dom = PeriodicShearedDomain(Ld,Ld,Ld);

            # Initialize fiber discretization
            fibDisc = ChebyshevDiscretization(Lf,eps,Eb,mu,N,deltaLocal=0.1,NupsampleForDirect=N,rigid=True);

            # Initialize the master list of fibers
            allFibers = fiberCollection(nFib,10,fibDisc,nonLocal,mu,omega,gam0,Dom);
            fibList = makeThreeSheared(Lf,N,fibDisc);
            allFibers.initFibList(fibList,Dom);
            allFibers.fillPointArrays();
            
            # Initialize Ewald for non-local velocities
            Ewald = EwaldSplitter(allFibers.getaRPY()*eps*Lf,mu,xi,Dom,N*nFib);

            # Initialize the temporal integrator
            TIntegrator = CrankNicolson(allFibers);
            # Number of GMRES iterations for nonlocal solves
            # 1 = block diagonal solver
            # N > 1 = N-1 extra iterations of GMRES
            TIntegrator.setMaxIters(giters);

            # Prepare the output file and write initial locations
            of = prepareOutFile('New2LocationsN' +str(N)+'G'+str(giters)+str(dt)+'.txt');
            allFibers.writeFiberLocations(of);

            # Time loop
            stopcount = int(tf/dt+1e-10);
            for iT in range(stopcount): 
예제 #3
0
# We don't have dynamic cross linking, what we do is bind links
# at t = 0 by calling the dynamic method with high binding rate and
# zero unbinding rate
konCL = 1000
# cross linker binding rate
koffCL = 1e-16
# cross linker unbinding rate

np.random.seed(1)

# Initialize the domain and spatial database
Dom = PeriodicShearedDomain(Ld, Ld, Ld)

# Initialize Ewald for non-local velocities
Ewald = EwaldSplitter(np.exp(1.5) / 4 * eps * Lf, mu, xi, Dom, N * nFib)

# Initialize fiber discretization
fibDisc = ChebyshevDiscretization(Lf, eps, Eb, mu, N, deltaLocal=0.1)

# Initialize the master list of fibers
allFibers = fiberCollection(nFib,
                            fibDisc,
                            nonLocal,
                            mu,
                            omega,
                            gam0,
                            Dom,
                            nThreads=4)

# Initialize the fiber list (straight fibers)
# The hexagonal array calculation
# Initialization
g = 0.5
# strain for parallelepiped
Lx = 2.0
Ly = 2.0
Lz = 2.0
a = 1e-2
mu = 3.0
xi = 5.0
Npts = 4
pts = np.array([[0, 0, 0], [1, 0, 0], [0.5, 1, 0], [1.5, 1, 0]])
forces = np.array([[1.0, 1, 1], [-1, -1, -1], [2, 2, 2], [-2.0, -2, -2]])
ShearDom = PeriodicShearedDomain(Lx, Ly, Lz)
ShearDom.setg(g)
Ewald = EwaldSplitter(a, mu, xi, ShearDom, Npts)
SpatialkD = ckDSpatial(pts, ShearDom)

# Velocity of the blobs - parallelogram domain
uParallelogram = Ewald.calcBlobTotalVel(pts, forces, ShearDom, SpatialkD)
par = uammd.PSEParameters(psi=Ewald._xi,
                          viscosity=mu,
                          hydrodynamicRadius=a,
                          tolerance=1e-6,
                          Lx=Lx,
                          Ly=Ly,
                          Lz=Lz)
pse = uammd.UAMMD(par, Npts)
#pse.Mdot assumes interleaved positions and forces, that is x1,y1,z1,x2,y2,z2,...
shearedpts = pts.copy()
shearedpts[:, 0] -= g * shearedpts[:, 1]