Skip to content

Inflow boundary Setting

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #6743

    Hello all, I am trying to analyze the flow field around a car using the “DriveAER model”.
    I have created an analysis file that reads and calculates a stl file based on the cylinder3d case in the Examples folder. The file is modified as follows, mainly where the material numbers are set.

    void prepareGeometry( UnitConverter<T,DESCRIPTOR> const& converter, IndicatorF3D<T>& indicator,
    STLreader<T>& stlReader, SuperGeometry<T,3>& superGeometry )

    OstreamManager clout( std::cout, “prepareGeometry” );
    clout << “Prepare Geometry …” << std::endl;

    superGeometry.rename( 0,2,indicator );
    superGeometry.rename( 2,1,stlReader ); superGeometry;

    Vector<T,3> origin = superGeometry.getStatistics().getMinPhysR( 2 );
    origin[1] += converter.getConversionFactorLength()/2..;
    origin[2] += converter.getConversionFactorLength()/2;

    Vector<T,3> extend = superGeometry.getStatistics().getMaxPhysR( 2 );
    extend[1] = extend[1]-origin[1]-converter.getConversionFactorLength()/2;
    extend[2] = extend[2]-origin[2]-converter.getConversionFactorLength()/2;

    // Set material number for cylinder
    origin[0] = superGeometry.getStatistics().getMinPhysR( 2 )[0]+4*converter.getConversionFactorLength();
    extend[0] = superGeometry.getStatistics().getMaxPhysR( 2 )[0]-4*converter.getConversionFactorLength();
    std::shared_ptr<IndicatorF3D<T>>> cylinder = std::make_shared<IndicatorCuboid3D<T>>( extend, origin );
    superGeometry.rename( 2,5, cylinder );

    // Set material number for inflow
    origin[0] = superGeometry.getStatistics().getMinPhysR( 2 )[0]-converter.getConversionFactorLength();
    extend[0] = 2*converter.getConversionFactorLength();
    IndicatorCuboid3D<T> inflow( extend,origin );
    superGeometry.rename( 2,3,inflow );

    // Set material number for outflow
    origin[0] = superGeometry.getStatistics().getMaxPhysR( 2 )[0]-converter.getConversionFactorLength();
    extend[0] = 2*converter.getConversionFactorLength();
    IndicatorCuboid3D<T> outflow( extend,origin );
    superGeometry.rename( 2,4,outflow );

    // Removes all not needed boundary voxels outside the surface


    clout << “Prepare Geometry … OK” << std::endl;

    When this file is run, it outputs a range of material numbers as follows.
    [SuperGeometryStatistics3D] materialNumber=0; count=4359079; minPhysR=(-0.786111,-0.986111,-0.297222); maxPhysR=(3.79167,0.991667,1.08056)
    [SuperGeometryStatistics3D] materialNumber=1; count=287421422; minPhysR=(-5.00833,-2.50833,-0.497222); maxPhysR=(14.9917,2.50278,3.49167)
    [SuperGeometryStatistics3D] materialNumber=2; count=2477640; minPhysR=(-5.00833,-2.50833,-0.508333); maxPhysR=(15.0028,2.50278,3.50278)
    [SuperGeometryStatistics3D] materialNumber=3; count=103952; minPhysR=(-5.00833,-2.49722,-0.497222); maxPhysR=(-5.00833,2.49167,3.49167)
    [SuperGeometryStatistics3D] materialNumber=4; count=162000; minPhysR=(15.0028,-2.49722,-0.497222); maxPhysR=(15.0028,2.49167,3.49167)
    [SuperGeometryStatistics3D] materialNumber=5; count=326355; minPhysR=(-0.797222,-1.00833,-0.308333); maxPhysR=(3.80278,1.01389,1.09167)

    However, material number 3, the inflow boundary, is not uniformly valued at the inflow boundary, leaving material number 2 for y<0 and z<1.5. Therefore, the calculation cannot be performed.
    Could you please tell me how to solve this problem? I could not find a good way to set the material number in complex geometries by referring to the documentation.


    You can set materials by the the rename functions unsing IndicatorFunctors that are large enough to include the domain wanted.

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