Britton Ward 0 Report post Posted June 23, 2016 Hi, I've been connecting some OpenFOAM files and I wondered if it was possible to dynamically Comment or Uncomment a series of lines in an input file template. For example in the attached U file the specification for the boundary conditions changes depending on the inflow velocity vector. Depending on the value of Yaw I would like to comment/uncomment select lines. Is there a way to implement this type of edit efficiently in CAESES? Britt /*--------------------------------*- C++ -*----------------------------------*\| ========= | || \\ / F ield | OpenFOAM: The Open Source CFD Toolbox || \\ / O peration | Version: 2.4.x || \\ / A nd | Web: www.OpenFOAM.com || \\/ M anipulation | |\*---------------------------------------------------------------------------*/FoamFile{ version 2.0; format ascii; class volVectorField; location "0"; object U;}// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "include/initialConditions" dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField{ minX { type zeroGradient; } maxX { type rampedVelocity; finalVelocity $flowVelocity; rampingTime $rampTime; rampingScheme $rampScheme; value $internalField; } minY { // yaw <= 0deg type zeroGradient; // // yaw > 0deg// type rampedVelocity;// finalVelocity $flowVelocity;// rampingTime $rampTime;// rampingScheme $rampScheme;// value $internalField; } maxY { // yaw >= 0deg type zeroGradient; // // yaw < 0deg// type rampedVelocity;// finalVelocity $flowVelocity;// rampingTime $rampTime;// rampingScheme $rampScheme;// value $internalField; } minZ { type zeroGradient; } maxZ { type zeroGradient; } ship { type movingWallVelocity; value uniform (0 0 0); }} // ************************************************************************* // Share this post Link to post Share on other sites
Stefan Wunderlich 6 Report post Posted June 24, 2016 Hi Brit, I attached a simple project where I use a feature to return a string depending on an input value.You get simple line and block commenting by using this as value of entries. This should do the job. Cheers,Stefan comment.fdb Share this post Link to post Share on other sites