espressomd-users
[Top][All Lists]

## Re: [ESPResSo-users] Basic Question about using LB

 From: Ulf Schiller Subject: Re: [ESPResSo-users] Basic Question about using LB Date: Tue, 24 Apr 2012 07:56:18 +0200 User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:10.0) Gecko/20120129 Thunderbird/10.0

```On 04/23/2012 09:00 PM, Stefan Kesselheim wrote:
```
```Hi Salvador, hi Espresso-users,

Am 23.04.2012 um 20:26 schrieb Salvador H-V:

```
```Hi,

I am trying to simulate a quasi-two dimensional mixture suspension composed by
rigid dumbbells and spheres.
```
```
This brings up immediately the question how you want to model the dumbbells and spheres. You can
make the dumbbells out of several particles connected by bonds that are stiffened with a bond angle
potential and spheres just by single particle. This if course limits the accuracy as the
"point coupling" scheme only coarsely represents the corresponding particles. Other
possiblities would be the raspberry model (Lobaskin et al) or the "wall" model as used in
most of the LB community (first by Ladd ...).

```
```
I am planning to use LB fluid and LB as a thermostat. However just to be on the
safe side, I would like to ask you the following:

a) It is possible to use LB fluid for a no-cubic box. I want to use a box with
different length in z-direction. I just want/need a layer of fluid in
z-direction to cover the particles.
```
```
Yes. Noncubic is fine.

```
```b) Because of the periodicity of the system, I was wondering if LB fluid can
handle partial periodicities (1 1 0)
```
```
What would be the boundary condition in z direction, if not periodic? A wall
can be created with the lbboundary command. Other BCs are not implemented, as
pressure BCs for example are nontrivial in LB.
```
```

```
If you need pressure boundary conditions, you can try to adapt the code below. It implements node based pressure conditions at an inlet/outlet in x direction. The formulas for y and z direction have a similar structure. The macros PFI and FI have to be adjusted to the data structures for the fluid populations.
```
Cheers,
Ulf

/***********************************************************************/

INLINE static void lb_inlet_x(double *PFI, int x, int y, int z) {
double rho, f, m0, my, mz, jx, jy, jz, nxy, nxz;

int xc, yc;
xc = x%3;
yc = y+1;

rho = 3.*lbpar.pressure;

f = FI( 0, xc, yc)[z]; m0  = f;
f = FI( 2, xc, yc)[z]; m0 += 2*f;
f = FI( 3, xc, yc)[z]; m0 += f;   my  = f;
f = FI( 4, xc, yc)[z]; m0 += f;   my -= f;
f = FI( 5, xc, yc)[z]; m0 += f;            mz  = f;
f = FI( 6, xc, yc)[z]; m0 += f;            mz -= f;
f = FI( 8, xc, yc)[z]; m0 += 2*f;
f = FI(10, xc, yc)[z]; m0 += 2*f;
f = FI(12, xc, yc)[z]; m0 += 2*f;
f = FI(14, xc, yc)[z]; m0 += 2*f;
f = FI(15, xc, yc)[z]; m0 += f;   my += f; mz += f;
f = FI(16, xc, yc)[z]; m0 += f;   my -= f; mz -= f;
f = FI(17, xc, yc)[z]; m0 += f;   my += f; mz -= f;
f = FI(18, xc, yc)[z]; m0 += f;   my -= f; mz += f;

jx = (rho - m0)/6.;
jy = 0.0;
jz = 0.0;

nxy = 3.*jy - 0.5*my;
nxz = 3.*jz - 0.5*mz;

FI( 1, xc, yc)[z] = FI( 2, xc, yc)[z] + 2.*jx;
FI( 7, xc, yc)[z] = FI( 8, xc, yc)[z] + jx + nxy;
FI( 9, xc, yc)[z] = FI(10, xc, yc)[z] + jx - nxy;
FI(11, xc, yc)[z] = FI(12, xc, yc)[z] + jx + nxz;
FI(13, xc, yc)[z] = FI(14, xc, yc)[z] + jx - nxz;

}

/***********************************************************************/

INLINE static void lb_outlet_x(double *PFI, int x, int y, int z) {
double rho, f, m0, my, mz, jx, jy, jz, nxy, nxz;

int xc, yc;
xc = x%3;
yc = y+1;

rho = 0.0;

f = FI( 0, xc, yc)[z]; m0  = f;
f = FI( 1, xc, yc)[z]; m0 += 2*f;
f = FI( 3, xc, yc)[z]; m0 += f;   my  = f;
f = FI( 4, xc, yc)[z]; m0 += f;   my -= f;
f = FI( 5, xc, yc)[z]; m0 += f;            mz  = f;
f = FI( 6, xc, yc)[z]; m0 += f;            mz -= f;
f = FI( 7, xc, yc)[z]; m0 += 2*f;
f = FI( 9, xc, yc)[z]; m0 += 2*f;
f = FI(11, xc, yc)[z]; m0 += 2*f;
f = FI(13, xc, yc)[z]; m0 += 2*f;
f = FI(15, xc, yc)[z]; m0 += f;   my += f; mz += f;
f = FI(16, xc, yc)[z]; m0 += f;   my -= f; mz -= f;
f = FI(17, xc, yc)[z]; m0 += f;   my += f; mz -= f;
f = FI(18, xc, yc)[z]; m0 += f;   my -= f; mz += f;

jx = (m0 - rho)/6.;
jy = 0.0;
jz = 0.0;

nxy = 3.*jy - 0.5*my;
nxz = 3.*jz - 0.5*mz;

FI( 2, xc, yc)[z] = FI( 1, xc, yc)[z] - 2.*jx;
FI( 8, xc, yc)[z] = FI( 7, xc, yc)[z] - jx - nxy;
FI(10, xc, yc)[z] = FI( 9, xc, yc)[z] - jx + nxy;
FI(12, xc, yc)[z] = FI(11, xc, yc)[z] - jx - nxz;
FI(14, xc, yc)[z] = FI(13, xc, yc)[z] - jx + nxz;

}

/***********************************************************************/

--
Dr. Ulf D. Schiller                        Building 04.16, Room 3006
Institute of Complex Systems (ICS-2)       Phone:   +49 2461 61-6144
Forschungszentrum Jülich, Germany          Fax:     +49 2461 61-3180

``` smime.p7s
Description: S/MIME Cryptographic Signature