CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

ghRef Dynamic Meshing

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 25, 2016, 19:04
Default ghRef Dynamic Meshing
  #1
New Member
 
Will
Join Date: Dec 2011
Posts: 17
Rep Power: 14
willzyba is on a distinguished road
All,

Within iterDyMFoam you'll find on line 128
Code:
gh = (g & mesh.C()) - ghRef;
ghf = (g & mesh.Cf()) - ghRef;
What does ghRef actually do?

We're created as an enhancement to the package waveFoam and waveDyMFoam. Simply merging the two. But in waveDyMFoam we have to write:
Code:
gh = (g & mesh.C());
ghf = (g & mesh.Cf());
Because in create fields we have to swap out
Code:
#include "readGravitationalAcceleration.H"
#include "readhRef.H"
#include "gh.H"
with
Code:
volScalarField gh("gh", g & (mesh.C() - referencePoint));
surfaceScalarField ghf("ghf", g & (mesh.Cf() - referencePoint));
to avoid various double assignment of variables in the waveFoam.

Obviously the solution is to sort though headers, but before I get that far I'd love to know the importance of ghRef.
willzyba is offline   Reply With Quote

Old   May 20, 2016, 14:46
Default
  #2
New Member
 
Pierre-Henri Musiedlak
Join Date: Dec 2015
Posts: 11
Rep Power: 10
phmusi is on a distinguished road
Hello Manoj and Agustino,

I am struggling at the same step.

I found this:
http://www.cfd-online.com/Forums/ope...c-meshing.html

And proceed to the opposite: in createFields.H
uncomment the two #include and comment the two solScalar and surfaceSaclar:

original:
Code:
//include "readhRef.H"
//include "gh.H"
#volScalarField gh("gh", g & (mesh.C() - referencePoint));
#surfaceScalarField ghf("ghf", g & (mesh.Cf() - referencePoint));
new:
Code:
#include "readhRef.H"
#include "gh.H"
//volScalarField gh("gh", g & (mesh.C() - referencePoint));
//surfaceScalarField ghf("ghf", g & (mesh.Cf() - referencePoint));
At least now it compiles and the floating run (crash after but might be another issue ^^)

The other solution I found is to copy-paste the definition of gh.H just before it is used in waveDyMFoam, but in removing the two last lines.

Code:
if (mesh.changing())
                {
                    Info<< "Execution time for mesh.update() = "
                        << runTime.elapsedCpuTime() - timeBeforeMeshUpdate
                        << " s" << endl;

        dimensionedScalar ghRef
            (
                mag(g.value()) > SMALL
              ? g & (cmptMag(g.value())/mag(g.value()))*hRef
              : dimensionedScalar("ghRef", g.dimensions()*dimLength, 0)
            );
            //volScalarField gh("gh", (g & mesh.C()) - ghRef);
            //surfaceScalarField ghf("ghf", (g & mesh.Cf()) - ghRef);

                    gh = (g & mesh.C()) - ghRef;
                    ghf = (g & mesh.Cf()) - ghRef;
                }
AND by adding
Code:
#include "readhRef.H"
in the main (just after #include "readWaveProperties.H")

This way i am not altering the createFields.H

The simulation runs and then crash the same (hopefully meaning it does not come from here)

Cheers

Pierre-Henri
phmusi is offline   Reply With Quote

Reply

Tags
wavefoam


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
CFD simulation of gas cicrcuit breaker in fluent with dynamic meshing. Mahesh7238 FLUENT 1 April 5, 2021 01:21
Dynamic Meshing of Simple 2D Geometry harman79 FLUENT 2 January 17, 2018 07:07
UDF for dynamic meshing? prasaddeole FLUENT 2 October 6, 2014 12:55
negative cell volume during dynamic meshing Tamjid FLUENT 1 September 5, 2011 03:33
[GAMBIT] Dynamic Meshing of a combustion chamber donarundas ANSYS Meshing & Geometry 1 December 2, 2009 08:13


All times are GMT -4. The time now is 19:27.