Sloshing Computacional
Sloshing Computacional
u 1
Governing equation: + (u )u = p (gz 0 ) (14.1)
t
For irrotational flow: u = 0 (14.2)
For incompressible fluid: u = 0 (14.3)
Velocity potential: u = (14.4)
2 = 0 (14.5)
uw = n w = wn on w (14.6)
uf ree = n f ree = f ree on f ree (14.7)
1
where is the free surface motion and n denotes the normal
component with respect to the boundary surface.
(u )u = 12 u2 u ( u) = 21 u2 (14.8)
since u = 0 where
u = u2x + u2y + u2z
2
p
{ + 12 u2 + gz 0 }=0
t
p 1
+ 2 + gz 0 =0 (14.9)
t
On the free surface, the preceding equation specializes to with
p = 0 and z = :
1
2
+ g =0 (14.10)
t
Neglecting the nonlinear term and time-differentiating once, we
obtain
2
g =0 on f ree (14.11)
t2
The surface motion can be related as
= on f ree (14.12)
z
By combining (14.11) and (14.12), we arrive at the free surface
equation in terms of the velocity potential as follows:
1 2
+ =0 on f ree (14.13)
z g t2
2
boundary conditions. To this end, lets begin with the following
variational statement:
Z
f luid = f (2 ) dV = 0 (14.14)
V
Note that the normal fluid velocity on the wetted walls must be
the same as the normal velocity component of the structure if
the container is moving or flexible. It is this term that introduces
fluid-to-structure coupling.
Lets begin with the following variational equation for the struc-
ture:
Z
structure = ( + f s f ws ) ws dV = 0 (14.16)
V
3
where nj is the unit vector component in the j-th direction.
Z Z
ij nj wj d = pwn d
wet wet
Z
= f ( gz 0 )wn d (14.18)
|
wet t {z }
via (14.9)
Z
[(f s f ws ) ws ij ij ] dV
V Z
+ ij nj wj d
dry
| {z }
traction on the dry surface
Z
+ f ( gz 0 )wn d (14.19)
wet
| {z }
coupling to the fluid
4
Lets discretize term by term of the above variational expres-
sions:
Z
f wn d T [C]w (14.21a)
wall
Z
f 2
d T [Mf ] (14.21b)
Z
f ree g t2
f dV T [Kf ] (14.21c)
ZV Z
f s ws dV f gz 0 wn d
V Z wet
+ ij nj wj d wT qs (14.21d)
dry
Z
f wn d wT [C]T (14.21e)
Zwet
f ws ws dV wT [Ms ]w (14.21f)
ZV
ij ij dV wT [Ks ]w (14.21g)
V
T (Mf + Kf + Cw)
+ wT (qs Ms w Ks w + CT ) = 0 (14.22)
5
arrying out
V
[(fthe
s indicated
f ws ) variation,
ws we
ij ij ] obtain
dV
Z
Z
+ ij nj wj d Z f @ 2
|
dry
f wn{z d + } d
traction
Structural analyzer on the dry
| Zwall {z Fluidsurface
} analyzerf ree
g @t2
+couplingto f ( gz
structure 0
) wn d (3
Z wet
|
FSI$Example$I:$Analysis$of$Fluid$Sloshing${z }
+ f (r ) (r
$$$$$$$$$$$$$$$$$$$$$$Interac;ng$$with$Container$Structure$
coupling to the fluid ) dV = 0
V
Fig. 1. structure interacting with contained fluid
to two-way problem:
here the velocity k m
f
potential
2
jc f
relation(3.4) on the wett
=0 (14.24)
nd the free surface jc k boundary
m ws
2
condition(3.13) are used t
s
s
he firstwhose
and second term in the above derivation.
characteristic equation is given by
Note that
Remarkthe2: Itnormal
should be notedfluid velocity
that the matrix(M on the wetted walls
) involves
only the free surface, not the fluid volume. To be precise, if one
f
he samenodally
and as the
of the normal
nodes(r) for the velocity
fluid equation, we component
partition the fluid nodes into the free surface nodes (s)
the rest would of the stru
have for the fluid equation:
he container is moving or flexible. It is this term that int
(M ) 0
(K ) (K ) 0
uid-to-structure
coupling.
f s s f s f sr s
+ =
0 0 (K ) (K )
r
f rs Cw
f r r
(14.26)
.3 Variational Formulation
14.5 Partitioned formulation
teraction
of Fluid
of sloshing-vibration in- Container or S
Submerged in the Fluid
The variational formulation for the coupled sloshing and struc-
tural vibration problem(14.22) and the resulting coupled equa-
tions(14.23) may be viewed as a tightly coupled model system in
that both the structural analysis and sloshing analysis capabili-
ties have to in integrated into a single analysis code - - an effort
ets begin with the following variational equation for th
that requires significant software modifications.
ure: 6
Z
structure = (r + f s f ws ) ws dV = 0
In order to utilize existing sloshing and structural analysis soft-
ware modules with a minimum of modification, we reformulate
the interaction problem of sloshing and structural vibration via
partitioned formulation procedures. This is described below. To
this end, let us start with two uncoupled systems, viz.:
f = T (Mf + Kf )
s = wT (qs Ms w Ks w) (14.27)
Figure 4. Treatment of non-matching interfaces using localized Lagrange multipliers. The fields of multi-
Fig.on2.
pliers theLocalized interface
fluid side !f and forside
the structural partitioned fluid
!s are discretized and
using structure
Dirac domains
delta functions collocated at
the nodes. If the fluid is inviscid, only normal displacements of the frame and normal components of these
As the fluid velocity is the multipliers
primary are considered.
variable (i.e., uf = wall ),
the appropriate interface conditions between the flexible con-
tainer
that walls
is restricted and the
to follow the fluid is given
fluidstructure interface.by
To do so, the framefluid and framestructure
relative displacements are required to vanish. These conditions are expressed in the frame local
system as
[(uf )wall Lf ub ] = 0 [wall Lf ub ] = 0
T
[(w)wall Ls ub ] B=.x0f ! xb / D 0, BT .xs ! xb / D 0, (42)
and extendedto the fluid interface !f and the structure interface !s , respectively. If the fluid is invis-
cid, the tangential stress on the wall is zero. Thus, T the tangential displacements of the(14.28)
fluid and the
` =at !f Tfbecome
structure wall
LInfthis
[independent. ub ]case,
+ only
s [(the wall condition
w)kinematic Ls ub ] of (42) in the normal
direction applies, that is,
T
` = Tf [BTf nLf" .xufb!] + xb /
DT0,[BT w nT
" .xsL! xub /]D 0. (43)
s s s b
This simplification reduces the displacement field on the frame to ub D ub with only one compo-
nent
where BTf isdirection,
in the normal whereas the
understood asLLMs of the fluid and structure
an approximation of side
thereduce to !f D "n
interaction
and !s D "s , respectively.
wall gradient operator (wall ).
7. VARIATIONALLY BASED INTERFACE COUPLING
Thus, Hamiltons principle for the partitioned sloshing-structural
Use of a variational
vibration formulationsystem
interaction to treat the fluidstructure
can connection by
be constructed possesses the significant
summing up
advantage of preserving the symmetry of the equations of motion. In the present section, the
(f ,
variational s ) from
framework (14.27)
described and
in [35] the
is used interface
to obtain functional
the interface (` ) from
coupling equations.
f D int int
f C s (44)
(14.28) as:
Z t2
{f + s + ` } dt = 0
t1
with the change of variable = y
Z t2
...
[ yT (Mf y + Kf y)
t1
+ wT (qs Ms w Ks w)
n o
+ Tf (BTf y Lf ub ) + Ts (BTs w Ls ub ) ] dt = 0
(14.29)
...
+ =
T
0 0 000 0 s Bs 0 0 0 0 Ls
s
0
...
0 0 000
0
BTf 0 0 Lf
0
f 0 0
f
0 0 000 0 u
b 0 0 0 LT LT 0
s
u
f b
0
y = y1
(14.31)
8
The following is a Matlab code for two-dimensional sloshing with
rigid rectangular walls. Good luck with the code! (as I do not
guarantee it works!)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Asemble velocity 2D potential elements for a rectangular shape
%
% [Ke]=element_sloshing_ke(xn,yn) - Laplace operator for the domain
% [Me]=element_sloshing_me(xn) - mass matrix for the surface only
%
%
% programmed by kcpark, 09/25/09
%%%%%%%%%%%%%%%%%%%%
%
%
% mesh size
%
nnode_x = input(number horizontal nodes = );
nnode_z = input(number of vertical nodes = );
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% build volume Laplace operator matrix
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[ke]=element_sloshing_ke(xn, yn);
9
for i = 1: (nnode_x-1) % z-direction sweep
nk = (i-1)*nnode_z ;
for j = 1:(nnode_z-1); % x-direction sweep
IC = IC+1;
start = nk + j;
conn(IC, 1) = start;
conn(IC, 2) = start + 1;
conn(IC, 3) = start+ nnode_z +1;
conn(IC, 4) = start +nnode_z;
end;
end
%
% generate the nodal coordinates
%
coord= zeros(node_total,2);
nodes = 0;
%
% assemble the Laplace operator matrix
%
Kg = sparse(zeros(dof_total, dof_total));
for ne =1:nelem_total,
for i=1:node_elem,
nr = conn(ne,i);
for j=1:node_elem,
nc = conn(ne,j);
isub = (nr-1)*dof_node +1: nr*dof_node;
jsub = (nc-1)*dof_node +1: nc*dof_node;
ei = (i-1)*dof_node +1: i*dof_node;
ej = (j-1)*dof_node +1: j*dof_node;
Kg(isub, jsub) = Kg(isub, jsub) + ke(ei,ej);
10
end;
end;
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Obtain reduced matrix for the surface DOFs
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
dof_ss = nnode_x*dof_node;
dof_ii = dof_total - dof_ss;
conn=sparse(zeros(nelem_total, node_elem));
IC=0;
start = 0;
for i = 1: (nnode_x-1) % x-direction sweep
IC = IC+1;
start = start +1; % for unit element length
conn(IC, 1) = start;
conn(IC, 2) = start + 1;
end;
x_coord = [0 1];
11
Mg = sparse(zeros(dof_total, dof_total));
% assemble the surface mass matrix
for ne =1:nelem_total,
for i=1:node_elem,
nr = conn(ne,i);
for j=1:node_elem,
nc = conn(ne,j);
isub = (nr-1)*dof_node +1: nr*dof_node;
jsub = (nc-1)*dof_node +1: nc*dof_node;
ei = (i-1)*dof_node +1: i*dof_node;
ej = (j-1)*dof_node +1: j*dof_node;
Mg(isub, jsub) = Mg(isub, jsub) + me(ei,ej);
end;
end;
end;
%
% Perform sloshing resonance analysis
%
[Phi_s, lambda] = eig(full(K_reduced), full(Mg));
lambda = diag(lambda);
[lambda,I]=sort(lambda);
Phi_s =Phi_s(:,I);
n_mode = input(number of modes to display = );
mode_extract = 2:n_mode+1;
lambda=lambda(mode_extract);
Phi_s=Phi_s(:,mode_extract);
g = 9.8; % grvitational acceleration (m/s^2)
omega = sqrt(lambda*g);
%
% compute the vertical displacement on the free surface
%
eta = (1./g)*Phi_s;
%
%plot the mode shapes on the free surface
%
for nplot =1:n_mode,
figure(nplot);
plot(eta(:,nplot));
xlabel(Surface span);
ylabel(Mode shape );
legend([ num2str(nplot), -th mode , ...
lambda = , num2str(lambda(nplot))]);
title(Sloshing Mode for 2D Rectangular Tank);
12
end;
%
% compare with the analytical frequency, lambda!
%
L = nnode_x;
km = (pi/L)*(1:n_mode);
tanhx = tanh(pi*(1:n_mode)); % for the case of H=L!
lambda_analytical = (km.*tanhx);
%
% error of the computed frequencies
%
error_percent = ...
100*(lambda_analytical-lambda)./lambda_analytical;
error = abs(error_percent);
figure(n_mode+1);
plot(error);
xlabel(Mode Number);
ylabel(Percentage Error in Frequency );
% legend([ num2str(nplot), -th mode , ...
% lambda = , num2str(lambda(nplot))]);
title(Computed Mode Error for 2D Rectangular Tank);
%%%%%%%%%%%%%%%%%%%%%
% (main program ends here)
%%%%%%%%%%%%%%%%%%%%%
function [Ke]= element_sloshing_ke(xn,yn);
% [ke]=element_sloshing_ke(xn,yn)
%
% Compute Laplace 2D operator
% for computing sloshing modes employing
% the velocity potential
%
%
% programmed by K. C. Park (24/09/09)
%
Nodes = 4;
Ndof =1;
xn = diag(diag(xn)); yn = diag(diag(yn));
bintpts = [ -1 1 1 -1; -1 -1 1 1]/sqrt(3);
sintpts = [ 0 0 -1 1; -1 1 0 0]/sqrt(3);
13
Ke = zeros(4);
for int_point=1:4,
xi=bintpts(1,int_point); eta=bintpts(2,int_point);
% shape function derivatives
dN1dxi =-(1-eta)/4; dN1deta =-(1-xi)/4;
dN2dxi = (1-eta)/4; dN2deta =-(1+xi)/4;
dN3dxi = (1+eta)/4; dN3deta = (1+xi)/4;
dN4dxi =-(1+eta)/4; dN4deta = (1-xi)/4;
dN_dxi_eta = [dN1dxi dN2dxi dN3dxi dN4dxi;
dN1deta dN2deta dN3deta dN4deta];
J = dN_dxi_eta*[xn yn];
detJ = J(1,1)*J(2,2) - J(1,2)*J(2,1);
Jinv = inv(J);
B = Jinv*dN_dxi_eta;
Bx = B(1, :);
By = B(2, :);
Ke = Ke + detJ*(Bx*Bx + By*By);
end
return
%
%%%%%%%%%%%%%%%%%%%%%%%
%
function [Me]=element_sloshing_me(xn)
% [me]=element_sloshing_me(xn)
%
% Compute 2D surface mass matrix
% for computing sloshing modes employing
% the velocity potential
%
%
% programmed by K. C. Park (24/09/09)
%
Nodes = 2;
Ndof =1;
xn = diag(diag(xn));
bintpts = [ -1 1]/sqrt(3);
14
Me = zeros(2);
for int_point=1:2,
xi=bintpts(1,int_point);
N1=(1-xi)/2;
N2=(1+xi)/2;
N = [N1 N2];
dN1dxi = - 1/2;
dN2dxi = 1/2;
dN_dxi = [dN1dxi dN2dxi];
J = dN_dxi*[xn];
detJ = J;
Me = Me + detJ*N*N;
end
return
15