|
[Sponsors] |
Implementing a dynamic mesh motion solver in an accelerating frame |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 21, 2015, 20:28 |
Implementing a dynamic mesh motion solver in an accelerating frame
|
#1 | |
Member
Pruthvi
Join Date: Feb 2014
Posts: 41
Rep Power: 12 |
Hello everybody,
I'm trying to simulate a plunging and pitching airfoil. The pitch amplitude is upto 70 degrees and plunge amplitude is upto 1 chord length. Therefore a deforming mesh did not seem very wise. I went through a paper by kinsey and dumas and they have implemented a solver in the heaving reference frame by adding a source term to the Navier stokes. This means that the N-S equation has a time varying body force term in the RHS. The time varying term looks like this. Code:
F = F*sin(w*t) I was able to implement this in pimpleFoam by the following additions to the pimpleFoam.C code and compile it with no issues. Here is the repository for those who prefer that and want test what I did. Code:
int main(int argc, char *argv[]) { const dimensionedScalar gunits("gunits", dimensionSet(0,1,-2,0,0,0,0), 0.01574684362); #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" #include "readGravitationalAcceleration.H" #include "createFields.H" #include "createFvOptions.H" #include "initContinuityErrs.H" pimpleControl pimple(mesh); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; while (runTime.run()) { #include "readTimeControls.H" #include "CourantNo.H" #include "setDeltaT.H" runTime++; g=gunits*Foam::sin(runTime.value()*2*pi*freQ)*vector(0,1,0); Info<< "Time = " << runTime.timeName() << nl << endl; // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { #include "UEqn.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; } Code:
tmp<fvVectorMatrix> UEqn ( fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) == fvOptions(U) ); UEqn().relax(); fvOptions.constrain(UEqn()); volScalarField rAU(1.0/UEqn().A()); if (pimple.momentumPredictor()) { Code:
Making dependency list for source file inertial_pimpleDyMFoam.C SOURCE=inertial_pimpleDyMFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I.. -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/turbulenceModels/incompressible/turbulenceModel -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/transportModels -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/transportModels/incompressible/singlePhaseTransportModel -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/fvOptions/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/sampling/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/dynamicFvMesh/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/dynamicMesh/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/meshTools/lnInclude -IlnInclude -I. -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OpenFOAM/lnInclude -I/opt/OpenFOAM/OpenFOAM-2.3.x/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/inertial_pimpleDyMFoam.o inertial_pimpleDyMFoam.C: In function ‘int main(int, char**)’: inertial_pimpleDyMFoam.C:79:2: error: ‘g’ was not declared in this scope g=gunits*Foam::sin(runTime.value()*freQ)*vector(0,1,0); ^ In file included from inertial_pimpleDyMFoam.C:61:0: /opt/OpenFOAM/OpenFOAM-2.3.x/src/finiteVolume/lnInclude/readTimeControls.H:38:8: warning: unused variable ‘maxDeltaT’ [-Wunused-variable] scalar maxDeltaT = ^ make: *** [Make/linux64GccDPOpt/inertial_pimpleDyMFoam.o] Error 1 Can you guys help me solve this issue. I would really appreciate it if you could help me fix the error Code:
inertial_pimpleDyMFoam.C: In function ‘int main(int, char**)’: inertial_pimpleDyMFoam.C:79:2: error: ‘g’ was not declared in this scope |
||
March 22, 2015, 16:18 |
|
#2 |
Member
Pruthvi
Join Date: Feb 2014
Posts: 41
Rep Power: 12 |
Problem Solved !
I forgot to add #include "readGravitationalAcceleration.H" to pimpleDyMFoam solver and that was causing the trouble. Here the new code. Code:
int main(int argc, char *argv[]) { const dimensionedScalar gunits("gunits", dimensionSet(0,1,-2,0,0,0,0), 0.01574684362); #include "setRootCase.H" #include "createTime.H" #include "createDynamicFvMesh.H" #include "initContinuityErrs.H" #include "readGravitationalAcceleration.H" pimpleControl pimple(mesh); #include "createFields.H" #include "createUf.H" #include "createFvOptions.H" #include "readTimeControls.H" #include "createPcorrTypes.H" #include "CourantNo.H" #include "setInitialDeltaT.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; while (runTime.run()) { #include "readControls.H" #include "CourantNo.H" #include "setDeltaT.H" runTime++; g=gunits*Foam::sin(runTime.value()*freQ)*vector(0,1,0); Info<< "Time = " << runTime.timeName() << nl << endl; mesh.update(); |
|
Tags |
accelerating frame, pimpledymfoam, solver compilation error |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
RBF motion solver implementation | ZoeWu | OpenFOAM Pre-Processing | 2 | December 23, 2021 15:30 |
Star cd es-ice solver error | ernarasimman | STAR-CD | 2 | September 12, 2014 01:01 |
Using reference frame motion or mesh motion? | jiejie | FLUENT | 5 | August 8, 2013 02:29 |
Mesh motion and frame motion | saisanthoshm88 | FLUENT | 0 | October 16, 2012 10:54 |
Bug in turbulent dynamic Mesh Solver | thomas | OpenFOAM Running, Solving & CFD | 0 | October 29, 2008 04:48 |