-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Model solver data names in adapter schema #36
Comments
Hi, I was just about to write up this issue. Actually, there is one more thing I want to add / discuss (let me know if I should open a different issue for this). Namely, the
Alternatively, we can infer the operation from the Why is this needed? For example, a mixed boundary condition (and other derived BCs) requires both the value and the surface normal derivative. OpenFOAM provides methods to get or set either of them: Heat flux is not a separate field in OpenFOAM, but it is in preCICE. Right now it's hard coded, because we know that std::size_t preciceAdapter::CHT::HeatFlux::write(double* buffer, bool meshConnectivity, const unsigned int dim)
{
int bufferIndex = 0;
for (uint j = 0; j < patchIDs_.size(); j++)
{
int patchID = patchIDs_.at(j);
const scalarField gradientPatch(
(T_->boundaryField()[patchID])
.snGrad());
// [...] |
If we distinguish between:
then these would be generic and useful fields we could reuse in other adapters, no? Probably the I have the feeling that if we had this information, our adapters could also be simplified, as some of the hard-coded cases would be offloaded to the user (or the config generator). |
@MakisH |
Yes, these could be the same. The operation could be a |
I personally, like idea A to specify in the config file rather than hard-coding it. Elmer adapter then can be designed to be variable agnostic and let the translation happen in the .xml config file. |
I am tending towards option A rather than B. We would need something like this for adapters of commercial software too. |
Is there not a very similar situation for meshes as well? In the OpenFOAM there is a 1-to-1 connection between
should become
(I'm not sure if I'm using the different kinds of brackets correctly but I'm assuming |
IIRC, "Interface1" is a name that is actually never used in the OpenFOAM adapter. We currently have in the schema: "patches": {
"type": "array",
"description": "List of mesh or geometry patches (boundary or volume) to locate the interface.",
"items": {
"type": "string",
"minLength": 1
},
"minItems": 1
},
"location": {
"type": "string",
"description": "Further specification of mesh locations",
"minLength": 1,
"examples": [
"faceCenters",
"volumeCenters",
"faceNodes",
"nodes"
]
} "patches" and "location" came originally from the OpenFOAM adapter, but are general IMO. |
The first implementation of the configuration of the OpenFOAM adapter was in YAML, where we had something like: interfaces:
- mesh: Fluid-Mesh
patches: [interface]
write-date: Temperature
read-data: Heat-Flux as already used in other adapters at the time. YAML offers lists, and that's why we used that. We then converted the format to a dictionary (precice/openfoam-adapter#105), that defines a list of dictionaries as interfaces. The related restriction from that PR description:
I am not aware of examples where the name of the dictionary is actually used or how it could be read. I think it might even have some strict naming rules. @vidulejs could you please do some research on this? I agree that the |
For some solvers, it seems that the current
write_data_names
andread_data_names
are not sufficient. On top, another name field is needed to identify the data field within the solver.Option A: Specify solver name in config
solver_name
could be optional.Option B: Hard-code solver name in adapter
This is how we currently handle things in the OpenFOAM adapter, for example.
Connected issues, PRs, and examples:
The text was updated successfully, but these errors were encountered: