I want to simulate a von Karman vortex past a cylinder. I get the following error when defining the Navier-Stokes problem:
Error line number 87, in file karman-vortices.edp, before token +
79 : ////----------------------------------
80 : //// Equations
81 : ////----------------------------------
82 : problem nvs(u, v, p, uh, vh, q)
83 : = int2d(Th)(
84 : (u * uh + v * vh)/dt
85 : )
86 : + int2d(Th)(
87 : uh * (u * dx(u) + error operator * <10LinearCombI7MGauche4C_F0E>, <10LinearCombI7MGauche4C_F0E>
...
current line = 87
Compile error :
line number :87, +
error Compile error :
line number :87, +
code = 1 mpirank: 0
Here is the problem definition:
problem nvs(u, v, p, uh, vh, q)
= int2d(Th)(
(u * uh + v * vh)/dt
)
+ int2d(Th)(
uh * (u * dx(u) + v * dy(u))
+ vh * (u * dx(v) + v * dy(v))
)
- nu * int2d(Th)(
Grad(U) : Grad(V)
)
+ int2d(Th)(
dx(p) * uh + dy(p) * vh
)
+ penalty * int2d(Th)(
q * (dx(u) + dy(v))
)
+ on(outlet, p = pout)
+ on(farfield, u = ufarfield, v = 0)
+ on(noslip, u = 0, v = 0);
Here is the full script if needed:
include "getARGV.idp";
//----------------------------------
// macros
//----------------------------------
macro grad(u) [dx(u), dy(u)]; //
macro Grad(U) [grad(U#x), grad(U#y)]; //
macro Div(U) (dx(U#x) + dy(U#y)); //
//----------------------------------
// physical/problem parameters
//----------------------------------
real Re = getARGV("-Re", 1.0);
real D = 10; // cylinder diameter
real ufarfield = 10.0; // inlet velocity
real nu = ufarfield*D/Re; // kinematic viscosity
real T = 1000;
real pout = 0.0;
real penalty = 1.0;
real dt = 1e-3;
//----------------------------------
// MESH
//----------------------------------
// parameters
real xmin = 0;
real ymin = 0;
real xmax = 800;
real ymax = 300;
real xcyl = (xmin+xmax)/2;
real ycyl = (ymin+ymax)/2;
int nx = getARGV("-nx", 50);
int ny = getARGV("-ny", 50);
int ncylinder = getARGV("-ncylinder", 100);
// tags
int farfield = 1;
int inlet = 1;
int noslip = 2;
int outlet = 3;
// rectangle borders
border left(t=0, ymax){x=xmin; y=(ymax-t); label=farfield;};
border right(t=0, ymax){x=xmax; y=t; label=outlet;};
border bot(t=0, xmax){x=t; y=ymin; label=farfield;};
border top(t=0, xmax){x=(xmax-t); y=ymax; label=farfield;};
// cylinder
border cylinder(theta=0, 2*pi){
x = D*cos(theta) + xcyl;
y = D*sin(theta) + ycyl;
label=noslip;
};
// generation
mesh Th = buildmesh(
left(ny) + top(nx) + right(ny) + bot(nx) + cylinder(-ncylinder)
);
//plot(Mesh, wait=1);
//----------------------------------
// PDE
//----------------------------------
fespace Space1(Th, P1);
Space1 p, q;
fespace Space2(Th, P2);
Space2 u, v;
Space2 uh, vh;
//----------------------------------
// Initial conditions
//----------------------------------
u = ufarfield * (x< (xmin + (xmax-xmin)/4));
p = 0;
v = 0;
//----------------------------------
// Equations
//----------------------------------
problem nvs(u, v, p, uh, vh, q)
= int2d(Th)(
(u * uh + v * vh)/dt
)
+ int2d(Th)(
uh * (u * dx(u) + v * dy(u))
+ vh * (u * dx(v) + v * dy(v))
)
- nu * int2d(Th)(
Grad(U) : Grad(V)
)
+ int2d(Th)(
dx(p) * uh + dy(p) * vh
)
+ penalty * int2d(Th)(
q * (dx(u) + dy(v))
)
+ on(outlet, p = pout)
+ on(farfield, u = ufarfield, v = 0)
+ on(noslip, u = 0, v = 0);