This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

how to get cbc.pdesys and cbc.rans to run on FEniCS

0 votes

I have difficulty to get CBC.RANS to run on newly installed FEniCS.

I am running DOLFIN 1.2.0 and latest CBCPDESys revno 102.
Here is how I installed the software. On July 20, 2013, I got the CBS.PDESYS through bzr branch lp:cbcpdesys. I assume that it is the development focus branch. On the same day, I also installed the FEniCS on Ubuntu through sudo add-apt-repository ppa:fenics-packages/fenics sudo apt-get update sudo apt-get install fenics sudo apt-get dist-upgrade.

I could run /pdesys/demo/CahnHilliard_demo.py, but could not run /pdesys/demo/Stokes_demo.py. It gave me the following error:
`

 This demo is unlikely to converge if PETSc is not configured with Hypre or ML.
 Ordering mesh.
 Elapsed time: 0.00400009 (generate unit cube mesh)
 *** -------------------------------------------------------------------------
 *** Warning: UnitCube has been deprecated in DOLFIN version 1.1.0.
 *** The class UnitCube has been replaced by UnitCubeMesh.
 *** -------------------------------------------------------------------------
 Traceback (most recent call last):
       File "Stokes_demo.py", line 76, in <module>
           solver = Stokes_Solver(mesh, solver_parameters)
       File "Stokes_demo.py", line 30, in __init__
PDESystem.__init__(self, [['u', 'p']], mesh, parameters)
       File "/home/xiaoping/Dropbox/Linux/cbc072013/cbcpdesys/cbc/pdesys/PDESystem.py", line 110, in __init__
self.setup()
       File "/home/xiaoping/Dropbox/Linux/cbc072013/cbcpdesys/cbc/pdesys/PDESystem.py", line 119, in setup
for bc in self.problem.boundaries:
  AttributeError: 'NoneType' object has no attribute 'boundaries'

'

When I ran /ransmodels/demo/turbulent-channel.py, it gives me the following error message:
`

Traceback (most recent call last):
  File "turbulent_channel.py", line 107, in <module>
        model=problem_parameters['turbulence_model'])
  File "/home/xiaoping/Dropbox/Linux/cbc072013/cbcpdesys/cbc/cfd/ransmodels/StandardKE_Coupled.py", line 20, in __init__
parameters=parameters)
  File "/home/xiaoping/Dropbox/Linux/cbc072013/cbcpdesys/cbc/cfd/ransmodels/TurbSolver.py", line 20, in __init__
PDESystem.__init__(self, system_composition, problem, parameters)
  File "/home/xiaoping/Dropbox/Linux/cbc072013/cbcpdesys/cbc/pdesys/PDESystem.py", line 110, in __init__
self.setup()
   File "/home/xiaoping/Dropbox/Linux/cbc072013/cbcpdesys/cbc/cfd/ransmodels/TurbSolver.py", line 30, in setup
self.bc = self.create_BCs(self.boundaries)
  File "/home/xiaoping/Dropbox/Linux/cbc072013/cbcpdesys/cbc/cfd/ransmodels/StandardKE_Coupled.py", line 27, in create_BCs
bcu['ke'].insert(i+1, QWall['ke'](self.V['ke'], bc, self.y, self.nu(0)))
  File "/home/xiaoping/Dropbox/Linux/cbc072013/cbcpdesys/cbc/cfd/tools/Wall.py", line 267, in __init__
Wallfunction.__init__(self, V, bc)
 File "/home/xiaoping/Dropbox/Linux/cbc072013/cbcpdesys/cbc/cfd/tools/Wall.py", line 60, in __init__
dofs[-1].difference_update(off_dofs.keys())
AttributeError: 'SwigPyObject' object has no attribute 'keys'

`

Similar errors occurs for other two RANS demos. Any thought on how to get this thing to work?
Can anyone could tell me which version of PDESys and which version of dolfin to use so they can work together? Also, how do I get the particular versions of the software?

Thanks,
Xiaoping.

asked Jul 22, 2013 by xpq FEniCS Novice (660 points)
edited Jul 23, 2013 by xpq

Please, edit your question using code environment for posting error message - this is unreadable.

Thanks for the suggestion. I revised the question with code environment.

Which version of FEniCS and CBC did you install?

I am not sure the precise version numbers, but I revised the question with more details about the installation. If I have to guess, it is the dev version of PDESYS on latest FEniCS release.

Run

python -c"import dolfin; print dolfin.__version__"

cd cbcpdesys
bzr revno

As Mikael said, combination of DOLFIN 1.2.0 and latest CBCPDESys revno 102 should work.

Thanks for the tip. I am running DOLFIN 1.2.0 and latest CBCPDESys revno 102.
I have just added the error message from running another demo in cbcpdesys.

1 Answer

+3 votes
 
Best answer

Hi,

For a brief period in development the off_process_owner map was not swigged correctly to python. I don't remember exactly when it was fixed, but PDESys should work with a newer version of dolfin. I use 1.2.0 and it runs just fine. If you have any further problems you could also ask at the pdesys mailing list.

Best regards

Mikael

answered Jul 23, 2013 by mikael-mortensen FEniCS Expert (29,340 points)
selected Jul 25, 2013 by Jan Blechta

Hi,

The Stokes demo error was a bug, thanks:-)

The other error is still due to an old dolfin though. I suggest you try the development version. See here: https://launchpad.net/~fenics-packages/+archive/fenics-dev

Mikael,

This does the trick!

Thanks,
Xiaoping.

Could I ask does PDESys work with current DOLFIN 1.6.0 or DOLFIN 1.4.0 ?
I tried to use the PDESys 1.0.0 distribution, but it seems to fail.
Thanks a lot!

PDESys has not been maintained for a while, so it does not work with a new dolfin. I think 1.3 was the last version working.

Thanks Mikeal, could I ask if there are any demos for a steady k-epsilon turbulent modelin your PDESys ?

Yes. In the cbc.cfd.ransmodels.demo folder.

Thanks, Mikeal. I am reading the three demos lying in the cbc.cfd.ransmodel.demo, but I have not found the stationary turbulent demo.

Let us take the turbulent_channel.py as an example, if I am going to implement my stationary demo, what are the variables in 'problem_parameters', 'solver_parameters' or 'rans_parameters' am I going to modify?

Thanks a lot!

...