|
[Sponsors] |
Problem while running interFoam with codedFixedValue and dynamicmesh |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 9, 2021, 00:16 |
Problem while running interFoam with codedFixedValue and dynamicmesh
|
#1 | |
New Member
Abhishek Mukherjee
Join Date: Sep 2014
Posts: 6
Rep Power: 12 |
Hi, I am working on running interfoam simulation (multiphase flow) with custom boundary conditions. The geometry is a rectangular box that is filled with water by 50%. the inlet has a custom velocity boundary condition which is a cosine function of space and time. I am also using dynamicmeshdict which will refine the grid at the free surface.
The problem is when I use each option separately the case works, which means when I used dynamicmesh feature with a fixed velocity at the inlet it works. The same thing happens when I use custom boundary conditions without dynamic mesh. However, when I am using both features, the case breaks immediately. The condition at leftWall (or inlet) is Code:
type codedFixedValue; value $internalField; name pistonvel; code #{ const fvPatch& boundaryPatch = patch(); vectorField& field = *this; const scalar t = this->db().time().timeOutputValue(); forAll(boundaryPatch, faceI) { if (boundaryPatch.Cf()[faceI].z()>=0.0) { field[faceI] = vector((boundaryPatch.Cf([faceI].z()*cos(2*3.14*t),0,0); } else { field[faceI] = vector(0,0,0); } } #}; Code:
type fixedValue; value uniform (0.2 0 0.2); Code:
field[faceI] = vector(0.2,0,0.2); However, the case fails. The error starts at the 2nd time step. Code:
Courant Number mean: 0.000835481 max: 0.0119044 Interface Courant Number mean: 0 max: 0 deltaT = 0.000143978 Time = 0.000263978 Selected 6000 cells for refinement out of 55500. Refined from 55500 to 97500 cells. Selected 0 split points out of a possible 6000. #0 Foam::error::printStack(Foam::Ostream&)Segmentation fault (core dumped) I am wondering whether the inlet takes into account the modified gridpoints, since I am refining the mesh at the free surface. I am using the following configuration of dynamicMeshdict. Quote:
Any help is appreciated! |
||
June 14, 2021, 17:55 |
|
#2 |
New Member
Abhishek Mukherjee
Join Date: Sep 2014
Posts: 6
Rep Power: 12 |
Hi, anybody have idea?
|
|
June 15, 2021, 06:31 |
|
#3 |
Senior Member
|
Hi,
The one thing that comes to mind is that the fixedValue boundary condition can work with the changing topology of the mesh out of the box. You may need to account for this in your coded condition as well. I would not know how to do this however. Maybe you could rewrite your boundary condition using the expression syntax? Have a look at the documentation. Hope this helps. Best Regards, Tom |
|
August 20, 2023, 04:34 |
|
#4 |
New Member
Dengke Li
Join Date: Dec 2022
Posts: 16
Rep Power: 3 |
||
May 22, 2024, 08:54 |
|
#5 |
New Member
Hendrik Reese
Join Date: May 2024
Posts: 1
Rep Power: 0 |
I am now also facing the same problem. Either there is some way to load the updated mesh in the code of codedFixedValue, or the cells at the boundary need to be protected from refinement, for which the code of dynamicRefineFvMesh would need to be changed. I would prefer the first solution, however.
|
|
|
|