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

CHT tutorials for OpenFOAM and CalculiX #104

Closed
wants to merge 45 commits into from

Conversation

prasadadhav
Copy link

I have added the OpenFOAM+CalculiX CHT case, which have some issues from CalculiX side.
I took the general setup of the flap case from the FSI.

I have adapted the CHT part similar to the heat-exchanger case.

I am currently working on making a flow over the heat plate case similar to OF+Nutils. I will push as soon as I am done, working towards Issue #103 .

@prasadadhav
Copy link
Author

I have set up a case for flow over hot plate, but in this case as well I am getting a same error as mention here.

Starting CHT analysis via preCICE...
About to enter preCICE setup in Calculix with names CalculiX and config.yml 
Setting up preCICE participant CalculiX, using config file: config.yml
---[precice]  This is preCICE version 2.1.0
---[precice]  Revision info: v2.1.0-2-g42abc38c
---[precice]  Configuring preCICE with configuration "./precice-config.xml"
---[precice]  I am participant "CalculiX"
Set ID Found 
Read data 'Temperature' found.
---[precice] ERROR:  The given Mesh ID "-1" is unknown to preCICE.

Next, I will try and reinstall the CalculiX adapter because I think at least the tried heat exchanger should have worked.

@prasadadhav
Copy link
Author

prasadadhav commented Sep 7, 2020

The only thing to edit in the CalculiX part now is the material properties (to be consistent with the benchmark case).
Edit: could not really find the material properties anywhere.

*MATERIAL, Name=EL
** Material Properties
*ELASTIC
 400000, 0.3
*DENSITY
 3000
*SPECIFIC HEAT
446
*CONDUCTIVITY
50.,0

Hopefully, this is of help.

@KyleDavisSA
Copy link
Contributor

I tried setting up the case as well and got segmentation faults using Heat-Flux and Temperature data types in the config.yml file. Did you experience this? I am going to look into this and open an issue if I find a problem. Perhaps I made a mistake in the setup of the problem.

@MakisH MakisH changed the base branch from master to develop September 7, 2020 19:25
@KyleDavisSA
Copy link
Contributor

Is this meant to be for the flow over a plate CHT problem?

@prasadadhav
Copy link
Author

Is this meant to be for the flow over a plate CHT problem?

@KyleDavisSA Yes. There is also one case which is modified FSI flap case.

I tried setting up the case as well and got segmentation faults using Heat-Flux and Temperature data types in the config.yml file. Did you experience this? I am going to look into this and open an issue if I find a problem. Perhaps I made a mistake in the setup of the problem.

No, I did not face this issue. Seems to be something else than what I am getting.

@KyleDavisSA
Copy link
Contributor

Read data 'Temperature' found.
---[precice] ERROR: The given Mesh ID "-1" is unknown to preCICE.

I got the same error. The Heat-Flux needs to be defined on a surface, so it requires the interface.sur file to be defined. The temperature on a surface also needs to be given, so the boundary condition Sink-Temperature should probably be used here instead of Temperature. Could you supply the interface.sur file ot check if this is correct?

@precice-bot
Copy link
Collaborator

This pull request has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/precice-mesh-id-1-error-openfoam-calculix-cht/313/11

@prasadadhav
Copy link
Author

prasadadhav commented Sep 16, 2020

I was able to make the flow over plate example work, with Sink-Temperature and Heat-Flux.
I used the default CalculiX adapter(with CCX v2.16) without any modifications.

I was also able to run the Heat exchanger tutorial with the new adapter.
Edit: Note The top is Velocity field, bottom is Temperature field.
result-success_t=1
result-success_t=10

You may see that the results are a bit weird, but if you see the image below they make sense.
I will try and correct my CacluliX set-up. I think BC is not correctly applied.
Screenshot_20200916_120603

@prasadadhav
Copy link
Author

@MakisH I have cleaned up the cases to the best of my knowledge.
Let me know if I missed something.

I have kept the .nam, .dfl, .flm files unlike the usual tutorials because I haven't figured out how to write a script for exporting the extra files each time we run a case.

😄

@MakisH
Copy link
Member

MakisH commented Sep 24, 2020

Thank you for cleaning up, @Alphaoo1! We are now down to 226 changed files.

I see changes across multiple tutorials and I am confused on what is exactly the purpose of this PR. Is it to add the flow-over-plate scenario we have with OpenFOAM, but with OpenFOAM and CalculiX? If yes, could you please remove any changes not related to this tutorial?

Is the solver supposed to be buoyantPimpleFoam or chtMultiRegionFoam?

@prasadadhav
Copy link
Author

Thank you for cleaning up, @Alphaoo1! We are now down to 226 changed files.

I see changes across multiple tutorials and I am confused on what is exactly the purpose of this PR. Is it to add the flow-over-plate scenario we have with OpenFOAM, but with OpenFOAM and CalculiX? If yes, could you please remove any changes not related to this tutorial?

This PR is for flow over plate with OpenFOAM and CalculiX.
I removed the extra one I modified case I had in CHT. There should be 38 files from my case. I don't know why there are files popping up. I even tried to clone the current develop directory and add my case to it, but still, there are files that I did not modify. And I am a bit reluctant to touch these files since somebody else must have changed them and I am not sure what to keep and what to delete.
Some tips are welcome here. 😅

Is the solver supposed to be buoyantPimpleFoam or chtMultiRegionFoam?

The solver is buoyantPimpleFoam. I copied the Fluid part from the nutils directory.
I did not change anything other than the preCICEdict as far as I remember.

@MakisH
Copy link
Member

MakisH commented Sep 28, 2020

The additional files were there because your develop was a bit behind the precice:develop. I updated your branch and now there are 37 files, nice! 😄 I will now look into details.

Edit: how I did it:

# Also add the preCICE repository as a remote so we can pull from it
git remote add precice git@github.com:precice/tutorials.git

# Change to your develop and pull from the precice:develop
git checkout develop
git pull precice develop

# Change to your branch and merge from develop, then push
git checkout CHT_OF-CCX
git merge develop
git push origin CHT_OF-CCX

Copy link
Member

@MakisH MakisH left a comment

Choose a reason for hiding this comment

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

I have a few comments mostly for consistency with other tutorials, having another look at which CalculiX files we can remove (try moving them and running the case), and a few more important suggestions for the run scripts.

Keep up the hard work, we are getting there! 👍 👍

CHT/flow-over-plate/buoyantPimpleFoam-CalculiX/Allrun Outdated Show resolved Hide resolved
CHT/flow-over-plate/buoyantPimpleFoam-CalculiX/Allrun Outdated Show resolved Hide resolved
<use-data name="Heat-Flux"/>
</mesh>

<mesh name="Calculix_Mesh">
Copy link
Member

Choose a reason for hiding this comment

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

Inconsistency in the name style: OpenFOAM-Mesh vs Calculix_Mesh.

I suggest OpenFOAM-Mesh and CalculiX-Mesh.

CHT/flow-over-plate/buoyantPimpleFoam-CalculiX/Allrun Outdated Show resolved Hide resolved
@prasadadhav
Copy link
Author

@MakisH In a nutshell I made the following changes:

  • Updated the Allrun and Allclean scripts.
  • Updated the Readme.
  • Updated precice-config.xml
  • Removed the headers from Fluid participant.
  • Removed unecessary files from Solid directory.

As for the Solid participant and it's files, I have added things one can do to generate those files.
This may be used as a backup options if some file gets deleted.
But as for a new comer, or someone who is new to CalculiX I think these might be complicated.
I myself am not aware of how to write the pre-process.fbd file which creates all the files (similar to what we have in FSI tutorials).
I will let you know when I am able to do that, o may be you can mention someone with expertise in CalculiX.
Looking forward to your comments and suggestions.

Copy link
Member

@MakisH MakisH left a comment

Choose a reason for hiding this comment

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

Thank you for applying most of the suggestions already! Here are a few more ones (in most of them you can just apply the diff suggestions).

As for the Solid participant and it's files, I have added things one can do to generate those files.
This may be used as a backup options if some file gets deleted.
But as for a new comer, or someone who is new to CalculiX I think these might be complicated.

I agree that we should not assume previous CalculiX knowledge and I like that you added the steps in the README! 😄

I have not yet tried to run the tutorial, I will try after we resolve most of these points.

CHT/flow-over-plate/buoyantPimpleFoam-CalculiX/Allrun Outdated Show resolved Hide resolved
Comment on lines +66 to +74
# You can use CalculiX CGX to setup the structural simulation from sratch.
# This will re-generate the all.msh, fix1_beam.nam, interface_beam.nam files.
#
# # Prepare in silent mode
# echo "Preparing the ${Participant2} participant..."
# cd ${Participant2}
# echo " Executing cgx (provided by CalculiX, make sure this exists)..."
# cgx -bg pre_flap.fbd > prepare_flap.log 2>&1
# cd ..
Copy link
Member

Choose a reason for hiding this comment

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

To check: does this actually work in this case?

Copy link
Member

Choose a reason for hiding this comment

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

In the README it looks like this is the respective step:

cgx -c Mesh_Coarse_OUT.inp

CHT/flow-over-plate/buoyantPimpleFoam-CalculiX/Allrun Outdated Show resolved Hide resolved
CHT/flow-over-plate/buoyantPimpleFoam-CalculiX/Allrun Outdated Show resolved Hide resolved
CHT/flow-over-plate/buoyantPimpleFoam-CalculiX/Allrun Outdated Show resolved Hide resolved
* **OpenFOAM and OpenFOAM adapter:** To make sure that everything is working properly, you should run the [similar OpenFOAM-OpenFOAM tutorial case](https://github.com/precice/openfoam-adapter/wiki/Tutorial-for-CHT:-Flow-over-a-heated-plate).

### Generating CacluliX files
After installing the CalculiX adapter, CalculiX on it's own should also be available in the system. If not, an easy to use precomplied [tool](http://www.calculixforwin.com/) may be used to produced the required files (the commands remain same, use the pre-processing option).
Copy link
Member

Choose a reason for hiding this comment

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

This is actually not correct. It is not necessary to compile a "normal" CalculiX to compile ccx_preCICE.

Copy link
Author

Choose a reason for hiding this comment

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

I think may be my wording was not clear, I was trying to say the same, we do not need to install "normal" CalculiX.
Isn't it installed directly when we installed the adapter?

Copy link
Member

Choose a reason for hiding this comment

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

If one runs make only in the adapter's repository, no. The user only needs to have the CalculiX code somewhere. But I agree that a CalculiX user would also install the normal ccx.

CHT/flow-over-plate/buoyantPimpleFoam-CalculiX/README.md Outdated Show resolved Hide resolved
CHT/flow-over-plate/buoyantPimpleFoam-CalculiX/README.md Outdated Show resolved Hide resolved
Comment on lines 13 to 14
<data:scalar name="Sink-Temperature-0"/>
<data:scalar name="Heat-Flux"/>
Copy link
Member

Choose a reason for hiding this comment

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

But if you use Heat-Flux-0 everywhere (also in the OpenFOAM and CalculiX adapters), then it should work. The OpenFOAM adapter supports this.

@@ -0,0 +1,19 @@
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

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

Still needs to be deleted.

prasadadhav and others added 7 commits October 7, 2020 07:43
Co-authored-by: Gerasimos Chourdakis <chourdak@in.tum.de>
Co-authored-by: Gerasimos Chourdakis <chourdak@in.tum.de>
Co-authored-by: Gerasimos Chourdakis <chourdak@in.tum.de>
Co-authored-by: Gerasimos Chourdakis <chourdak@in.tum.de>
Co-authored-by: Gerasimos Chourdakis <chourdak@in.tum.de>
Co-authored-by: Gerasimos Chourdakis <chourdak@in.tum.de>
@@ -1,18 +1,10 @@
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

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

This is good, keep it! It makes it explicit that this is a Bash script.

Copy link
Member

Choose a reason for hiding this comment

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

I meant to delete the file ./Fluid/runFluid, since we also have the ./runFluid

@@ -1,5 +1,3 @@
#!/bin/bash
Copy link
Member

Choose a reason for hiding this comment

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

Same here: do not remove this line.

Comment on lines +1 to +3
nactdog

nacteq
Copy link
Member

Choose a reason for hiding this comment

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

What is this file for?

@MakisH
Copy link
Member

MakisH commented Apr 15, 2021

@Alphaoo1 we restructured the tutorials as a larger project https://github.com/orgs/precice/projects/5

This contribution is still quite important, but I think it woul dbe much easier to close this now and submit a new PR again, with the new structure in mind. Since now most files are already there (OpenFOAM case, README.md, scripts, precice-config.xml), you can just add a new solid-calculix case in the flow-over-heated-plate directory. You can also be the first one to try out the new contributing guidelines and see if they help.

Thank you once more already for the work so far, I am only closing this to keep a better overview of what is actively open.

@MakisH MakisH closed this Apr 15, 2021
@prasadadhav
Copy link
Author

@MakisH Yes, I will surely have a look at the contributions guidelines and see how can I contribute.
Currently busy with the comparisons of the XDEM+OF simulations for the proposal by Benjamin 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants