-
Notifications
You must be signed in to change notification settings - Fork 32
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
Factory-generated boundary conditions with new case file interface [Preview] #1264
base: develop
Are you sure you want to change the base?
Conversation
Should we align the new BC's with the submodule structure we introduced recently before we merge this in? |
I don't think we need submodules for bc, unless we have some redundant factories that are in a separate file. |
Well this PR introduces a bc factory. |
submodules it is. I just feel that for proper derived types, like dirichlet_t, it's good to have it in a own module |
I am not sure i follow. Do you suggest that |
I mean like for ksp_t, base definition in one module, and factory in a submodule. But for the different flavours like cg and gmres, full modules are fine |
I see, yes that makes sense. It would just be to have a factory for the abstract BC type in a submodule and then all the specializations are regular modules. Sounds good to me. |
Hi, yes, I will have it in a submodule eventually! |
Dear all, I think I've accumulated enough changes to launch this preview of the new bc handling. It is now almost fully implemented for the scalar (excluding the user field Dirichlet), but not yet for the fluid, therefore the don't merge. I do want the CI to run through, to see what complaints, I guess.
Major changes
The
bc_t
typeinit
. Takesjson_file
andcoef_t
. Some derived types now use this to parse the JSON they need, e.g. the Dong condition, the Blasius, etc.init_from_componets
in order to construct without JSON.finalize
. Most types just call thefinalize_base
inbc_t
, butsymmetry
andnon_normal
run their logic for determining the normal direction here.bc_list
to do that. I haven't actually used this yet, so maybe these will be removed later on.step
routines for the solvers, we need to be able to distinguish between weak and strong bcs. Sobc_t
no has an additional componentstrong = .true.
to mark a bc as strong or weak.The
bc_list_t
typebc_list_add
are now TBPs, which simplifiesuse
statements quite a bit, and is generally the way to go.field_list_t
. Some differences remain though, e.g. for thebc_list
we track both the capacity of the list and the number of allocated items. We need to think a bit more about this.apply_
routines are augmented with an optionalstrong
parameter, which will lead to only applying strong or weak bcs. As a result, we can use a single list to store all the bcs and then call apply with eitherstrong=.true.
orstrong=.false.
when needed in thestep
routines.The
zero_dirichlet_t
typeThis is a rebranding of what used to the
noslip_wall
. The bc just assigns both vectors and scalars to zero. What I realized is that we have a lot of places in the code where we use a zero-valued Dirichlet for the purpose of marking boundaries for the linear solver routines. Usingzero_dirichlet_t
helps with clarity there.The
bc_factory
subroutinescheme
. So perhaps, what will happen is that eachscheme
has its own factory.field_dirichlet_t
yet.The
scalar_scheme_t
typebc_list
calledbcs
to store the boundary conditions and constructs them with a factory. This results in quite a bit of cleanup here and there.bclabels
.boundary_conditions
is used, which is an array of JSON objects, similar to how we do sources and simcomps. Each object has thetype
andzone_index
keyword + other keywords needed, for that type.Remaining work
fluid_scheme
. I don't think it will become as "clean" as scalar because there are quite a bit of auxiliary bcs that are defined and will probably remain as additional components of the type.