10 #beginMacro heatFluxInterfaceRightHandSide(LABEL)
16 printP(
"LABEL::interfaceRHS:heatFlux %s RHS for (side,axis,grid)=(%i,%i,%i) a=[%5.2f,%5.2f]"
17 " t=%9.3e gfIndex=%i (current=%i)\n",
18 (option==0 ?
"get" :
"set"),
side,
axis,
grid,
a[0],
a[1],t,gfIndex,current);
21 const int tc = parameters.dbase.get<
int >(
"tc");
26 mg.update(MappedGrid::THEvertexBoundaryNormal);
30 const realSerialArray & normal =
mg.vertexBoundaryNormal(
side,
axis);
34 if( option==setInterfaceRightHandSide )
46 else if( option==getInterfaceRightHandSide )
51 realMappedGridFunction &
u = gf[gfIndex].u[
grid];
53 realSerialArray
uLocal; getLocalArrayWithGhostBoundaries(u,uLocal);
55 realSerialArray & uLocal = gf[gfIndex].u[
grid];
66 MappedGridOperators & op = *(u.getOperators());
70 op.derivative(MappedGridOperators::xDerivative,uLocal,
ux,
I1,
I2,
I3,
N);
71 op.derivative(MappedGridOperators::yDerivative,uLocal,
uy,
I1,
I2,
I3,
N);
73 if(
cg.numberOfDimensions()==2 )
80 op.derivative(MappedGridOperators::zDerivative,uLocal,
uz,
I1,
I2,
I3,
N);
81 f(
I1,
I2,
I3,tc) +=
a[1]*(
normal(
I1,
I2,
I3,0)*
ux +
normal(
I1,
I2,
I3,1)*
uy +
normal(
I1,
I2,
I3,2)*
uz );
94 printF(
"LABEL::interfaceRightHandSide:ERROR: unknown option=%i\n",option);
95 Overture::abort(
"error");
99 parameters.dbase.get<
bool >(
"twilightZoneFlow") )
103 OGFunction &
e = *(parameters.dbase.get<OGFunction* >(
"exactSolution"));
108 mg.update(MappedGrid::THEcenter);
110 realArray &
x=
mg.center();
112 realSerialArray xLocal;
114 getLocalArrayWithGhostBoundaries(x,xLocal);
116 const realSerialArray & xLocal =
x;
122 e.gd( ue ,xLocal,numberOfDimensions,isRectangular,0,0,0,0,
I1,
I2,
I3,
N,t);
135 e.gd(
uex ,xLocal,numberOfDimensions,isRectangular,0,1,0,0,
I1,
I2,
I3,
N,t);
136 e.gd( uey ,xLocal,numberOfDimensions,isRectangular,0,0,1,0,
I1,
I2,
I3,
N,t);
137 if( numberOfDimensions==2 )
143 realSerialArray uez(
I1,
I2,
I3,
N);
144 e.gd( uez ,xLocal,numberOfDimensions,isRectangular,0,0,0,1,
I1,
I2,
I3,
N,t);
146 ue(
I1,
I2,
I3,
N) +=
a[1]*(
normal(
I1,
I2,
I3,0)*
uex +
normal(
I1,
I2,
I3,1)*uey +
normal(
I1,
I2,
I3,2)*uez );
150 if( option==getInterfaceRightHandSide )
162 ::display(
f(
I1,
I2,
I3,tc) ,
" a[0]*u + a[1]*( k u.n ) - [a[0]*ue + a[1]*( k ue.n )]");
165 else if( option==setInterfaceRightHandSide )
180 Overture::abort(
"error");