
[Sponsors] 
March 15, 2012, 15:55 
Developing a rhoPimpleDyMFoam solver

#1 
New Member
Bernardo Vieira
Join Date: Apr 2011
Location: USA
Posts: 7
Rep Power: 7 
I’m trying to implement a new solver, essentially adding mesh motion capability into rhoPimpleFoam. I’m using pimpleDyMFoam as a basis to figure out what needs to be changed. My ultimate goal is to be able to run pitching airfoils on a compressible flow solver.
I was able to compile the new solver, but when I try to run, I getting a dimensions error: Code:
Different dimensions for = dimensions : [1 0 1 0 0 0 0] = [0 3 1 0 0 0 0] Code:
// Make the fluxes relative to the mesh motion fvc::makeRelative(phi, U); I’d appreciate any thoughts on this issue. I’m attaching the correctPhi.H file, as well as the rhoPimpleDyMFoam.C file. I'm using the latest OpenFOAM 2.1.0. Thank you. correctPhi.H Code:
{ if (mesh.changing()) { forAll(U.boundaryField(), patchI) { if (U.boundaryField()[patchI].fixesValue()) { U.boundaryField()[patchI].initEvaluate(); } } forAll(U.boundaryField(), patchI) { if (U.boundaryField()[patchI].fixesValue()) { U.boundaryField()[patchI].evaluate(); phi.boundaryField()[patchI] = U.boundaryField()[patchI] & mesh.Sf().boundaryField()[patchI]; } } } wordList pcorrTypes ( p.boundaryField().size(), zeroGradientFvPatchScalarField::typeName ); forAll(p.boundaryField(), patchI) { if (p.boundaryField()[patchI].fixesValue()) { pcorrTypes[patchI] = fixedValueFvPatchScalarField::typeName; } } volScalarField pcorr ( IOobject ( "pcorr", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedScalar("pcorr", p.dimensions(), 0.0), pcorrTypes ); while (pimple.correctNonOrthogonal()) { //Changed the correction here to match pEqn.H (rhoPimpleFoam) fvScalarMatrix pcorrEqn ( fvm::ddt(psi, pcorr) + fvc::div(phi)  fvm::laplacian(rho*rAU, pcorr) ); // Removed the pressure referencing pcorrEqn.solve(); if (pimple.finalNonOrthogonalIter()) { phi = pcorrEqn.flux(); } } } //Changed to compressible version (not sure if rhoEqn.H should also be included) #include "rhoEqn.H" #include "compressibleContinuityErrs.H" Code:
#include "fvCFD.H" #include "basicPsiThermo.H" #include "turbulenceModel.H" #include "dynamicFvMesh.H" #include "bound.H" #include "pimpleControl.H" //#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { #include "setRootCase.H" #include "createTime.H" #include "createDynamicFvMesh.H" pimpleControl pimple(mesh); #include "initContinuityErrs.H" #include "createFields.H" #include "readTimeControls.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; while (runTime.run()) { #include "readControls.H" #include "compressibleCourantNo.H" // Make the fluxes absolute fvc::makeAbsolute(phi, U); #include "setDeltaT.H" runTime++; Info<< "Time = " << runTime.timeName() << nl << endl; mesh.update(); if (mesh.changing() && correctPhi) { #include "correctPhi.H" } // Make the fluxes relative to the mesh motion fvc::makeRelative(phi, U); if (mesh.changing() && checkMeshCourantNo) { #include "meshCourantNo.H" } #include "rhoEqn.H" //  Pressurevelocity PIMPLE corrector loop while (pimple.loop()) { #include "UEqn.H" #include "hEqn.H" //  Pressure corrector loop while (pimple.correct()) { #include "pEqn.H" } if (pimple.turbCorr()) { turbulence>correct(); } } runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; return 0; } // ************************************************************************* // Last edited by bvieira; March 16, 2012 at 16:47. 

March 16, 2012, 15:59 

#2 
Senior Member
KarlJohan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 270
Rep Power: 13 
Interesting work. I recently wrote a low mach number combustion solver for OF2.1 capable of dynamic meshes (for adaptive refining) Here are is my correctPhi.H and another file which is called before the time loop starts.
correctPhi.H Code:
{ if (mesh.changing()) { forAll(U.boundaryField(), patchi) { if (U.boundaryField()[patchi].fixesValue()) { U.boundaryField()[patchi].initEvaluate(); } } forAll(U.boundaryField(), patchi) { if (U.boundaryField()[patchi].fixesValue()) { U.boundaryField()[patchi].evaluate(); phi.boundaryField()[patchi] = U.boundaryField()[patchi] & mesh.Sf().boundaryField()[patchi]; } } } #include "compressibleContinuityErrs.H" volScalarField pcorr ( IOobject ( "pcorr", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedScalar("pcorr", p.dimensions(), 0.0), pcorrTypes ); dimensionedScalar rAUf("(1A(U))", dimTime, 1.0); while (pimple.correctNonOrthogonal()) { fvScalarMatrix pcorrEqn ( fvm::laplacian(rAUf, pcorr) == fvc::div(phi)  divU ); pcorrEqn.solve(); if (pimple.finalNonOrthogonalIter()) { phi = pcorrEqn.flux(); } } #include "compressibleContinuityErrs.H" } Code:
wordList pcorrTypes ( p.boundaryField().size(), zeroGradientFvPatchScalarField::typeName ); for (label i=0; i<p.boundaryField().size(); i++) { if (p.boundaryField()[i].fixesValue()) { pcorrTypes[i] = fixedValueFvPatchScalarField::typeName; } } Faces during change of topology in the mesh Regards, Kalle 

March 16, 2012, 22:19 

#3 
New Member
Bernardo Vieira
Join Date: Apr 2011
Location: USA
Posts: 7
Rep Power: 7 
Thank you for the reply!
I'd like to mention a few things, and I'd appreciate any comments. 1) I'm trying to model an airfoil that will be performing a pitching motion about the 1/4 chord point. My understanding is that my mesh doesn't need to deform at all, only rotate (I'm assuming the mesh motion routine will be able to translate the effects of both angleofattack changes, but also due to pitch rate (effectivecamber effects that depend on pivotpoint location)). 2) Let's say I don't need the correctPhi.H routine, should I comment it out, or it will be called only if the there are any flipping faces ? 3) About your implementation of correctPhi.H, the equation you’re using for the nonOrthogonal Mesh correction is the same as the one used in compressibleInterDyMFoam. I used the equation from rhoPimpleFoam solver under pEqn.H. Do you have comments on which one should be used ? 4) By inspecting where my error really came from, I realized that it isn't related to the correctPhi.H file. The "fvc::makeRelative(phi, U)" line gives a dimension error only after updating the mesh "mesh.update()" . If placed before it doesn't. Replacing the makeRelative command by, Code:
fvc::makeRelative(phi, rho, U) I know that because this solver is compressible my "phi" definition is different than in an incompressible solver by a rho factor (it's using compressibleCreatePhi.H instead of CreatePhi.H) I'd really appreciate any comments you may have on this... 

March 20, 2012, 10:03 

#4 
Senior Member
KarlJohan Nogenmyr
Join Date: Mar 2009
Location: Linköping
Posts: 270
Rep Power: 13 
Hi!
1,2) For such a case you could write a code that simple oscillates the complete mesh. I would guess that you can take a lot of ideas on how the AMI propeller case is done, even though I never looked at it. Just make sure you call makeAbsolute and makeRelative correctly. That approach would not flip any faces, and you can do without this correctPhi code. 3) I was using the code from interDyMFoam. Thinking more about it, is might be more relevant to look at the code in compressibleInterDyMFoam. I all cases, one should validate the approach taken by inspecting phi fields after the correctPhi.H. I did not get that far yet. 4) Have a look at the implementation of the makeRelative/Absolute. They have different methods depending on compressiblity. Regards, Kalle 

March 23, 2012, 17:32 

#5 
New Member
Bernardo Vieira
Join Date: Apr 2011
Location: USA
Posts: 7
Rep Power: 7 
Thanks for the comments!
I was able to make the case run without any errors. I've included rho in all MakeAbsolute and MakeRelative to be consistent and some other minor corrections and the solver started to work. By inspecting the mesh during the motion, it seems that my mesh is rotating just as I desired, without any flipping or distorting faces. But now, I'm facing some instability problems with the run. Residuals don't diverge, but I get instabilities in the field variables (p, rho) near the leading edge which propagate downstream and messes with the solution. Thinking that this could be related to the new solver that I put together, I decided to run a case in rhoPimpleFoam with no moving mesh, just a fixed airfoil but also transient. I'm also getting some weird instabilities in the flow after some time. I'm still experimenting with relaxation factors and subiterations, but i may post a question on this soon. Again any ideas would be useful. Thanks. 

April 2, 2013, 03:24 

#6 
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 237
Rep Power: 9 
Hello,
First I have to say that your work is really nice ! I found your topic because I also need to implement a mesh motion in rhoPimpleFoam. I am very curious, did you succeed to solve your instability problem ? And may I ask you to share the final version of your solver ? Thx, Fred 

April 5, 2013, 09:17 
rhoPimpleDymFoam solver

#7 
Member
prasant
Join Date: Jan 2013
Posts: 31
Rep Power: 5 
Hello All,
Did you ever success with the rhoPimpleDymFoam Solver. I had compiled the code successfully. But while running the solver, I am getting error. Could you please help me regarding this? Regards Prasant. 

April 5, 2013, 10:03 

#8 
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 237
Rep Power: 9 
How is your case with a simple rhoPimpleFoam ? Is your case stable with a static mesh ?
You can run a checkMesh at each step to check if the divergence come from the mesh Morphing. 

March 29, 2014, 00:15 

#9 
Member
xuheopenfoam
Join Date: Aug 2013
Location: DaLian，china
Posts: 82
Rep Power: 5 
hi !
could your rhoPimpleDyMFoam be used to simulate the water ? or it only could be used for gas computing? thanks xuhe 

April 18, 2014, 00:39 
discussion

#10 
Member
xuheopenfoam
Join Date: Aug 2013
Location: DaLian，china
Posts: 82
Rep Power: 5 
hello everyone!
which do you think is easier ： 1 developing a rhoPimpleDyMFoam from rhoPimpleFoam 2 developing a compressiblePimpleDyMFoam from PimpleDyMFoam 

April 18, 2014, 04:20 

#11 
Member
prasant
Join Date: Jan 2013
Posts: 31
Rep Power: 5 
Hello,
The solver is already availalble in the current version OpenFOAM You can check the compressible solvers in OpenFOAM2.3.0 Its well working. Regards Prasant. 

April 18, 2014, 08:10 

#12 
Member
xuheopenfoam
Join Date: Aug 2013
Location: DaLian，china
Posts: 82
Rep Power: 5 
thanks for your reply !
I have check the compressible solvers in OpenFOAM2.3.0 , but I didn't find the solver . http://www.openfoam.org/docs/user/st...p#x13890003.5 could you help me? 

April 19, 2014, 07:37 

#13 
Member
prasant
Join Date: Jan 2013
Posts: 31
Rep Power: 5 
Hello,
It is available. Download OpenFOAM2.3.0. and See the compressible solvers. It is located in the rhoPimpleFOAM. there is a solver called rhoPimpleDymFoam. It was implemented from OpenFOAM2.2.1 onwards and working fine. The page which you are seeing in the OpenFOAM website is just for information only. We need to download and see each and every thing at every latest Release. Since this is a open source code, don't expect more information from the site. We need to explore..... Regards Prasant 

April 19, 2014, 11:18 

#14 
Member
xuheopenfoam
Join Date: Aug 2013
Location: DaLian，china
Posts: 82
Rep Power: 5 
thanks ！
I will explore ! 

April 26, 2014, 08:29 
rhoPimpleDyMFoam for transonic flow

#15 
New Member
Christian
Join Date: Nov 2013
Posts: 7
Rep Power: 4 
Hello everybody!
I'm trying to simulate a rotating compressorblade with rhoPimpleDyMFoam. I use cyclicAMI and a dynamic mesh. The solver I use is GAMG in general. Due to the high Ma (Ma=0,95) I need to run the simulation transonic, but it doesnt work. It seems, that the pressure explodes after a little while. First I thought its based on bad startupconditions, so I decided to make a starting solution with transonic = no. If I switch off the transonicoption everything works fine and I get a Solution. When I turn it back on the same problem appears again. What can I do? Is it simply not possible or am I doing something wrong? Thanks for your support. Best regards, Christian. 

June 16, 2014, 10:34 
rhoPimpleDymFoam.parallel solving

#16 
New Member
S. Javad Saharkhiz
Join Date: Sep 2013
Location: Iran
Posts: 21
Rep Power: 5 
hi every body
I'm trying to solve my case with rhoPimpleDymFoam When I write rhoPimpleDymFoam in terminal , my case solves correctly but when I want to solve by parallel situation,it give me this error in rhoPimpleDymFoam.log : Create time Create mesh for time = 0 Selecting dynamicFvMesh dynamicMotionSolverFvMesh Selecting motion solver: displacementLaplacian Selecting motion diffusion: inverseDistance PIMPLE: Operating solver in PISO mode Reading thermophysical properties Selecting thermodynamics package { type hePsiThermo; mixture pureMixture; transport sutherland; thermo hConst; equationOfState perfectGas; specie specie; energy sensibleEnthalpy; } Reading field U Reading/calculating face flux field phi Creating turbulence model Selecting turbulence model type RASModel Selecting RAS turbulence model kEpsilon kEpsilonCoeffs { Cmu 0.09; C1 1.44; C2 1.92; C3 0.33; sigmak 1; sigmaEps 1.3; Prt 1; } Creating field dpdt Creating field kinetic energy K No finite volume options present Courant Number mean: 4.35221 max: 91.4995 Starting time loop Courant Number mean: 0.0460965 max: 1.04908 deltaT = 5.20885e06 Time = 5.20885e06 DICPCG: Solving for cellDisplacementx, Initial residual = 0, Final residual = 0, No Iterations 0 DICPCG: Solving for cellDisplacementy, Initial residual = 1, Final residual = 8.12622e09, No Iterations 102 GAMG: Solving for pcorr, Initial residual = 1, Final residual = 0.00856315, No Iterations 13 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 rhoEqn max/min : 1.50713 0.482044 smoothSolver: Solving for Ux, Initial residual = 0.0041289, Final residual = 8.5165e08, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 0.00335382, Final residual = 1.45029e07, No Iterations 2 smoothSolver: Solving for h, Initial residual = 0.0345707, Final residual = 7.37076e07, No Iterations 2 GAMG: Solving for p, Initial residual = 0.00353276, Final residual = 1.39692e08, No Iterations 1 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 0.733222, global = 0.520471, cumulative = 0.520471 rho max/min : 2 0.5 GAMG: Solving for p, Initial residual = 0.000194151, Final residual = 9.01511e10, No Iterations 1 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 0.73311, global = 0.520391, cumulative = 1.04086 rho max/min : 2 0.5 GAMG: Solving for p, Initial residual = 2.18972e06, Final residual = 2.5789e10, No Iterations 1 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 time step continuity errors : sum local = 0.73311, global = 0.520391, cumulative = 1.56125 rho max/min : 2 0.5 smoothSolver: Solving for epsilon, Initial residual = 0.0295855, Final residual = 9.76084e08, No Iterations 3 smoothSolver: Solving for k, Initial residual = 0.0882087, Final residual = 1.24819e07, No Iterations 3 ExecutionTime = 0.25 s ClockTime = 0 s . . . Courant Number mean: 0.0453958 max: 0.998186 deltaT = 5.34283e06 Time = 8.4506e05 DICPCG: Solving for cellDisplacementx, Initial residual = 0, Final residual = 0, No Iterations 0 DICPCG: Solving for cellDisplacementy, Initial residual = 0.101147, Final residual = 8.99411e09, No Iterations 90 GAMG: Solving for pcorr, Initial residual = 1, Final residual = 0.00702641, No Iterations 9 diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 rhoEqn max/min : 2.03222 0.464785 smoothSolver: Solving for Ux, Initial residual = 0.0042863, Final residual = 9.48459e08, No Iterations 2 smoothSolver: Solving for Uy, Initial residual = 0.00329678, Final residual = 1.42144e07, No Iterations 2 smoothSolver: Solving for h, Initial residual = 0.0230587, Final residual = 3.37243e07, No Iterations 2 [2] #0 Foam::error: :rintStack(Foam::Ostream&) at ??:? [2] #1 Foam::sigFpe::sigHandler(int) at ??:? [2] #2 in "/lib/x86_64linuxgnu/libc.so.6" [2] #3 Foam::hePsiThermo<Foam: :siThermo, Foam: : ureMixture<Foam::sutherlandTransport<Foam::species ::thermo<Foam::hConstThermo<Foam: : erfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > > >::calculate() at ??:? [2] #4 Foam::hePsiThermo<Foam: :siThermo, Foam: : ureMixture<Foam::sutherlandTransport<Foam::species ::thermo<Foam::hConstThermo<Foam: : erfectGas<Foam::specie> >, Foam::sensibleEnthalpy> > > >::correct() at ??:? [2] #5 [2] at ??:? [2] #6 __libc_start_main in "/lib/x86_64linuxgnu/libc.so.6" [2] #7 [2] at ??:? *** Process received signal *** Signal: Floating point exception (8) Signal code: (6) Failing at address: 0x3e800000dd7 [ 0] /lib/x86_64linuxgnu/libc.so.6(+0x370b0) [0x7f71007a70b0] [ 1] /lib/x86_64linuxgnu/libc.so.6(gsignal+0x37) [0x7f71007a7037] [ 2] /lib/x86_64linuxgnu/libc.so.6(+0x370b0) [0x7f71007a70b0] [ 3] /opt/openfoam221/platforms/linux64GccDPOpt/lib/libfluidThermophysicalModels.so(_ZN4Foam11hePsiThe rmoINS_9psiThermoENS_11pureMixtureINS_19sutherland TransportINS_7species6thermoINS_12hConstThermoINS_ 10perfectGasINS_6specieEEEEENS_16sensibleEnthalpyE EEEEEEE9calculateEv+0x20f) [0x7f7105b513bf] [ 4] /opt/openfoam221/platforms/linux64GccDPOpt/lib/libfluidThermophysicalModels.so(_ZN4Foam11hePsiThe rmoINS_9psiThermoENS_11pureMixtureINS_19sutherland TransportINS_7species6thermoINS_12hConstThermoINS_ 10perfectGasINS_6specieEEEEENS_16sensibleEnthalpyE EEEEEEE7correctEv+0x32) [0x7f7105b5d9f2] [ 5] rhoPimpleDyMFoam() [0x42a05b] [ 6] /lib/x86_64linuxgnu/libc.so.6(__libc_start_main+0xf5) [0x7f7100791ea5] [ 7] rhoPimpleDyMFoam() [0x42feb5] *** End of error message ***  mpirun noticed that process rank 2 with PID 3543 on node jvdK53SV exited on signal 8 (Floating point exception). I don't understand any thing of this error.Can every body help me to solve this error? Thanks before 

June 16, 2014, 13:23 

#17 
Member
prasant
Join Date: Jan 2013
Posts: 31
Rep Power: 5 
Hello,
As per your log file, you are not using AMI approach, correct??? Then there may be a data transfer from one processor to another processor is not doing well. check your decomposition settings. Be sure that if you are using hierarchical decomposition means, use the partitions equally in all directions. for example, 8 processors means use (2 2 2). So that data transfer between the processors will be uniform and it will not diverge. let me know if you are still facing the issue. Regards Prasanth. 

June 17, 2014, 04:16 

#18 
New Member
S. Javad Saharkhiz
Join Date: Sep 2013
Location: Iran
Posts: 21
Rep Power: 5 
hi prasant
Thank u for your replay. Can u please say me what is the AMI approach? I don't know about that my method for decomposition is simple and it's my decomposeParDict : numberOfSubdomains 6; method simple; simpleCoeffs { n ( 3 2 1 ); delta 0.001; } hierarchicalCoeffs { n ( 3 2 1 ); delta 0.001; order xyz; } thanks a lot. 

October 9, 2014, 12:10 

#19 
Member
Christian
Join Date: Apr 2014
Posts: 72
Rep Power: 4 
Dear all,
I am having problems starting a rhoPimpleDyMFoam simulation. The Error is the following #0 Foam::error:rintStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 in "/lib/x86_64linuxgnu/libc.so.6" #3 Foam::hePsiThermo<Foam:siThermo, Foam:ureMixture<Foam::sutherlandTransport<Foam:: species::thermo<Foam::hConstThermo<Foam:erfectGa s<Foam::specie> >, Foam::sensibleEnthalpy> > > >::calculate() at ??:? It appears at the beginning. Does anyone had a similar mistake? should I correct something in the source code? I can provide the case if you want. Thanks in advance! 

October 9, 2014, 12:11 

#20 
Member
Christian
Join Date: Apr 2014
Posts: 72
Rep Power: 4 
((continuing the error message )
#4 Foam:siThermo::addfvMeshConstructorToTable<Foam: :hePsiThermo<Foam:siThermo, Foam:ureMixture<Foam::sutherlandTransport<Foam:: species::thermo<Foam::hConstThermo<Foam:erfectGa s<Foam::specie> >, Foam::sensibleEnthalpy> > > > >::New(Foam::fvMesh const&, Foam::word const&) at ??:? #5 Foam::autoPtr<Foam:siThermo> Foam::basicThermo::New<Foam:siThermo>(Foam::fvMe sh const&, Foam::word const&) at ??:? #6 Foam:siThermo::New(Foam::fvMesh const&, Foam::word const&) at ??:? #7 at ??:? #8 __libc_start_main in "/lib/x86_64linuxgnu/libc.so.6" #9 at ??:? Floating point exception (core dumped) 

Tags 
compressible flow, pitching, rhopimpledymfoam 
Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
thobois class engineTopoChangerMesh error  Peter_600  OpenFOAM  4  August 2, 2014 09:52 
A New Solver for Supersonic Combustion  nakul  OpenFOAM  6  March 30, 2014 03:00 
A New Solver for Supersonic Combustion  nakul  OpenFOAM Announcements from Other Sources  18  February 19, 2013 08:48 
problem with developing new LES solver  Edison_Ge  OpenFOAM  2  June 18, 2009 01:26 
why the solver reject it? Anyone with experience?  bearcat  CFX  6  April 28, 2008 14:08 