|
[Sponsors] |
Problem calculating the residual of momentum eq. in a dynamically changing mesh |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 26, 2015, 12:35 |
Problem calculating the residual of momentum eq. in a dynamically changing mesh
|
#1 |
New Member
towanda
Join Date: Aug 2014
Posts: 20
Rep Power: 12 |
Hello,
I am trying to do some programming in OF and I need some help. I have added to the pimpleDyMFoam solver the calculation of some kind of residual of the momentum equation (I attach the corresponding file, also I am working with OF 2.4.0) lines 134-160. In the problem at hand, the code also make a dynamic refinement of the mesh at each time step (I have use dynamicMeshDict to do it). The thing is: 1) I have first tested the coding of the calculation of the residual on a simpler case with a fix mesh in icoFoam and it works. 2)When I run the case with the dynamic mesh refinement, the field uResidual is created but when I try to visualize the solution with paraFoam I get the following error: p, li { white-space: pre-wrap; } ERROR: In /build/buildd/paraview-4.0.1/VTK/IO/Geometry/vtkOpenFOAMReader.cxx, line 6584 vtkOpenFOAMReaderPrivate (0x27de4a0): Number of cells/points in mesh and field don't match: mesh = 5960, field = 6002 Then I think that I am missing some detail between the calculation of the uResidual with the dynamic mesh. Does anyone could give me a clue of what I am doing wrong? Thank you very much for your time. |
|
October 2, 2015, 16:07 |
|
#2 |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18 |
Hi towanda,
The issue here is that you're writing out your residual field at a different frequency as the rest of the case (other fields + mesh). Because you're adding dynamic refinement the mesh is changing (i.e. addiing/removing cells) but you're not writing out the mesh along with the residual field. Thus the size of the field you're writing out doesn't match the size of the latest mesh you're writing out. Manual .write() calls can be troublesome with dynamic mesh cases. If you remove Code:
uResidual.write(); Code:
volScalarField uResidual ( IOobject ( "uResidual", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mag ( fvc::ddt(U) + fvc::div(phi, U) - fvc::laplacian(nuEff,U) + fvc::grad(p) ) ); good luck! Cheers, Kyle |
|
October 2, 2015, 17:58 |
|
#3 |
New Member
towanda
Join Date: Aug 2014
Posts: 20
Rep Power: 12 |
Hello Kyle,
Thanks for the answer, you are right I was writing the outputs at different times, it works now. I also solved the problem by using the runTime.outputTime() function and I get the same result. if(runTime.outputTime()){ uResidual.write(); Info<<"ESCRIBE: "<<runTime.value()<<endl; } Thank you very much indeed for your time. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with chtMultiregionFoam radiation boundary condition | baran_foam | OpenFOAM Running, Solving & CFD | 10 | December 17, 2019 18:36 |
Wrong fluctuation of pressure in transient simulation | caitao | OpenFOAM Running, Solving & CFD | 2 | March 5, 2015 22:33 |
Why RNGkepsilon model gives floating error | shipman | OpenFOAM Running, Solving & CFD | 3 | September 7, 2013 09:00 |
pisoFoam with k-epsilon turb blows up - Some questions | Heroic | OpenFOAM Running, Solving & CFD | 26 | December 17, 2012 04:34 |
fluent add additional zones for the mesh file | SSL | FLUENT | 2 | January 26, 2008 12:55 |