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

Fem: Load heat flux from CalculiX results - fixes #12117 #14019

Merged
merged 1 commit into from
May 20, 2024

Conversation

marioalexis84
Copy link
Member

Fixes #12117.
The heat flux values are saved in the HeatFlux property of the FemResult object.
The visualization is accesible from the pipelines.

@FEA-eng

@github-actions github-actions bot added the WB FEM Related to the FEM Workbench label May 15, 2024
@marioalexis84 marioalexis84 marked this pull request as ready for review May 15, 2024 04:34
@FEA-eng
Copy link
Contributor

FEA-eng commented May 15, 2024

Thanks, it works as expected. But it seems that one test needs to be updated:

AssertionError: 'Comparing /usr/local/Mod/Fem/femtest/data/calculix/thermomech_bimetall.inp to /tmp/FEM_unittests/ccxtools_thermomech_bimetall_13ac396c1aca/Mesh.inp failed!\n@@ -7114 +7114 @@\n-S, E\n+S, E, HFL\n' is not false : ccxtools write_inp_file test failed.

@marioalexis84
Copy link
Member Author

Note that heat flux unit is $\frac{kW}{m^2}$.

@FEA-eng
Copy link
Contributor

FEA-eng commented May 15, 2024

Note that heat flux unit is kW/m2.

With the input deck always in SI(mm) I would expect CalculiX to output it in mW/mm^2 and FreeCAD to convert it to SI(m) so W/m^2. Does it have to use kW instead of W?

@marioalexis84
Copy link
Member Author

There is no coversion. Internally only displacements are converted from mm to m (the lengths are assumed to be in mm).
But this hardcoded in the function that load the data for the pipeline.
We need to fix this and and units issues in fem in general.

@FEA-eng
Copy link
Contributor

FEA-eng commented May 15, 2024

There is no coversion. Internally only displacements are converted from mm to m (the lengths are assumed to be in mm). But this hardcoded in the function that load the data for the pipeline. We need to fix this and and units issues in fem in general.

I don't know how the result handling works internally but the effect is that all outputs in FreeCAD FEM are in SI(m) so displacements are in m, stresses in Pa and so on. This is definitely annoying in mechanical analyses and was introduced only to fix the issues with electromagnetic ones. It would be best to offer an option to change the units in results but using the SI(mm) system by default with a proper handling of all quantities should be possible as well. Currently, it's also confusing that you enter the data in mm and get the results in m without even an annotation next to the legend showing the quantity and unit (such labels themselves would greatly improve user-friendliness).

@marioalexis84
Copy link
Member Author

marioalexis84 commented May 16, 2024

so displacements are in m, stresses in Pa and so on

Actually only displacement and stresses are rescaled.
By saying that "there is no conversion", I meant that only these variables are rescaled, using a hardcoded factor. Other variables in the .frd file will maintain the unit used in the .inp file.

See:

if ((scalar.first.compare("MaxShear") == 0)
|| (scalar.first.compare("NodeStressXX") == 0)
|| (scalar.first.compare("NodeStressXY") == 0)
|| (scalar.first.compare("NodeStressXZ") == 0)
|| (scalar.first.compare("NodeStressYY") == 0)
|| (scalar.first.compare("NodeStressYZ") == 0)
|| (scalar.first.compare("NodeStressZZ") == 0)
|| (scalar.first.compare("PrincipalMax") == 0)
|| (scalar.first.compare("PrincipalMed") == 0)
|| (scalar.first.compare("PrincipalMin") == 0)
|| (scalar.first.compare("vonMises") == 0)
|| (scalar.first.compare("NetworkPressure") == 0)) {
factor = 1e6; // to get Pascal
}
else if (scalar.first.compare("DisplacementLengths") == 0) {
factor = 0.001; // to get meter
}
else {
factor = 1.0;
}

@FEA-eng
Copy link
Contributor

FEA-eng commented May 16, 2024

@marioalexis84 Ok, I see. Then it's even more confusing for the user than I thought. The unit display would definitely improve the situation. I would expect the heat flux to be in W/m^2 but it's actually in mW/mm^2 = kW/m^2.

@chennes chennes merged commit a73d081 into FreeCAD:main May 20, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WB FEM Related to the FEM Workbench
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Heat flux results from thermomechanical FEM simulations
3 participants