[overture] Re: modify ins equations

  • From: Bill Henshaw <henshaw@xxxxxxxx>
  • To: overture@xxxxxxxxxxxxx
  • Date: Thu, 05 Jul 2012 20:21:48 -0700

Hi Alessandro,
   If you send my your command files and userDefinedForcing.C I can take a look.

Regards,
  Bill

On 07/05/2012 02:55 AM, Alessandro Orchini wrote:

Hi Bill,

thanks for the suggestion for parallel, I'll test in the next days the 
multigrid parallel solver.

I go a moment back to an old question on userDefinedForcing. Following the 
examples given, I added an option to add gravity and an additional viscosity 
term proportional to the velocity.

The Forcing I give is

fg(I1,I2,I3,uc) = - myParameter(1)*u(I1,I2,I3,uc);
fg(I1,I2,I3,vc) = myParameter(0) - myParameter(1)*u(I1,I2,I3,vc);

i.e. a friction in both x and y direction and a volume force like gravity in y 
direction.

My flow goes in the up-down direction in a "free channel": assigning noSlipWall conditions on the left-right boundaries, it exists a limit velocity v_lim that can also be found theoretically. I choose the parameters so that v_lim = -2.0 and I setup an uniform incoming flow with v = -1.0. Note that I actually had to insert accelerations in fg(all,all,all,n) and not forces (e.g., for the gravity I insert g and NOT \rho*g )

The velocity field behaves perfectly, I see a transient form the initial 
velocity to the terminal velocity which fits perfectly with the theoretical 
results.

But the pressure behavior seems really bad to me. It starts from values like (pmin=1, pmax=2) and goes down to (pmin= - 80, pmax = - 45) after 4000 iterations, and still has the tendency to decrease, and, more important, there are discontinuities in its evolution, (I've attached a graph).

Have I missed something? My only doubt is, does Overture automatically evaluate the divergence of the Forcing that has to be added to the Pressure Poisson equation? (In my case anyway it should be zero since I'm dealing with incompressible flows and *\/**u =0* ...)

Thanks for any clue

Regards

Alessandro

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Date: Fri, 1 Jun 2012 07:42:39 -0700
From: henshaw@xxxxxxxx
To: overture@xxxxxxxxxxxxx
Subject: [overture] Re: modify ins equations

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 <mailto:henshaw@xxxxxxxx>
    To: overture@xxxxxxxxxxxxx <mailto: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




Other related posts: