Local zone face apply value

Hi all

I’m looking to apply velocity boundary conditions with the face apply command. Unfortunately, the velocity field I want to apply is not exactly linear and it cannot be represented by a constant gradient value. In fact, each of the gradient components is a function of z.

I’ve identified so far two options:

  1. Use the fish-local keyword, where I could define a fish function which calculates the velocity components for a given gridpoint. But this fish function would be called at every step, which is slightly overkill as the velocity boundary condition doesn’t vary over time.
  2. Another option would be to assign to each individual gridpoint a fixed velocity. But in that case, I would end up with quite a huge number of conditions (around 8000).

So I have now two questions:

  1. Can you think of another way to assign a non-linear velocity boundary field ?
  2. Is there a limit to the number of individual zone gridpoint fix velocity commands ?

Thanks a lot for your inputs !
Regards,

Cyrille

I haven’t used it, but from my understanding of the documentation you should be able to use the FISH intrinsic gp.force.load() and set the appropriate force vector once for each gridpoint in a single function call according to your problem.
Otherwise, while it might not be the most elegant way, but you should also be able to use as many “fix velocity” commands as you wish, since all they (probably) to is to set the same intrinsic force values.

1 Like

@Cyrille,

In this case I would write a FISH function to set all the gridpoint velocities according to whichever criteria you want. You can use the FISH function gp.vel(). Then be sure to issue the command zone gridpoint fix velocity.

Not 100% addressing the initial question. but similar challenge to assign a load to a set of grid points belonging to a named face (the top of the model in this case - which is not a flat surface). I use this loop to do so :

loop foreach gp gp.list
        ddepth = gp.pos.z(gp)
        ; TODO: remove dependency on constant -135.
        if ddepth > -135.
             gp.force.load.z(gp) = ddepth * waterdensity * 9.81
        endif
    endloop

As you can see I would like to get rid of the constant value of -135 and identify gridpoints whether they belong to a face or not.
Any hints appreciated
Julia

@JuDi,
If the zone faces are grouped, then the gridpoints of those faces will belong to the same group as well. So you can identify the gridpoints based on the zone face group. This is part of the Data Hierarchies structure where the grouping logic will automatically move from gridpoints → zone faces → zones when checking for group matches.

Thanks @markus and @dblanksma ,
I will probably start by setting the individual gridpoint velocities.