simple2Dcfd exchange for H12+ hdk?

   1503   0   0
User Avatar
Member
61 posts
Joined: Feb. 2006
Offline
Hi,

Bit of a long shot question here (but maybe Mr Lait comes here from time to time).

So back in the day, 2007-08 or so, when I was first hitting hard the (then) new pyro and solver tools, I found invaluable as learning resources Mr Lait's “building solvers from scratch” tutorial and the code for “simple2DCFD” example DSO from the exchange (original attached), together with Joss Stams original paper.

The 2DCFD DSO is a really nice, simple sandbox to get into experimenting with gas solvers coding and I recently went back over it recently to find that the overhaul of DOPs around v11-12 breaks the compiler on this (old) version DSO.

Anyone ever got round to recoding it for later (v12) versions? It just looks like a bit of reorganisation and updating headers, so I thought it just needed referencing the new PRM_shared and SIM_UTILS to the toolkit/include versions and replacing the SIM_VoxelArray header with a CFD_VoxelArray subclass from UT_voxelArray, like the Snow_Solver hdk sample but … It seems a fair bit more involved unfortunately.

So…. anyone done it? Would be nice even if sidefx could put out on exchange again, its a really nice little framework for experimenting with other solvers given how much spin off work developed on from the original paper out there in the communities.

(the solveForObject function below is the one that throws my compile sideways when I try referencing a CFD_VoxelArray instead of the old SIM_VoxelArray from H v.8.0.)

Cheers!






void
SIM_SolverCFD::solveForObject(SIM_Object &object,
SIM_VoxelArray &densities,
SIM_VoxelArray &velocityu,
SIM_VoxelArray &velocityv,
const SIM_Time &timestep) const
{
SIM_VoxelArray *newdensities;
SIM_VoxelArray *newvelocityu;
SIM_VoxelArray *newvelocityv;
int gridsize = getGridSize();

newdensities = SIM_DATA_CREATE(object, “newDensities”, SIM_VoxelArray, 0);
newdensities->makeEqual(&densities);
newvelocityu = SIM_DATA_CREATE(object, “newVelocityu”, SIM_VoxelArray, 0);
newvelocityu->makeEqual(&velocityu);
newvelocityv = SIM_DATA_CREATE(object, “newVelocityv”, SIM_VoxelArray, 0);
newvelocityv->makeEqual(&velocityv);

vel_step(gridsize - 2,
newvelocityu->getVoxelArray(), newvelocityv->getVoxelArray(),
velocityu.getVoxelArray(), velocityv.getVoxelArray(),
getViscosity(), timestep);
dens_step(gridsize - 2,
newdensities->getVoxelArray(), densities.getVoxelArray(),
newvelocityu->getVoxelArray(), newvelocityv->getVoxelArray(),
getDiffusion(), timestep);

object.moveNamedSubData(“newDensities”, “Densities”);
object.moveNamedSubData(“newVelocityu”, “Velocityu”);
object.moveNamedSubData(“newVelocityv”, “Velocityv”);
}




  • Quick Links