Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slight update to field_dirichlet bcs #1261

Merged
merged 10 commits into from
May 12, 2024
Merged

Slight update to field_dirichlet bcs #1261

merged 10 commits into from
May 12, 2024

Conversation

timofeymukha
Copy link
Collaborator

My main goal here is to reduce the number of additional components in the scheme types necessary to add the user field_dirichlet bcs. Currently we need the bc itself, a field list for the dummy fields in the bc, a bc_list to store the field_dirichlet bcs themselves, and an update procedure pointer to the user routine.

To trim this down, I put most of these things inside the field_dirichlet types themselves. The only extra thing still in the scalar_scheme is the bc_list. I did not quite dare to add a bc_list to a type to store.. a pointer to itself. However, for the field_dirichlet_vector I could store the bc_list, it just contains the 3 field_dirichlet_bcs that are stored as components inside field_dirichlet_vector.

For the fluid, I use the lists in velocity field_dirichlet to also store the field and bc for the pressure. I also use it to store the update pointer.

Also adds some extra routines to the field_list wrapper.

As a note, the way things are handled for the field_dirichlet_vector is a bit scary, because we always add the dummy fields for u,v,w,p, even when they are not initialized due to the fact that the bc for them is not asked for in the case file. So, if you point to those uninitialized fields in the user routine, things will crash. I have not addressed this here.

@timofeymukha timofeymukha added the enhancement New feature or request label Apr 29, 2024
Copy link
Collaborator

@njansson njansson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, the only minor thing is the user_bc_ name in fluid_scheme, not it kind of reads like field_dirichlet is the only user provided bc. I could be wrong, haven't followed the latest bc work too closely.

@timofeymukha
Copy link
Collaborator Author

Looks good, the only minor thing is the user_bc_ name in fluid_scheme, not it kind of reads like field_dirichlet is the only user provided bc. I could be wrong, haven't followed the latest bc work too closely.

There is also the pointwise user inflow bc, which hides in bc_inflow. My idea was that it will be removed anyway, but it seems we want to keep those, so you have a point. I can change to user_field_bc... to distinguish them for now, perhaps.

@timofeymukha
Copy link
Collaborator Author

timofeymukha commented May 6, 2024

Looks good, the only minor thing is the user_bc_ name in fluid_scheme, not it kind of reads like field_dirichlet is the only user provided bc. I could be wrong, haven't followed the latest bc work too closely.

Added field

@timofeymukha timofeymukha requested a review from njansson May 7, 2024 11:46
Copy link
Collaborator

@vbaconnet vbaconnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks much cleaner now, thanks!! As I said at some point we should only pass down the fields that are initialized to the user_dirichlet_update, but for now I guess this is fine?

src/fluid/fluid_scheme.f90 Show resolved Hide resolved
@timofeymukha timofeymukha merged commit 9fdd284 into develop May 12, 2024
24 checks passed
@njansson njansson deleted the feature/field_bcs branch May 12, 2024 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants