mikaem / Oasis

54 stars 49 forks source link

LES model, Wale: question regarding derived_bcs #30

Open Tom303-afk opened 4 years ago

Tom303-afk commented 4 years ago

Dear all,

In my current project I would like to make use of the Wale model, however I get stuck at the following part of the Wale setup:

ff = MeshFunction("size_t", mesh, mesh.topology().dim() - 1, 0)
bcs_nut = derived_bcs(CG1, bcs['u0'], u_)
nut_ = CG1Function(nut_form, mesh, method=nut_krylov_solver,
                   bcs=bcs_nut, name='nut', bounded=True)
return dict(Sij=Sij, Sd=Sd, Skk=Skk, nut_=nut_, delta=delta, bcs_nut=bcs_nut)

The error I get is as follows: Traceback (most recent call last): File "NSfracStep1.py", line 134, in vars().update(les_setup(**vars())) File "/home/tom/anaconda3/lib/python3.7/site-packages/oasis-2018.1-py3.7.egg/oasis/solvers/NSfracStep/LES/Wale.py", line 37, in les_setup bcs_nut = derivedbcs(CG1, bcs['u0'], u) File "/home/tom/anaconda3/lib/python3.7/site-packages/oasis-2018.1-py3.7.egg/oasis/solvers/NSfracStep/LES/common.py", line 27, in derived_bcs subdomain = bc.user_sub_domain() AttributeError: 'DirichletBC' object has no attribute 'user_sub_domain'

The problem seems to be I have no attribute user_sub_domain in my bcs, in the common.py file in the LES folder this is used as follows: for i, bc in enumerate(original_bcs): subdomain = bc.user_sub_domain() new_bcs.append(DirichletBC(V, Constant(0), subdomain))

My question is: Can I circumvent this error or solve the issue? I fail to solve it myself as with my lack of experience I do not understand the purpose of the function "derived_bcs".

Kind regards