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<http://main.cc/>: 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
_______________________________________________ DuMux mailing list [email protected] https://listserv.uni-stuttgart.de/mailman/listinfo/dumux
