CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [PyFoam] dimensionedScalar parameters (https://www.cfd-online.com/Forums/openfoam-community-contributions/181963-dimensionedscalar-parameters.html)

mbookin December 26, 2016 10:10

dimensionedScalar parameters
 
Hello!

I'm trying to change parameters of the case using pyFoam. Here is the part of my python script:
Code:

for laserPower in [400,800,900]:
    print "laserPower:",laserPower
    case=orig.cloneCase("CASE_%f"%laserPower).name
    transport=ParsedParameterFile(path.join(case,
                                            "constant",
                                            "thermalProperties"))
    transport["laserPower"]=laserPower
    transport.writeFile()

The thing is that my program needs laserPower to be dimensionedScalar, but pyFoam makes it a scalar. Of course I can make my programm not to be so discriminating, but may be pyFoam can parse dimensionedScalars?? Does anybody know how to do that?


All times are GMT -4. The time now is 23:43.