Dears ,

Thanks for your reply.

How can I update the fields in every time step?

Thanks for your help.

Best,
Mohammad

Get Outlook for Android<https://aka.ms/AAb9ysg>

________________________________
From: Timo Koch <[email protected]>
Sent: Wednesday, October 12, 2022, 2:31 PM
To: DuMuX User Forum <[email protected]>
Cc: [email protected] <[email protected]>; 
Mohammad Hodroj (Student) <[email protected]>
Subject: Re: [DuMux] Printing Permeability in VTK Files

Dear Mohammad,

as Dennis said, you have to update the fields in every time step when they are 
time-dependent but you don’t seem to do that in your main file

Timo

On 12 Oct 2022, at 13:25, Mohammad Hodroj (Student) 
<[email protected]<mailto:[email protected]>> wrote:

Dears,

Thanks for your email.

Kindly, find attached the requested files (spatial, problem, and main).

Looking forward to your help.

Best Regards,
Mohammad
________________________________
From: Timo Koch <[email protected]<mailto:[email protected]>>
Sent: Wednesday, October 12, 2022 1:58 PM
To: DuMuX User Forum 
<[email protected]<mailto:[email protected]>>
Cc: Mohammad Hodroj (Student) <[email protected]<mailto:[email protected]>>
Subject: Re: [DuMux] Printing Permeability in VTK Files

Dear Mohammad,

it’s bit difficult to read code snippets as a listing because it matter where 
things are in the file.
If below doesn’t help it would be great if you could attach the spatial params 
header instead.

In (6.) you have "return permeability;” where permeability does not have a 
trailing underscore. Is there another variable in your code?
Also since your permeability function only takes the position as input 
argument, you don’t need to build VolumeVariables when updating the output 
vector.
using "permeabilityAtPos(scv.dofPosition())" gives you the permeability value 
directly.

Best wishes
Timo


On 12 Oct 2022, at 12:40, Mohammad Hodroj (Student) 
<[email protected]<mailto:[email protected]>> wrote:

Dear DuMux Community,

I hope this email finds you well.

I am writing to kindly ask for your support in this matter:

Given:


  1.  I am using the porous medium flow model (injection problem)
  2.
The Problem is :

  1.
  template<class FVGridGeometry, class Scalar>
  class InjectionSpatialParams
: public FVSpatialParams<FVGridGeometry, Scalar, 
InjectionSpatialParams<FVGridGeometry, Scalar>>
  2.
  3.  PermeabilityType = Scalar
  4.  I am using PorosityAtPos (const GlobalPos& globalPos) const

  1.  {

                 if (isInCement_(globalPos))  {

                 // certain conditions
                 cementPorosity_ = equation (xxx)
               // at each globalpos[2] there is a new porosity value
                 return cementPorosity;

         }

               else if (isInAquifer_(globalPos))
               return aquiferPorosity_;
               else
                return overburdenPorosity_;
     }

  1.   I am using PermeabilityAtPos (const GlobalPos& globalPos) const
  2.
  3.

  1.  {

              Scalar cementPor_;
               Scalar cementK_;
               const Scalar dc_Porosity = 0.3;
               Scalar InitialCementK_ = 8.645e-13;

               if (isInCement_(globalPos))
           {

                cementPor_ = porosityAtPos( globalPos);    // calling porosity 
function
                cementK_ = InitialCementK_ *(std::pow(((1-dc_Porosity)/(1- 
cementPor_)),2) *(std::pow(( cementPor_/dc_Porosity), 3)));

               //std::cout<< " Porosity:"<< cementPor_ <<" Permeability:"<< 
cementK_ << std::endl;

              return cementK_;
            }

            else if (isInAquifer_(globalPos))
            return aquiferK_;
            else
            return overburdenK_;}


  1.  I am using a function to return permeability for additional vtk output :
  2.
  3.
const std::vector<Scalar>& getpermeability()
  4.

    {
        return permeability;


        }

  1.  I am using a function that updates the permeability for additional vtk 
output

           void updateVtkOutput(const SolutionVector& curSol)
         {
           auto fvGeometry = localView(this->gridGeometry());
           for (const auto& element : elements(this->gridGeometry().gridView()))
         {
            const auto elemSol = elementSolution(element, curSol, 
this->gridGeometry());
            fvGeometry.bindElement(element);

            for (auto&& scv : scvs(fvGeometry))
            {
                VolumeVariables volVars;
                volVars.update(elemSol, *this, element, scv);
                const auto dofIdxGlobal = scv.dofIndex();
                permeability_[dofIdxGlobal] = volVars.permeability();

            }
            }
            }

  1.  I added the following to return the permeability for addtional vtk output 
in 
main.cc<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmain.cc%2F&data=05%7C01%7Cmnh43%40mail.aub.edu%7C760e1b91fbc049a5f29908daac455142%7Cc7ba5b1a41b643e9a1206ff654ada137%7C1%7C0%7C638011710971994002%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=eiAWZXHqZsddRDXp%2BQdB7BZxXz49qEaeErVFaOgFZik%3D&reserved=0>:

         vtkWriter.addField(problem->getpermeability(), "Permeability");
          problem->updateVtkOutput(x);
          vtkWriter.write(0.0);

  1.  I am using also the following:

         unsigned int codim = GetPropType<TypeTag, 
Properties::GridGeometry>::discMethod == DiscretizationMethod::box? dim : 0;
         permeability_.resize(fvGridGeometry->gridView().size(codim));



Issue

  1.  I can see the different permeability values of the cement layer (which 
are dependent on porosity) while printing them in the terminal but not in vtu 
files and ParaView.
  2.  I can see in the vtu files only the initial value of permeability 
(constant) of the cement layer.

       Note: I can see the new porosity values of the cement layer in ParaView 
as well as upon printing them in the terminal (porosity changing with time)​

       So, how can I get the new values of permeability as appearing in the 
terminal in the vtu files ( similar to porosity)?


Thanks for your help.

Best Regards,
Mohammad Hodroj



_______________________________________________
DuMux mailing list
[email protected]<mailto:[email protected]>
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.uni-stuttgart.de%2Fmailman%2Flistinfo%2Fdumux&data=05%7C01%7Cmnh43%40mail.aub.edu%7C760e1b91fbc049a5f29908daac455142%7Cc7ba5b1a41b643e9a1206ff654ada137%7C1%7C0%7C638011710971994002%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=w8wbPxYRKEqvWncR5vKCxvXEFuuzBtWd9HpBDKRvFtM%3D&reserved=0>

<2pmain.cc<https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2F2pmain.cc%2F&data=05%7C01%7Cmnh43%40mail.aub.edu%7C760e1b91fbc049a5f29908daac455142%7Cc7ba5b1a41b643e9a1206ff654ada137%7C1%7C0%7C638011710971994002%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Vm4nbmT8ojVjQgLa7ZsX8ezRap84RcFDhF1y2CHwegY%3D&reserved=0>><injection2pproblem.hh><spatialparams.hh>


_______________________________________________
DuMux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

Reply via email to