unexpected call for rho in modified buoyantBoussinesqSimpleFoam

 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 13, 2012, 04:58 unexpected call for rho in modified buoyantBoussinesqSimpleFoam #1 Senior Member     Roman Thiele Join Date: Aug 2009 Location: Stockholm, Sweden Posts: 359 Rep Power: 11 Hej, I have slightly modified buoyantBoussinesqSimpleFoam in order to implement a different way of calculating the temperature equation Therefore the main file looks like this now Code: Info<< "\nStarting time loop\n" << endl; while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; // Pressure-velocity SIMPLE corrector { #include "UEqn.H" #include "AHFMEqn.H" // new #include "TEqn.H" #include "pEqn.H" } turbulence->correct(); runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; where the highlighted part is a new equation that calculates a field for the temperature equation. It compiles and the temperature equation is solved. As can be seen from the output Code: SIMPLE: convergence criteria field p_rgh tolerance 1e-08 field T tolerance 1e-06 field U tolerance 1e-06 Starting time loop Time = 1 DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 0.0281127014, No Iterations 1 DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 0.0281177952, No Iterations 1 DILUPBiCG: Solving for theta2, Initial residual = 0.999994784, Final residual = 0.0182097574, No Iterations 1 DILUPBiCG: Solving for T, Initial residual = 1, Final residual = 0.0280023891, No Iterations 1 do p_rghEqn setup --> FOAM FATAL ERROR: request for volScalarField rho from objectRegistry region0 failed available objects of type volScalarField are the "do p_rghEqn setup" comes from an info part that I now inserted into the pEqn.H part of the solver in order to find the error. For some unexplained reason the solver wants to look up rho in the pEqn.H part of the solver, even though that part is untouched as in Code: { volScalarField rAU("rAU", 1.0/UEqn().A()); surfaceScalarField rAUf("(1|A(U))", fvc::interpolate(rAU)); U = rAU*UEqn().H(); UEqn.clear(); phi = fvc::interpolate(U) & mesh.Sf(); adjustPhi(phi, U, p_rgh); surfaceScalarField buoyancyPhi(rAUf*ghf*fvc::snGrad(rhok)*mesh.magSf()); phi -= buoyancyPhi; while (simple.correctNonOrthogonal()) { Info << "do p_rghEqn setup\n" << endl; // modification for debugging fvScalarMatrix p_rghEqn ( fvm::laplacian(rAUf, p_rgh) == fvc::div(phi) // here comes the error ); Info << "done p_rghEqn setup\n" << endl; // modification for debugging The pressure equation was never touched and a diff test reveals that the only changes between the original file in buoyantBoussinesqSimpleFoam and my version are the lines highlighted with "modification for debugging" Does anybody know why and how the solver wants to look up rho? __________________ ~roman

 April 13, 2012, 17:47 #2 New Member   Nikhil Join Date: Sep 2011 Posts: 9 Rep Power: 5 Hello Roman, I am no expert in OpenFOAM and have not worked with "buoyantBoussinesqSimpleFoam" before, but I came across this error "request for volScalarField rho from objectRegistry region0 failed" when I modified interFoam to incorporate a new BC for dynamic contact angle. I don't know which part of the code is calling 'rho', but I guess because of your modifications it is being called and you don't have rho in the objectregistry. If that is the case all you need to do is add rho as volScalarField in createFields.H file. Since this is not a multi-phase flow rho is not a volScalarField, but it would be interesting to see if that will let your code overcome or figure out the source of this error. Hope this helps. Please let me know if this woks. Nikhil

 April 14, 2012, 08:32 solution found #3 Senior Member     Roman Thiele Join Date: Aug 2009 Location: Stockholm, Sweden Posts: 359 Rep Power: 11 Hej, I found the solution. It has to do with the boundary condition for pressure. The pressure boundary condition buoyantPressure calls rho therefore the boundary condition has to be given with the correct call for rho as in Code: wall { type buoyantPressure; rho rhok; } I think this should be valid for most of the incompressible solvers with buoyancy, since they do not have a real rho, but only the modified rhok linnemann and laplacian like this. __________________ ~roman

 Tags heat flux model

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post foamer OpenFOAM 14 June 20, 2014 08:51 bfan Main CFD Forum 3 June 22, 2002 22:01 zheh Phoenics 5 September 9, 2001 05:01 Dr. Yazid Bindar Main CFD Forum 27 July 18, 2000 00:18 Viet Main CFD Forum 16 July 26, 1999 15:57

All times are GMT -4. The time now is 17:39.