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

[Other] dynamicMeshDict dynamicRefineFvMesh with rhoCentralFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 30, 2022, 05:38
Default dynamicMeshDict dynamicRefineFvMesh with rhoCentralFoam
  #1
Member
 
Vinzenz Götz
Join Date: Mar 2021
Location: Munich, Germany
Posts: 31
Rep Power: 5
Vinzmann is on a distinguished road
Hi,

so I am using OF8 and I want to adaptively refine my mesh in areas where the magnitude of grad(p) is high. rhoCentralFoam does only take volScalarFields though. Since this is the case, how can I get this to work? Any help would be greatly appreciated. The output for rhoCentralFoam looks like this:
Code:
[0] 
[0] 
[0] --> FOAM FATAL ERROR: 
[0] 
    request for volScalarField mag(Grad(p)) from objectRegistry region0 failed
    available objects of type volScalarField are

20
(
thermo:mu
thermo:psi
rhoE_0
nut
yWall
rho
k
thermo:psi_0
e_0
alphat
rho_0
p
T
rhoE
k_0
p_0
e
omega
omega_0
thermo:alpha
)
My dynamicMeshDict looks like this:
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      dynamicMeshDict;
}

dynamicFvMesh		dynamicRefineFvMesh;

dynamicRefineFvMeshCoeffs
{
	refineInterval	5;
	field			mag(Grad(p));
	
	lowerRefineLevel	3e5;
	upperRefineLevel	4e5;
	
	unrefineLevel		1e5;
	
	nBufferLayers		5;
	
	maxRefinement		3;
	
	maxCells			1000000;
	
	correctFluxes
	(
		(phi U)
	
	);

	dumpLevel			true;


}
Vinzmann is offline   Reply With Quote

Old   July 1, 2022, 04:04
Default Solution
  #2
Member
 
Vinzenz Götz
Join Date: Mar 2021
Location: Munich, Germany
Posts: 31
Rep Power: 5
Vinzmann is on a distinguished road
So I've found a solution to this problem. Create two new functions in the controlDict. First a function giving grad(p) (you can look this up in the documentation for functionObjects) then another function to create mag of grad(p). This new field can be set in the dynamicMeshDict as the fild to work on.
Vinzmann is offline   Reply With Quote

Reply

Tags
amr, dynamic meshing, dynamicmeshdict


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
DynamicRefineFvMesh & Supersonic Erosion siefer92 OpenFOAM Programming & Development 1 February 4, 2021 18:00
Modify rhoCentralFoam: other equations of state fivos OpenFOAM Programming & Development 5 July 29, 2020 14:17
Does dynamicRefineFvMesh work with unstructured tetra meshes? giovanni.medici OpenFOAM Running, Solving & CFD 2 August 23, 2017 03:35
I can't understand the moving function of "libfvMotionSolver.so" in dynamicMeshDict Jung hoo OpenFOAM Programming & Development 0 July 13, 2016 04:36
DynamicMeshDict dynamicRefineFvMesh in 2D lukasfischer OpenFOAM Running, Solving & CFD 4 November 10, 2014 08:19


All times are GMT -4. The time now is 12:15.