CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Trying to compile a new DynamicFvMesh Solver

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 2 Post By hk318i
  • 1 Post By saddy

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 21, 2017, 06:54
Post Trying to compile a new DynamicFvMesh Solver
  #1
New Member
 
Miguel García Casas
Join Date: Jun 2017
Posts: 3
Rep Power: 4
SteppenSoul is on a distinguished road
Hello everyone,

I'm Miguel and I'm doing an internship simulating a marine turbine with openFoam. I've just developed a case with a constant angular velocity in the rotor using dynamicMesh and pimpleDyMFoam.

Now I want to develope a case in which the angular velocity is calculated by the moment acting in the blades due to the kinetic energy of the current. This case is not integrated in OF so I'm trying to modify the rotatingMotion solver in dynamicFvMesh but I'm not getting results because I have no good C++ skills.

Attached to this post there is a first aproach to the solution. Inside the zip file there are the original dynamicFvMesh solver from OF4.1 named "dynamicFvMesh.0" and the modified version to calculate the angular velocity by the forces named "dynamicFvMesh".

In the last one the main modification is into dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/VarRotatingMotion/VarRotatingMotion.C

It would be great if someone can help me or he/she had done it before. Thank you!
Attached Files
File Type: gz src.OF4.tar.gz (35.3 KB, 13 views)
SteppenSoul is offline   Reply With Quote

Old   July 6, 2017, 13:28
Default
  #2
Senior Member
 
sandy
Join Date: Feb 2016
Location: .
Posts: 117
Rep Power: 5
saddy is on a distinguished road
i am also trying to include dynamic mesh in intercondensatingevaporatingfoam from openfoam v1612+ but can't get far bcz i am having very limited c++ skills. u having better luck??
saddy is offline   Reply With Quote

Old   July 7, 2017, 05:41
Default
  #3
New Member
 
Miguel García Casas
Join Date: Jun 2017
Posts: 3
Rep Power: 4
SteppenSoul is on a distinguished road
Well, I got what I want but in Foam-Extend 4.0 where the code used to move the mesh is easier to undertand and to modify.

My C++ skill is better than when I started this project but so limited yet. I suggest you to see a solver code as pimpleFoam and compare with his dynamic version code pimpleDyMFoam. Maybe you could see what you need to introduce in your solver.

Have luck!
SteppenSoul is offline   Reply With Quote

Old   July 9, 2017, 15:21
Default
  #4
Senior Member
 
sandy
Join Date: Feb 2016
Location: .
Posts: 117
Rep Power: 5
saddy is on a distinguished road
already tried the comparison! problem is the codes of openfoam v1612+ are entirely different from previous openfoam versions
saddy is offline   Reply With Quote

Old   July 10, 2017, 06:08
Default
  #5
Senior Member
 
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 239
Rep Power: 13
hk318i is on a distinguished road
Hi,

For your case, I would say compare interFoam vs interDyMFoam because ``intercondensatingevaporatingfoam`` is basically interFoam + ``temperaturePhaseChangeTwoPhaseMixtures`` library. You have to check the following points;

  • create dynamic mesh object.
  • search for makeRelative and makeAbsolute function calls.
  • search for mesh.changing() and update() calls.
Generally speaking, these are the main additions required for dynamic mesh solvers. Maybe, I'm not sure, ``temperaturePhaseChangeTwoPhaseMixtures`` library requires some modifications but it is highly unexpected.

A side note: if you are planing to use this solver for closed domains, it does not work. The mass isn't conserved for closed domains.

Best wishes,
Hassan
__________________
@HIKassem | HassanKassem.me
hk318i is offline   Reply With Quote

Old   July 10, 2017, 18:35
Smile closed domain
  #6
Senior Member
 
sandy
Join Date: Feb 2016
Location: .
Posts: 117
Rep Power: 5
saddy is on a distinguished road
Quote:
Originally Posted by hk318i View Post
Hi,

For your case, I would say compare interFoam vs interDyMFoam because ``intercondensatingevaporatingfoam`` is basically interFoam + ``temperaturePhaseChangeTwoPhaseMixtures`` library. You have to check the following points;

  • create dynamic mesh object.
  • search for makeRelative and makeAbsolute function calls.
  • search for mesh.changing() and update() calls.
Generally speaking, these are the main additions required for dynamic mesh solvers. Maybe, I'm not sure, ``temperaturePhaseChangeTwoPhaseMixtures`` library requires some modifications but it is highly unexpected.

A side note: if you are planing to use this solver for closed domains, it does not work. The mass isn't conserved for closed domains.

Best wishes,
Hassan
firstly
thanks for such a precise reply!!
secondly you mentioned two imp things i.e. dynamic mesh object and closed domain
i have no idea about dynamic mesh object? and do i create in create fields?
and my domain is a cylinder with 2 inlet and 1 outlet
so i guess its open
could you plz elaborate these points
thanks in advance
saddy is offline   Reply With Quote

Old   July 11, 2017, 06:46
Default
  #7
Senior Member
 
Hassan Kassem
Join Date: May 2010
Location: Germany
Posts: 239
Rep Power: 13
hk318i is on a distinguished road
Hello,

Indeed your case is considered an open domain. Regarding the dynamic mesh object, you need to include "createDynamicFvMesh.H" instead of "createMesh.H". A line by line comparison between interFoam and interDyMFOAM will give you a clear indication about what is needed for your solver.

Best wishes,
Hassan
saddy and Ansh like this.
__________________
@HIKassem | HassanKassem.me
hk318i is offline   Reply With Quote

Old   July 11, 2017, 18:46
Default converting the solver
  #8
Senior Member
 
sandy
Join Date: Feb 2016
Location: .
Posts: 117
Rep Power: 5
saddy is on a distinguished road
Quote:
Originally Posted by hk318i View Post
Hello,

Indeed your case is considered an open domain. Regarding the dynamic mesh object, you need to include "createDynamicFvMesh.H" instead of "createMesh.H". A line by line comparison between interFoam and interDyMFOAM will give you a clear indication about what is needed for your solver.

Best wishes,
Hassan
as you pointed out, i will try to convert the solver, though i have very little programming skills. lets see.
if i make some progress, i will keep you posted on this thread/ thanks
saddy is offline   Reply With Quote

Old   July 25, 2017, 13:19
Default
  #9
Senior Member
 
sandy
Join Date: Feb 2016
Location: .
Posts: 117
Rep Power: 5
saddy is on a distinguished road
greetings!!!
i tried your way. i compared codes of interfoam and interdymfoam.I also compared interphasechangeFoam AND InterphasechangeDyMFoam
i found that interphasechangefoam and interphasechangedymfoam is developed on very similar lines as intercondensatingevaporatingfoam
i noticed the changes line by line. i included the following changes
1. mesh.update() and DynamicFVMesh, createdynamicFVMESH, readtimecontrols in intercondensatingevaporatingDyMfoam
2 .included changes adjust function in P.eqn
3. correct phi is also included in intcondensevapDyMfoam.
[correctPhi copied from interphasechangedymfoam]
4.createdymcontrols.h
now my problem is how is alphacontrols.h , Alphaeqnsubcyle.h is included in intercondensatingfoam

i have added my whole work in the form of pics and dument of comparison
can u plz take a look??
https://drive.google.com/file/d/0B9A...ew?usp=sharing
https://drive.google.com/file/d/0B9A...ew?usp=sharing
https://drive.google.com/file/d/0B9A...ew?usp=sharing
https://drive.google.com/file/d/0B9A...ew?usp=sharing

Last edited by saddy; July 26, 2017 at 07:23. Reason: mis spelt
saddy is offline   Reply With Quote

Old   July 29, 2017, 08:45
Default
  #10
Senior Member
 
sandy
Join Date: Feb 2016
Location: .
Posts: 117
Rep Power: 5
saddy is on a distinguished road
UPDATE
Hey i just successfully compiled the solver
intercondensatingfoam to intercondensatingDyMFoam

I renamed the solver
thermalFoam and thermalDyMFoam
the solver can be compiled by simply running ./Allwmake
i am attaching it here
https://drive.google.com/open?id=0B8...XNXTXhJRGhkY1U
just copy paste it in openfoam-v1612+ solvers directory and run ./Allwmake

i used dynamicmeshdict of interdymfoam
the solver is running and shows its selecting dynamicrefinefvmesh but i see refinement. on alpha
However inteface of alpha is still hazy and diffused?? can you please take a look

Last edited by saddy; July 29, 2017 at 10:42.
saddy is offline   Reply With Quote

Old   July 29, 2017, 12:48
Default
  #11
Senior Member
 
sandy
Join Date: Feb 2016
Location: .
Posts: 117
Rep Power: 5
saddy is on a distinguished road
yeah....right....nobody....replied....
guess what.....well i did it on my own...!!!!peace
hk318i likes this.
saddy is offline   Reply With Quote

Old   June 1, 2019, 18:13
Default Dynamic Mesh in OpenFoam Forks/Flavors
  #12
Member
 
Saleh Abuhanieh
Join Date: Nov 2017
Posts: 62
Rep Power: 3
Saleh Abuhanieh is on a distinguished road
Hi Foamers,


After I've checked the three forks of openfoam (from openfoam.org, openfoam.com and the foam-extend) I noticed that the dynamic mesh classes (especially the ones for topochange) it's readily available to use only in the foam-extend fork.


For the other forks (from openfoam.com for instance) the source code for those libraries are available but not compiled.


Compiling these libraries is not a straightforward task and needs a very good knowledge in the involved C++ data structure and compilation. The same has done in some research groups but not publicly available.


I wonder if somebody can provide a compilation guide for these libraries, I think it will be very useful.



Regards,
Saleh
Saleh Abuhanieh is offline   Reply With Quote

Old   June 1, 2019, 20:08
Default Dynamic Mesh in OpenFoam Forks/Flavors
  #13
Member
 
Saleh Abuhanieh
Join Date: Nov 2017
Posts: 62
Rep Power: 3
Saleh Abuhanieh is on a distinguished road
Hi again.


It seems I was wrong about the difficulty of compiling the dynamic mesh libraries which contain the topochangers.


I was able to do it with openFoam1806 release (and it should work for other releases from openfoam.org as well) using the following steps:


- Compile the following Make folder using wmake libso if you want to keep it in the installation folder. You can compile it in your user folder too
/opt/OpenFOAM-v1806/src/dynamicMesh/Make


don't forget to change the authority for the installation folder


- Now you can take any simple tutorial which uses the dynamicMesh and include the topoChanger library in the controlDict file:
libs ("libtopoChangerFvMesh.so");


- You should be able now to see them if you use the banana trick in the dynamicMeshDict:


dynamicFvMesh banana;




In the same compiled libraries there are extra motion solvers as well, it you want to use them, include the following library in your controlDict:


libfvMotionSolvers.so




I hope that we will be useful


Regards,


Saleh
Saleh Abuhanieh is offline   Reply With Quote

Reply

Tags
boiling, compile, dynamic mesh, openfoam 4.1, openfoam-v1612+, rotating domain

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compile a new solver in OpenFOAM-2.1.0? sandy OpenFOAM Programming & Development 24 July 27, 2016 05:10
Quarter Burner mesh with periosic condition SamCanuck FLUENT 2 August 31, 2011 12:34
Working directory via command line Luiz CFX 4 March 6, 2011 21:02
How to compile an unsteady solver based on solver of MRFSimpleFoam? renyun0511 OpenFOAM Running, Solving & CFD 0 April 27, 2010 12:16
why the solver reject it? Anyone with experience? bearcat CFX 6 April 28, 2008 15:08


All times are GMT -4. The time now is 20:43.