CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   adding new properties to chtMultiRegionFoam (https://www.cfd-online.com/Forums/openfoam-programming-development/112548-adding-new-properties-chtmultiregionfoam.html)

waiter120 January 30, 2013 15:56

adding new properties to chtMultiRegionFoam
 
Hello for all FOAM users.
I’m trying to add new solid material property to basicSolidThermo for chtMultiRegionFoam.
First, I try to add my new property similarly to thermal conductivity (K) in basicSolidThermo, costantSolidThermo, isotropicKSolidThermoand and other classes, where K is mention. I simply copy lines with K and rename K to myProp. After successful compilation of library and new solver I gat fatal error: Segmentation fault.
Then I try to add myProp similarly to rho in basicSolidThermo, costantSolidThermo.
Result was the same.
Final variant was to reject an idea of myProp and use in the solver standard property (for example sigmaS or other) that not necessary for thermal conductivity of solids. This work correct and without errors.
But the main idea was not finished. Can any body advice something? Or maybe, someone have the same task.

wyldckat February 2, 2013 08:07

Greetings waiter120 and welcome to the forum!

It would be easier to help you if you could share the changes/tests you've made so far.

Best regards,
Bruno

waiter120 February 2, 2013 13:32

1 Attachment(s)
Hallo.
All files for compilation of new version of basicSolidTermo are in the attached file.
All my adding are below the “//ttt”, so you can easy find them.
Note:
Lines in files directionalKSolidThermo.H/.C, isotropicKSolidThermo.H/.C and solidMixtureThermo.H.//C are added for library can be compiled. So the new functions has new name but do the same things that all other functions with Thermal Conductivity (K) do (Im just copy them from K). This is done because I don't really understand how they work.

Library and solver compiles fine but when calculation is start, fatal error:Segmentation fault, appear .

waiter120 February 2, 2013 15:40

Files that are modified:
basicSolidTermo.H/.C,
constantSolidTermo.H/.C,
directionalKSolidThermo.H/.C,
isotropicKSolidThermo.H/.C
solidMixtureThermo.H./C

my new material property is called : Ro

wyldckat February 2, 2013 16:13

Thanks for sharing the files, it made it a lot easier to diagnose. It's been a long week and looking only at the text made it a lot harder to visualize what you wrote.

So, what happened is this:
  1. You added a new public variable and associated methods.
  2. You re-built this modified library.
  3. You adapted a tutorial case and ran the applications...
  4. Result: crash.
The reason is simple: since you added new public variables and methods, you also have to build the libraries and applications that depend on this modified library.


The solution: run Allwmake on the main OpenFOAM-2.1.x folder and it will (re)build only what needs to be adjusted to account for the changes made!
Just in case, here are the commands:
Code:

cd $WM_PROJECT_DIR
./Allwmake

One important detail: if you copied or renamed this folder "basicSolidThermo" to another place, the modified header files won't be picked up by the libraries and applications that depend on them during the building process. Therefore, since you modifying this critical library (has several base definitions), it's best that you keep the code where it was originally, modify it and (re)build it there.

Best regards,
Bruno

waiter120 February 3, 2013 07:26

Thanks you very much. I will try yours advices.

waiter120 February 4, 2013 14:00

Wyldckat - a lot of thanks for advices.
I try ./Allwmake and openFoam start to compile from the beginning (30min). After it my new property was successful added to basicSolidTermo.
But than I decided to go back and return the original library of material properties. I recompile basicSolidTermo and than do ./Allwmake. After it all basic solvers that use basicSolidTermo library start to producing a lot of errors. So I have to reinstall openFoam.

Can you give me some advices about this difficulty?

wyldckat February 5, 2013 06:18

Quote:

Originally Posted by waiter120 (Post 405976)
Can you give me some advices about this difficulty?

I suggest that you start using Git ;)
It'll make you like easier for keeping tracking of changes you make.

waiter120 February 5, 2013 06:51

You are right. Thanks.


All times are GMT -4. The time now is 10:22.