Пример #1
0
    def execute(self, *args):
        from Foam import FOAM_VERSION
        if FOAM_VERSION(">=", "020000"):
            self._executionFrame["forceWrite"] = args[0]
            # print "forceWrite = ", self._executionFrame[ "forceWrite" ]
            pass

        # print "execute = \"%s\"" % ( self._executeCode )
        exec self._executeCode in self._executionFrame

        if FOAM_VERSION(">=", "020000"):
            del self._executionFrame["forceWrite"]
            pass

        return True
Пример #2
0
def entry_point():
    from Foam import FOAM_VERSION
    if FOAM_VERSION("<", "010500"):
        import sys
        argv = sys.argv
        return main_standalone(len(argv), argv)
    else:
        from Foam.OpenFOAM import ext_Info
        ext_Info(
        ) << "\n\n To use this solver it is necessary to SWIG OpenFOAM-1.4.X\n"
        pass
    pass
Пример #3
0
            runTime.write()

            pass

        ext_Info() << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << \
              "  ClockTime = " << runTime.elapsedClockTime() << " s" << nl << nl

        pass

    ext_Info() << "End\n" << nl

    import os
    return os.EX_OK


#--------------------------------------------------------------------------------------
from Foam import FOAM_VERSION
if FOAM_VERSION(">=", "010700"):
    if __name__ == "__main__":
        import sys, os
        argv = sys.argv
        os._exit(main_standalone(len(argv), argv))
        pass
else:
    from Foam.OpenFOAM import ext_Info
    ext_Info(
    ) << "\n\n To use this solver it is necessary to SWIG OpenFOAM-1.7.0\n"
    pass

#--------------------------------------------------------------------------------------
Пример #4
0
## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.
##
## See http://sourceforge.net/projects/pythonflu
##
## Author : Alexey PETROV
##

#--------------------------------------------------------------------------------------
from Foam import FOAM_REF_VERSION, FOAM_VERSION
if FOAM_REF_VERSION("==", "010701"):
    from porousSimpleFlux.r1_7_1 import *
    pass

#--------------------------------------------------------------------------------------
if FOAM_VERSION("==", "020000") or FOAM_REF_VERSION("==", "020001"):
    from porousSimpleFlux.r2_0_0 import *
    pass

#--------------------------------------------------------------------------------------
if FOAM_VERSION(">=", "020100"):
    from porousSimpleFlux.r2_1_0 import *
    pass


#--------------------------------------------------------------------------------------
def entry_point():
    try:
        engine = main_standalone
    except NameError:
        print
Пример #5
0
##
## See http://sourceforge.net/projects/pythonflu
##
## Author : Alexey PETROV
##

#---------------------------------------------------------------------------
from Foam.src.OpenFOAM.fields.tmp.autoPtr_incompressible_turbulenceModel import *

from Foam.src.OpenFOAM.fields.tmp.autoPtr_incompressible_RASModel import *

from Foam.src.OpenFOAM.fields.tmp.autoPtr_incompressible_LESModel import *

#---------------------------------------------------------------------------
from Foam import FOAM_VERSION, FOAM_BRANCH_VERSION, FOAM_REF_VERSION
if FOAM_VERSION("<=", "010401"):
    turbulenceModel = incompressible_turbulenceModel
    autoPtr_turbulenceModel = autoPtr_incompressible_turbulenceModel
    pass

#---------------------------------------------------------------------------
if FOAM_REF_VERSION("==", "010500") or FOAM_BRANCH_VERSION(
        "dev", "==", "010500"):
    RASModel = incompressible_RASModel
    autoPtr_RASModel = autoPtr_incompressible_RASModel

    LESModel = incompressible_LESModel
    autoPtr_LESModel = autoPtr_incompressible_LESModel
    pass

#----------------------------------------------------------------------------
Пример #6
0
            pass

        runTime.write()

        ref.ext_Info() << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << \
              "  ClockTime = " << runTime.elapsedClockTime() << " s" << ref.nl << ref.nl

        pass

    ref.ext_Info() << "End\n" << ref.nl

    import os
    return os.EX_OK


#--------------------------------------------------------------------------------------
from Foam import FOAM_VERSION
if FOAM_VERSION(">=", "020000"):
    if __name__ == "__main__":
        import sys, os
        argv = sys.argv
        os._exit(main_standalone(len(argv), argv))
        pass
    pass
else:
    ref.ext_Info(
    ) << "\n\n To use this solver it is necessary to SWIG OpenFOAM-2.0.0 or higher\n"
    pass

#--------------------------------------------------------------------------------------
Пример #7
0
        turbulence.correct()

        runTime.write()

        ext_Info() << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << \
              "  ClockTime = " << runTime.elapsedClockTime() << " s" << nl << nl

        pass

    ext_Info() << "End\n" << nl

    import os
    return os.EX_OK


#--------------------------------------------------------------------------------------
from Foam import FOAM_VERSION
if FOAM_VERSION("==", "010600"):
    if __name__ == "__main__":
        import sys, os
        argv = sys.argv
        os._exit(main_standalone(len(argv), argv))
        pass
else:
    from Foam.OpenFOAM import ext_Info
    ext_Info(
    ) << "\nTo use this solver, It is necessary to SWIG OpenFoam1.6 \n "
    pass

#--------------------------------------------------------------------------------------
Пример #8
0
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.
##
## See http://sourceforge.net/projects/pythonflu
##
## Author : Alexey PETROV
##

#--------------------------------------------------------------------------------------
from Foam import FOAM_VERSION
if FOAM_VERSION("==", "010600"):
    from boundaryFlux.r1_6 import *
    pass

#--------------------------------------------------------------------------------------
if FOAM_VERSION("==", "010700") or FOAM_VERSION("==", "010701"):
    from boundaryFlux.r1_7_0 import *
    pass

#--------------------------------------------------------------------------------------
if FOAM_VERSION(">=", "020000"):
    from boundaryFlux.r2_0_0 import *
    pass


#--------------------------------------------------------------------------------------
Пример #9
0
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.
##
## See http://sourceforge.net/projects/pythonflu
##
## Author : Alexey PETROV
##

#--------------------------------------------------------------------------------------
from Foam import FOAM_VERSION, FOAM_REF_VERSION, FOAM_BRANCH_VERSION
if FOAM_VERSION("==", "010500"):
    from chtMultiRegionFlux.r1_5 import *
    pass

#--------------------------------------------------------------------------------------
if FOAM_REF_VERSION('==', "010600"):
    from chtMultiRegionFlux.r1_6 import *
    pass

#--------------------------------------------------------------------------------------
if FOAM_BRANCH_VERSION("dev", '>=', "010600"):
    from chtMultiRegionFlux.r1_6_dev import *
    pass

#--------------------------------------------------------------------------------------
if FOAM_REF_VERSION('==', "010700"):
Пример #10
0
        
        turbulence.correct()
        runTime.write()

        ref.ext_Info() << "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << \
              "  ClockTime = " << runTime.elapsedClockTime() << " s" << ref.nl << ref.nl
        
        pass

    ref.ext_Info() << "End\n"

    import os
    return os.EX_OK


#--------------------------------------------------------------------------------------
import sys, os
from Foam import FOAM_VERSION
if FOAM_VERSION( ">=", "020101" ):
   if __name__ == "__main__" :
      argv = sys.argv
      os._exit( main_standalone( len( argv ), argv ) )
      pass
   pass   
else:
   from Foam.OpenFOAM import ext_Info
   ref.ext_Info()<< "\nTo use this solver, It is necessary to SWIG OpenFoam2.1.1 or higher \n "

   
#--------------------------------------------------------------------------------------
Пример #11
0
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.
##
## See http://sourceforge.net/projects/pythonflu
##
## Author : Alexey PETROV
##

#--------------------------------------------------------------------------------------
from Foam import FOAM_VERSION, FOAM_BRANCH_VERSION, FOAM_REF_VERSION
if FOAM_VERSION("<=", "010401"):
    from simpleFlux.r1_4_1_dev import *
    pass

#------------------------------------------------------------------------------------
if FOAM_VERSION("==", "010500"):
    from simpleFlux.r1_5 import *
    pass

#------------------------------------------------------------------------------------
if FOAM_REF_VERSION("==", "010600"):
    from simpleFlux.r1_6 import *
    pass

#--------------------------------------------------------------------------------------
if FOAM_BRANCH_VERSION("dev", ">=", "010600"):
Пример #12
0
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.
##
## See http://sourceforge.net/projects/pythonflu
##
## Author : Alexey PETROV
##

#--------------------------------------------------------------------------------------
from Foam import FOAM_VERSION
if FOAM_VERSION(">=", "010600") and FOAM_VERSION("<=", "010701"):
    from shallowWaterFlux.r1_6 import *
    pass

#--------------------------------------------------------------------------------------
from Foam import FOAM_VERSION
if FOAM_VERSION("==", "020000") or FOAM_VERSION("==", "020001"):
    from shallowWaterFlux.r2_0_0 import *
    pass

#--------------------------------------------------------------------------------------
from Foam import FOAM_VERSION
if FOAM_VERSION(">=", "020100"):
    from shallowWaterFlux.r2_1_0 import *
    pass
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.
##
## See http://sourceforge.net/projects/pythonflu
##
## Author : Alexey PETROV, Andrey SIMURZIN
##

#--------------------------------------------------------------------------------------
from Foam import FOAM_VERSION
if FOAM_VERSION('>=', "020101"):
    from adjointShapeOptimizationFlux.r2_1_1 import *
    pass


#--------------------------------------------------------------------------------------
def entry_point():
    try:
        engine = main_standalone
        pass
    except NameError:
        print
        print "There is no implementation of the current OpenFOAM version"
        print
        import os
        os._exit(os.EX_OK)
Пример #14
0
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
## 
## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses/>.
## 
## See http://sourceforge.net/projects/pythonflu
##
## Author : Alexey PETROV, Andrey SIMURZIN
##


#--------------------------------------------------------------------------------------
from Foam.src.OpenFOAM.fields.tmp.autoPtr_dynamicFvMesh import dynamicFvMesh


#---------------------------------------------------------------------------
from Foam import FOAM_VERSION
if FOAM_VERSION( "<", "020000" ):
    dynamicFvMesh.defaultRegion = dynamicFvMesh.defaultRegion.fget()
    dynamicFvMesh.meshSubDir = dynamicFvMesh.meshSubDir.fget()
    pass

    
#---------------------------------------------------------------------------
Пример #15
0
## Author : Alexey PETROV
##

#--------------------------------------------------------------------------------------
from Foam import FOAM_VERSION, FOAM_REF_VERSION, FOAM_BRANCH_VERSION
if FOAM_REF_VERSION(">=", "010600") and FOAM_REF_VERSION("<=", "010701"):
    from nonNewtonianIcoFlux.r1_6 import *
    pass

#--------------------------------------------------------------------------------------
if FOAM_BRANCH_VERSION("dev", ">=", "010600"):
    from nonNewtonianIcoFlux.r1_6_dev import *
    pass

#--------------------------------------------------------------------------------------
if FOAM_VERSION(">=", "020000") and FOAM_VERSION("<=", "020100"):
    from nonNewtonianIcoFlux.r2_0_0 import *
    pass

#--------------------------------------------------------------------------------------
if FOAM_VERSION(">=", "020101"):
    from nonNewtonianIcoFlux.r2_1_1 import *
    pass


#--------------------------------------------------------------------------------------
def entry_point():
    try:
        import sys
        argv = sys.argv
        return main_standalone(len(argv), argv)