Skip to content

Cylinder2D study

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #7159
    AntoineJ
    Participant

    Hi,
    I’m using the example of cylinder2D to compare drag coefficient with a star-ccm+ simulation for a project.
    Is there an example that uses a normal velocity inlet boundary condition and not a Poiseuille velocity profile ?

    I would like to add a convergence criterion in the simulation, but I don’t know which parameter is the most appropriate in this case ?

    Thanks

    #7161
    FBukreev
    Keymaster

    Dear Antoine,

    you could replace the Poiseuille profile through a costant velocity value.
    As convergence criterion you could compare velocity values between time steps in some plane in the middle of the channel. In the laminar case they will remain steady after reaching the convergence.

    Greetings
    Fedor

    #7162
    AntoineJ
    Participant

    That’s what I did for the inflow but I have errors when compiling the file.

    I set the velocity in the parameters of the simulation: const T Velocity = 0.05;
    Then I defined the inflow condition instead of the Poiseuille inflow: sLattice.defineU( superGeometry, 3, Velocity );

    I don’t know where I’m wrong

    Thanks

    #7165
    FBukreev
    Keymaster

    You mast use the AnalyticalConst2D instead of a normal variable

    #7171
    AntoineJ
    Participant

    Perfect thanks,

    I tried to save drag coefficient data on a file but it only works for one random time step value and not for every one, I don’t find why ? (Is there a way to write the drag coefficient at every x time step ?)
    The code is :
    CSV<T> csvWriterSim(“SimulationV=” + std::to_string(converter.getCharPhysVelocity()));
    csvWriterSim.writeDataFile(converter.getPhysTime( iT ), _drag[0], 16);

    Another question, when I look a the simulation it looks like the flow is coming back into the channel from the pressure outlet.
    I don’t know if it is normal and if it stops after several time steps or if there is a problem with my boundary conditions ?

    Thank you for your help,
    Antoine

    #7181
    FBukreev
    Keymaster

    Hello, if you execute getResults each time step, then it must be written out also each time step.

    If you have too strong turbulence then the flow may come sometimes back from the outlet.

    Greetings,
    Fedor

    #7193
    AntoineJ
    Participant

    Yes it works,

    Last question about the relaxation time, I don’t understand how you defined it for each example.
    For the example of laminar flow around a cylinder, it is 0.56 for the 2D simulation and 0.53 for the 3D case.

    This relaxation time is related to viscosity and the time step, as the viscosity is defined by the velocity and the Reynolds number, the relaxation time basically define the time step.
    So the strategy is to find a time step where there is a good stability/accuracy or the relaxation time that makes sense for a specific case?

    Greetings,
    Antoine

    #7197
    FBukreev
    Keymaster

    Hi Antoine,

    take please the UnitConverterFromResolutionAndLatticeVeLocity and set the lattice velocity to 0,1. In that case the converter will aoutomatically calculate the relaxation time by which the simulation runs stabely.
    The relaxation times defines how far goes the population inside of one time step.

    Greetings
    Fedor

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.