3D Periodic BCs

45 views
Skip to first unread message

jack urombo

unread,
Jul 7, 2022, 1:56:08 PM7/7/22
to deal.II User Group
I am trying to set periodic boundary conditions for a 3D problem like

velocity->set_periodic_boundary_condition(0, 1, 2);
  velocity->set_periodic_boundary_condition(2, 3, 1);
  pressure->set_periodic_boundary_condition(0, 1, 2);
  pressure->set_periodic_boundary_condition(2, 3, 1);

The boundary conditions are not matching and that i triggering errors.

How do you set the period BCs in 3D.

Daniel Arndt

unread,
Jul 7, 2022, 6:17:17 PM7/7/22
to dea...@googlegroups.com
Jack,

step-45 https://www.dealii.org/current/doxygen/deal.II/step_45.html provides an example for dealing with periodic boundary conditions. Even though it's a 2D example, the interface is the same in 3D.

Assuming that the arguments for your set_periodic_boundary_condition function are similar to the ones for GridTools::collect_periodic_faces and you use a unit cube with standard coloring, you probably want to call it with arguments 0,1,0 and 2,3,1 respectively.

Best,
Daniel

The information in this message is confidential and legally privileged. It is intended solely for the addressee(s). Access to this message by anyone else is unauthorized. If received in error, please accept our apologies and notify the sender immediately. You must also delete the original message from your machine. If you are not the intended recipient, any use, disclosure, copying, distribution or action taken in reliance of it, is prohibited and may be unlawful. The information, attachments, opinions or advice contained in this email are not the views or opinions of Harare Institute of Technology, its subsidiaries or affiliates. Although this email and any attachments are believed to be free of any virus or other defects which might affect any computer or IT system into which they are received, no responsibility is accepted by Harare Institute of Technology and/or its subsidiaries for any loss or damage arising in any way from the receipt or use thereof.

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/5eaf4f26-00dd-4e6d-841d-4a22e2328fb1n%40googlegroups.com.

jack urombo

unread,
Jul 8, 2022, 4:41:10 PM7/8/22
to deal.II User Group
After following Dan's advice the following exception is now thrown

----------------------------------------------------
Exception on processing:  
--------------------------------------------------------
An error occurred in line <595> of file </home/dealii/rotmhd/source/boundary_conditions.cc> in funct
ion
   void RMHD::Entities::VectorBoundaryConditions<dim>::set_neumann_bc(dealii::types::boundary_id, c
onst std::shared_ptr<dealii::TensorFunction<1, dim> >&, bool) [with int dim = 3; dealii::types::boun
dary_id = unsigned int]
The violated condition was:  
   !this->closed()
Additional information:  
   The boundary conditions have already been closed
--------------------------------------------------------
Aborting!
----------------------------------------------------


Jean-Paul Pelteret

unread,
Jul 10, 2022, 3:16:54 PM7/10/22
to dea...@googlegroups.com
Hi Jack,

The message that you’re seeing after fixing your first problem using Daniel’s advice is being emitted from your own code. Specifically, the set_neumann_bc() function in the class RMHD::Entities::VectorBoundaryConditions. You’ll have to inspect your code more carefully to understand what’s going wrong here.

Best,
Jean-Paul

Reply all
Reply to author
Forward
0 new messages