|
[Sponsors] |
July 5, 2017, 09:38 |
pimpleDyMFoam refine and moving mesh
|
#1 |
Member
Join Date: May 2017
Posts: 38
Rep Power: 9 |
hello,
I work with a moving mesh (oscillating and rotating mesh motion) with pimpledymfoam. I would like to refine this mesh during the running. is it possible with pimpledymfoam? what I have to do? thanks in advance |
|
July 11, 2017, 11:44 |
|
#2 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi,
short answer to a short question. Yes it is. There is the dynamicRefineFvMesh Lib (hope I wrote it correct). Here you can refine the mesh based on a quantity. It is called adaptive mesh refinement (AMR). One case can be checked out here: http://www.holzmann-cfd.de/index.php...aptive-meshing However, the actual lib can only handle 3d cases properly. 2D case refinement is not possible and you only can refine hexaeders. All other volume types will be protected.
__________________
Keep foaming, Tobias Holzmann |
|
July 11, 2017, 11:56 |
|
#3 |
Member
Join Date: May 2017
Posts: 38
Rep Power: 9 |
thank you so much, it's just what I need
|
|
July 12, 2017, 08:42 |
|
#4 | |
Member
Rodrigo
Join Date: Mar 2010
Posts: 98
Rep Power: 16 |
Quote:
From here one cannot deduce the compatibility of AMR with mesh motion in OpenFOAM. I think this was the initial question at this thread. From my understanding, AMR uses "dynamicRefineFvMesh" and mesh motion uses "dynamicMotionSolverFvMesh". They are both "dynamicFvMesh"-based, but (I think that) their current implementation did not take into account their simultaneous use in a single case. In fact, both use the same dictionary (constant/dynamicFvMesh file), where you first must specify what kind of dynamicFvMesh utility do you want to use e.g. "staticFvMesh", "dynamicRefineFvMesh", "dynamicMotionSolverFvMesh", etc... Please, correct me if I am wrong. Indeed I would be glad if anyone was able to use both functionalities within the same run and could share with the community the keypoints for that to work. |
||
July 12, 2017, 09:19 |
|
#5 | |
Member
Join Date: May 2017
Posts: 38
Rep Power: 9 |
Quote:
|
||
July 12, 2017, 09:40 |
|
#6 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi all,
I am sorry that I did not get the real point of the question. To complete everything and proof what Guin already said:
Again. Sorry for the miss understanding. Good luck.
__________________
Keep foaming, Tobias Holzmann |
|
December 5, 2017, 18:02 |
|
#7 |
New Member
Join Date: Apr 2013
Posts: 26
Rep Power: 13 |
Hi Decibelle,
have you succeded in combining mesh moving and refining? It would be a great help for me! |
|
October 27, 2023, 21:24 |
|
#8 | |
New Member
Join Date: Jan 2018
Posts: 19
Rep Power: 8 |
Hi, Tobi,
While I try to merge dynamicMotionFvMesh and dynamicRefineFvMesh into a single one, as guided by this link and also the YouTube video: continuity error occurs when combining dynamicRefineFvMesh and dynamicMotionSolverFvM https://www.youtube.com/watch?v=Yq-ySlXE5JQ I successful compiled it but was faced with mesh unmatch during calculation: No MRF models present No finite volume options present DICPCG: Solving for pcorr, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 0, global = 0, cumulative = 0 Constructing face velocity Uf Courant Number mean: 0 max: 0 Starting time loop Courant Number mean: 0 max: 0 Interface Courant Number mean: 0 max: 0 deltaT = 0.000119976 Time = 0.000119976 PIMPLE: iteration 1 Selected 176 cells for refinement out of 4624. Refined from 4624 to 5856 cells. Selected 0 split points out of a possible 176. --> FOAM FATAL ERROR: Size of newPoints 9522 does not correspond to current mesh points size 11643 From function virtual Foam::tmp<Foam::Field<double> > Foam:olyMesh::movePoints(const pointField&) in file meshes/polyMesh/polyMesh.C at line 1120. FOAM exiting I think this happened because the mesh is refined and topo is changed while the motion solver is about to run, 'newpoints' here refers to the original mesh inside polyMesh file. I tried to code something before motion solver's running but failed. Do you have any suggestions on this? Thanks! Zhi Quote:
|
||
October 28, 2023, 03:30 |
|
#9 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi,
Well potential some ideas but no time to check them. However, I was expecting that there is one dynamic library which allows one to call several dynamic libs without coding. Not sure if this was in the cfd.direct or openCFD version. In addition, I am not sure how old the documentation is to which you refer. OpenFoam changes quite a lot over the released. openCFD tries to keep compatibility but cfd.direct not really. Not sure which one is better. Don't like backwards compatibility for a long time. So long story short. No idea up to now. I would need to check the sources and how things work.
__________________
Keep foaming, Tobias Holzmann |
|
October 28, 2023, 05:26 |
|
#10 | |
New Member
Join Date: Jan 2018
Posts: 19
Rep Power: 8 |
Hi, Tobi,
Many thanks for your reply! I could quickly shows you what I modified based on the original 'dynamicRefineFvMesh'. The full file for updated 'dynamicRefineFvMesh' is also attached for your information. I just add the following codes inside 'bool Foam::dynamicRefineFvMesh::update()' after refining mesh is done every cycle: fvMesh::movePoints(motionPtr_->newPoints()); volVectorField* Uptr = getObjectPtr<volVectorField>("U"); if (Uptr) { Uptr->correctBoundaryConditions(); } I know the error I mentioned before occurs just the following command is running: fvMesh::movePoints(motionPtr_->newPoints()); It seems I need to add something before this line codes to use the refined mesh to update current mesh, but I don't I which command I should add. I tried several possible options but all failed. It is worth mentioning that when I add the above motion solver command before the mesh refinement command, the first time step can run normally, and the second time step provides a similar error report, that is, the grid was already updated at the start of the second time step, resulting in a mismatch. The error command is as follows: Interface Courant Number mean: 0 max: 0 deltaT = 0.000119976 Time = 0.000119976 PIMPLE: iteration 1 DICPCG: Solving for cellDisplacementx, Initial residual = 0, Final residual = 0, No Iterations 0 DICPCG: Solving for cellDisplacementy, Initial residual = 0, Final residual = 0, No Iterations 0 Selected 176 cells for refinement out of 4624. Refined from 4624 to 5856 cells. Selected 0 split points out of a possible 176. DICPCG: Solving for pcorr, Initial residual = 2.26625e-11, Final residual = 2.26625e-11, No Iterations 0 time step continuity errors : sum local = 8.55969e-33, global = 0, cumulative = 0 diagonal: Solving for alpha.air, Initial residual = 0, Final residual = 0, No Iterations 0 smoothSolver: Solving for alpha.other, Initial residual = 5.01386e-07, Final residual = 5.01386e-07, No Iterations 0 Air phase volume fraction = 0.638889 Min(alpha.air) = 0 Max(alpha.air) = 1 Liquid phase volume fraction = 0.0277778 Min(alpha.other) = 0 Max(alpha.other) = 1 diagonal: Solving for alpha.air, Initial residual = 0, Final residual = 0, No Iterations 0 smoothSolver: Solving for alpha.other, Initial residual = 5.01386e-07, Final residual = 5.01386e-07, No Iterations 0 Air phase volume fraction = 0.638889 Min(alpha.air) = 0 Max(alpha.air) = 1 Liquid phase volume fraction = 0.0277778 Min(alpha.other) = 0 Max(alpha.other) = 1 DICPCG: Solving for p_rgh, Initial residual = 1, Final residual = 0.033215, No Iterations 2 time step continuity errors : sum local = 0.000327455, global = 1.6465e-19, cumulative = 1.6465e-19 DICPCG: Solving for p_rgh, Initial residual = 0.0210765, Final residual = 0.00104551, No Iterations 19 time step continuity errors : sum local = 2.1042e-05, global = -2.14697e-21, cumulative = 1.62503e-19 DICPCG: Solving for p_rgh, Initial residual = 0.00787536, Final residual = 9.15592e-08, No Iterations 129 time step continuity errors : sum local = 1.85098e-09, global = -3.61728e-23, cumulative = 1.62467e-19 time step continuity errors : sum local = 1.85098e-09, global = -3.61728e-23, cumulative = 1.62431e-19 ExecutionTime = 0.27 s ClockTime = 0 s Courant Number mean: 1.03498e-05 max: 0.00211289 Interface Courant Number mean: 0 max: 0 deltaT = 0.000144006 Time = 0.000263982 PIMPLE: iteration 1 --> FOAM FATAL ERROR: given patch field does not correspond to the meshPoints. Field size: 544 meshPoints size: 562 From function void Foam:ointPatchField<Type>::setInInternalField(Fo am::Field<Type2>&, const Foam::Field<Type2>&, const labelList&) const [with Type1 = Foam::Vector<double>; Type = Foam::Vector<double>; Foam::labelList = Foam::List<int>] in file /opt/OpenFOAM/OpenFOAM-v1912/src/OpenFOAM/lnInclude/pointPatchField.C at line 267. FOAM aborting Best, Zhi Quote:
|
||
January 4, 2024, 23:13 |
Facing the same cell count mismatch error!
|
#11 |
New Member
Shridhar
Join Date: May 2021
Posts: 6
Rep Power: 5 |
Hey Zhi,
Were you able to get your code to work, and if so what changes did you implement. Thanks in advance! |
|
July 15, 2024, 11:48 |
|
#12 |
New Member
Umut
Join Date: May 2011
Posts: 25
Rep Power: 15 |
Hello,
Any update on this? What I am after is kind of a workaround for remeshing, similar to fluent's remeshing. Imagine two cubes initially very close with eachother where several cells in between. One of the cubes moves away during the simulation. So new cells must be generated in between. I assumed I can set refinement in this region if the cell size exeeds a predefined value. Thus, I thought mesh motion and refinement can just do the thing. How can I do that? |
|
Tags |
movingmesh, pimpledymfoam, refine mesh |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] SnappyHexMesh for internal Flow | vishwa | OpenFOAM Meshing & Mesh Conversion | 24 | June 27, 2016 09:54 |
[snappyHexMesh] No layers in a small gap | bobburnquist | OpenFOAM Meshing & Mesh Conversion | 6 | August 26, 2015 10:38 |
Overset: refine background mesh without resetting the mesh | JohnAB | STAR-CCM+ | 6 | May 19, 2014 14:48 |
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! | sc298 | OpenFOAM Meshing & Mesh Conversion | 2 | March 27, 2011 22:11 |
[snappyHexMesh] external flow with snappyHexMesh | chelvistero | OpenFOAM Meshing & Mesh Conversion | 11 | January 15, 2010 20:43 |