CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Adaptive mesh refinement (https://www.cfd-online.com/Forums/openfoam-solving/180086-adaptive-mesh-refinement.html)

smschnob November 16, 2016 08:50

Adaptive mesh refinement
 
Greetings everyone,

Does anyone know if a second order ddt scheme can be used with adaptive mesh refinement in interDyMFoam solver? I can only seem to get it to work with Euler. In particular, restarting a case with a second order ddt scheme is the problem. Tried in versions 2.3.0 and 3.0.1.

Thanks!

Scott

Arne87 November 16, 2016 09:34

At least with openFOAM 4 the CrankNicolson scheme seems to work if you switch off the subcycles for the alpha equation

smschnob November 16, 2016 23:44

Thank you for your help. To switch off subcycles for alpha equation, I can just set nAlphaSubCycles in fvSolution to 0 correct?

smschnob November 18, 2016 08:54

update ...
 
1 Attachment(s)
I took a step back and instead of trying to get my case to work with a second order ddt scheme, I tried to get the interDyMFoam damBreakWithObsticle tutorial to work with a second order scheme instead of Euler. I set nAlphaSubCycles to zero and ddt scheme to CrankNicolson 1.0. I ran the case to a time of 0.12 seconds. I was able to run the case initially without any problems. I then tried to restart the case from 0.12 seconds. However, I get an error message that 'size xx,xxx is not equal to the given value of xx,xxx'. Error is within the ddt0(rho,U) file. Please see attachment. I only get this error if I run for numerous timesteps before restarting. Has anybody else run into this issue or would be able to help me figure out what I'm doing wrong? Thanks.

Arne87 November 18, 2016 11:14

At first I think I set the subCycles to 1 but I am not sure you can give it try and figure it out.
Secondly, the error message seems like openFOAM is restarting from the wrong mesh. You run your simulation the mesh gets refined and data files are written for the new mesh. When you are restarting foam probably tries to combine the new data files with the old mesh. Make sure to combine the right mesh with the right data files.

smschnob November 18, 2016 12:09

Any idea how to get interDyMFoam to use the right mesh?

smschnob November 22, 2016 09:38

I was able to restart using backward ddt scheme, just not Crank-Nicolson. Unfortunately backward scheme isn't in the more recent OpenFOAM versions.

fusij November 22, 2016 17:09

Maybe for the Crank-Nicholson it can not sum the terms from previous and current timestep since due to the mesh refinement, the mesh size has changed between timesteps.

Like we know, Crank-Nicholson approximates the time derivative with contributions from both timesteps.

potentialFoam May 3, 2017 11:05

Dear Foamers,

I have another issue using the utility 'extrudeMesh' (foam version 1606+ or 4.1):
Using Snappy works fine for dynamic mesh refinement (or adaptive mesh refinement, AMR), like here
http://www.openfoam.com/version-v1606+/meshing.php
The problem occurs if 'extrudeMesh' is used after using Snappy - all cells with a hanging node will become protected from refinement.

I prepared a simple case to demonstrate this problem. This case is based on the tutorial
Code:
$FOAM_TUTORIALS/multiphase/interDyMFoam/ras/motorBike
in version 1606 (see link above). It also works with version 4.1. This case can be downloaded here:
https://www.dropbox.com/s/3g40075603...rBike.zip?dl=0

Two figures illustrate this problem. The grey colored cells show the 'protectedCells' which cannot be refined.
Firstly, this result is gained for the standard tutorial case:
https://s13.postimg.org/r9ai68zv7/pr...trude_Mesh.png

Secondly, the following figure shows the result after 'extrudeMesh' was used:
https://s29.postimg.org/o49ig5js3/pr...trude_Mesh.png

Three scripts lead to different results:
- 'runscript_likeTutorial': creates more or less the tutorial case (corresponds to the first figure).
- 'runscript_extrude1/2': uses 'extrudeMesh' in two different ways (lead to second figure).

Question: How can you use 'extrudeMesh' and dynamic mesh refinement together?

Best Regards,
Peter

Details:
1.) One problem is that the fields cellLevel and pointLevel in the directory constant/polyMesh need to be deleted for 'interDyMFoam'. In 'runscript_extrude1' they are deleted, in 'runscript_extrude2' the cellLevel field is kind of reconstructed with the 'refinementLevel'-utility. Both do not work (-> many protected cells)

REMARK:
Same question asked here:
https://www.cfd-online.com/Forums/op...tml#post647491


All times are GMT -4. The time now is 02:01.