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

Warning in flux mapping table with dynamicRefineFvMesh

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 11, 2022, 15:47
Default Warning in flux mapping table with dynamicRefineFvMesh
  #1
New Member
 
Joshua Christopher
Join Date: Jul 2022
Posts: 7
Rep Power: 3
JChristopher is on a distinguished road
Hello,

I am trying to run a simulation with dynamic meshing using dynamicRefineFvMesh. I am using the EHD solver from https://github.com/iroghair/openFoamEHD but upgraded it to work on OpenFOAM 8. This issue also exists in OpenFOAM 2.3 and the original unmodified version of the EHD solver. I noticed a pair of warnings in my output:

Quote:
--> FOAM Warning :
From function Foam::autoPtr<Foam::mapPolyMesh> Foam::dynamicRefineFvMesh::refine(const labelList&)
in file dynamicRefineFvMesh/dynamicRefineFvMesh.C at line 308
Cannot find surfaceScalarField ((interpolate(eps)*magSf)*snGradCorr(Ue)) in user-provided flux mapping table
12
(
rhoPhi none
phi none
nHatf none
alphaPhi0.phase1 none
alphaPhiUn none
rhoEFlux none
rho*phi none
Ue none
ghf none
phiAbs none
rhoE none
alphaPhi none
)
The flux mapping table is used to recreate the flux on newly created faces.
Either add the entry if it is a flux or use (((interpolate(eps)*magSf)*snGradCorr(Ue)) none) to suppress this warning.
--> FOAM Warning :
From function Foam::autoPtr<Foam::mapPolyMesh> Foam::dynamicRefineFvMesh::refine(const labelList&)
in file dynamicRefineFvMesh/dynamicRefineFvMesh.C at line 308
Cannot find surfaceScalarField ((-interpolate(sgm)*magSf)*snGrad(Ue)) in user-provided flux mapping table
12
(
rhoPhi none
phi none
nHatf none
alphaPhi0.phase1 none
alphaPhiUn none
rhoEFlux none
rho*phi none
Ue none
ghf none
phiAbs none
rhoE none
alphaPhi none
)
The flux mapping table is used to recreate the flux on newly created faces.
Either add the entry if it is a flux or use (((-interpolate(sgm)*magSf)*snGrad(Ue)) none) to suppress this warning.
I added the suggested suppression to dynamicMeshDict/correctFluxes:


Code:
  correctFluxes
    (
     (phi none)
     (rhoPhi none)
     (ghf none)
     (alphaPhi none)
     (alphaPhiUn none)
     (alphaPhi0.phase1 none)
     (Ue none)
     (rhoE none)
     (nHatf none)
     (rho*phi none)
     (phiAbs none)
     (rhoEFlux none)
     (((-interpolate(sgm)*magSf)*snGrad(Ue)) none)
     );
However this gives the error:

Quote:
[3] --> FOAM FATAL IO ERROR:
[3] wrong token type - expected word, found on line 0 the punctuation token '('
[3]
[3] file: IOstream/dynamicRefineFvMeshCoeffs/correctFluxes at line 0.
[3]
[3] From function Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::word&)
The code where this expressions is used is:
Code:
             surfaceScalarField rhoEFlux = -fvc::interpolate(sgm)*mesh.magSf()*fvc::snGrad(Ue);
             fvScalarMatrix rhoEEqn
             (
                 fvm::ddt(rhoE)
               + fvm::div(phi, rhoE)
               + fvc::div(rhoEFlux)
             );
              rhoEEqn.solve();
This issue is essentially identical to this thread:

dynamic Mesh, correct fluxes, surfaceScalarFields

However, that thread was not resolved and the suggestions in that thread did not help me. As you can see in the correctFluxes above, I also tried putting (rhoEFlux none) into correctFluxes.


Does anyone have any suggestions on how to correctly add that surfaceScalarField with parenthesis into correctFluxes?


Thank you,
Joshua
JChristopher is offline   Reply With Quote

Old   October 18, 2022, 15:17
Default
  #2
New Member
 
Joshua Christopher
Join Date: Jul 2022
Posts: 7
Rep Power: 3
JChristopher is on a distinguished road
Hello everyone,

I was able to resolve the warning by making the following changes to the solver:

1. In createFields.H, create the surfaceScalarField for rhoEFlux:
Code:
surfaceScalarField rhoEFlux
(
    IOobject
    (
        "rhoEFlux",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::NO_WRITE
    ),
    -fvc::interpolate(sgm)*mesh.magSf()*fvc::snGrad(Ue)
 );

2. In the solver instead of creating a temporary surfaceScalarField at each time step, I just compute the update to the rhoEFlux that is now in createFields.H:

Code:
rhoEFlux = -fvc::interpolate(sgm)*mesh.magSf()*fvc::snGrad(Ue);
This seems to be sufficient for OpenFOAM to detect the flux by the name RhoEFlux.


3. In dynamicMeshDict my correctFluxes looks like:
Code:
  correctFluxes
    (
     (phi none)
     (rhoPhi none)
     (ghf none)
     (alphaPhi none)
     (alphaPhiUn none)
     (alphaPhi0.phase1 none)
     (Ue none)
     (rhoE none)
     (nHatf none)
     (rho*phi none)
     (phiAbs none)
     (rhoEFlux none)
     );
to perform no flux corrections of rhoEFlux.


In my original post you notice there are two warnings, one for the positive and one for the negative sign on rhoEFlux. I had to duplicate this process and swap the sign to get the second warning to go away.

I don't know if this is a workaround or the correct method of resolving this, but the warning is gone so presumably I can now correct the rhoEFlux by velocity.


Thanks,
Joshua
JChristopher is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[Gmsh] discretizer - gmshToFoam Andyjoe OpenFOAM Meshing & Mesh Conversion 13 March 14, 2012 04:35
OpenFOAM Solaris mamaly60 OpenFOAM Installation 13 May 10, 2010 21:16
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 04:37
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23
Warning 097- AB Siemens 6 November 15, 2004 04:41


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