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

New volScalarField incorrect values with dynamicRefineFvMesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 8, 2022, 11:16
Default New volScalarField incorrect values with dynamicRefineFvMesh
  #1
New Member
 
Joshua Christopher
Join Date: Jul 2022
Posts: 7
Rep Power: 4
JChristopher is on a distinguished road
Hello,


I am updating an old third-party solver I found (https://github.com/iroghair/openFoamEHD) so it will work with OpenFOAM-v2206. This solver is derived from interFoam, and adds two new volScalarField (Ue and rhoE) with corresponding governing equations and a coupling to the momentum equations through the Maxwell stress tensor.


To update to OpenFOAM-v2206, I copied interFoam from v2206 and modified the source code as the original reference does (with changes as needed for the newer version).


I am validating the changes with the vertically stacked liquids case from Roghair et al. 2013 (page 3: https://ris.utwente.nl/ws/portalfile...l_draft_v1.pdf). In the attached figures I have alpha.jpg showing a close-up of the interface between the two fluids, and Ue at the same spatial location.


When I enable dynamic mesh refinement with dynamicRefineFvMesh, and tag refinement with alpha, I get incorrect values of Ue (one of my custom volScalarField). Alpha and Ue at the interface with adaptive mesh refinement is shown in alpha_AMR.jpg and Ue_AMR.jpg. The Ue field is supposed to be more smooth, but in the dynamically refined cells you can see there is a jump in the solution value. The rhoE volScalarField looks fine, but it is uniform zero for this test so that being correct might just be coincidence.



Does anyone know how to debug the cause of this? I have reduced to just one level of refinement and decreased the step size significantly, so I think the problems is a coding issue rather than a configuration issue. I attached my dynamicMeshDict as well, just in case its a configuration issue!


I'm thinking there is a problem with interpolation from the coarse cells to the dynamic refinement cells, but I am brand new to OpenFOAM and don't really know where to start looking into this.


Thank you so much for your help!
Attached Images
File Type: jpg alpha.jpg (38.1 KB, 15 views)
File Type: jpg Ue.jpg (49.5 KB, 13 views)
File Type: jpg alpha_AMR.jpg (42.4 KB, 11 views)
File Type: jpg Ue_AMR.jpg (56.3 KB, 12 views)
Attached Files
File Type: txt dynamicMeshDict.txt (1.8 KB, 5 views)
JChristopher is offline   Reply With Quote

Reply


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 add the values of any volscalarfield variable in every timestep Pratik_21 OpenFOAM Running, Solving & CFD 12 December 24, 2020 16:57
Assign values in an array to each cell of volscalarfield Yongqiang66 OpenFOAM Programming & Development 7 June 7, 2020 10:19
Setting boundary values for a volScalarField Bloerb OpenFOAM Programming & Development 0 August 25, 2016 08:07
why fixedValue pressure makes neighbor cells incorrect values immortality OpenFOAM Running, Solving & CFD 6 July 1, 2013 12:41
Counting non-zero values in a volScalarField javier_motta OpenFOAM 1 May 29, 2013 11:30


All times are GMT -4. The time now is 03:57.