Hi Alessandro, userDefinedForcing assigns the forcing 1 grid at a time. If ucg is a realCompositeGridFunction, then ucg[grid] is a realMappedGridFunction. Note that u(I1,I2,I3,uc) is an array (not a scalar). You should use something like fg(I1,I2,I3,uc) = myParameters(3)*u(I1,I2,I3,uc); fg(I1,I2,I3,vc) = myParameters(4)*u(I1,I2,I3,vc); etc. You will want to check that the forcing really works. As I indicated we have been making many changes to the forcings. These will appear in the next version. ...Bill On 06/01/2012 02:45 AM, Alessandro Orchini wrote:
Hi Bill, thanks for the suggestions, I'm working on the code. I'm just not sure how to behave with the velocities: in userDefinedForcing the velocity field is already read from the db by const int & uc = parameters.dbase.get<int >("uc"); const int & vc = parameters.dbase.get<int >("vc"); const int & wc = parameters.dbase.get<int >("wc"); If I define a real TheVelocity and assign it component by component by for(n==0; n<numberOfDimensions; n++) { if(n==0) TheVelocity=u(I1,I2,I3,uc); else if(n==1) TheVelocity=u(I1,I2,I3,vc); else if(n==2) TheVelocity=u(I1,I2,I3,wc); fg(I1,I2,I3,n)=myParameters(3)*TheVelocity; } does this routine apply the forcing on all the grids? Usually when I read a .show file I specify the grids with square brackets, e.g. u[grid](i,j,k,n) and I wonder what if the [grid] option is omitted. Thanks! Regards, Alessandro -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Date: Mon, 21 May 2012 09:55:03 -0700 From: henshaw@xxxxxxxx To: overture@xxxxxxxxxxxxx Subject: [overture] Re: modify ins equations Hi Alessandro, Forcings can be specified in cg/common/src/userDefinedForcing.C (we have been making many changes to the forcing's which will appear in the next version). Gravity can already be turned on if you solve the INS plus Boussinesq equations (i.e. add a Temperature equation) See the examples in the cg/ins/cmd. Boundary values are set in cg/common/src/userDefinedBoundaryValues.C ...Bill On 05/21/2012 08:17 AM, Alessandro Orchini wrote: Hi all, I would like to add forces at the INS equation (a volume force as gravity, and also a force proportional to the velocity filed), and define new boundary conditions. In particular, I need to impose at the inflow and outflow boundaries (top and bottom respectively) the velocity profiles to be u(x,t)=0; v(x,t) = a*(cosh(b*x)/cosh(b*c) - 1); being a,b,c constants. I've found in ins/src the whole source code, but what and where I have to modify exactly? (lineSolveINS.h? Cgins.C? ins(bC).C? ...) Thanks, Regards Alessandro