diff --git a/appl/lecture/msm/buckleyleverett/buckleyleverett_analytic.hh b/appl/lecture/msm/buckleyleverett/buckleyleverett_analytic.hh index 66eb68089c1779fa65940f60584ddcf08096d7ab..523b7eb4525161eb6ff2f3510abc35aba6135c0a 100644 --- a/appl/lecture/msm/buckleyleverett/buckleyleverett_analytic.hh +++ b/appl/lecture/msm/buckleyleverett/buckleyleverett_analytic.hh @@ -352,8 +352,9 @@ public: problem_(problem), analyticSolution_(0), error_(0), elementVolume_(0), size_(problem.gridView().size(0)), vTot_(totalVelocity), dummyElement_( *(problem_.gridView().template begin<0> ())), dummyGlobal_(GlobalPosition(1)) { - initializeAnalytic(); - prepareAnalytic(); + initializeAnalytic(); + prepareAnalytic(); + } protected: diff --git a/appl/lecture/msm/buckleyleverett/buckleyleverett_ff.cc b/appl/lecture/msm/buckleyleverett/buckleyleverett_ff.cc index b8c9190eb3b741448187ba8c2a7107443a2fcfc4..101406a58201ae2adb0fab32a97cc04d7b2a5b3e 100644 --- a/appl/lecture/msm/buckleyleverett/buckleyleverett_ff.cc +++ b/appl/lecture/msm/buckleyleverett/buckleyleverett_ff.cc @@ -21,13 +21,13 @@ *****************************************************************************/ #include "config.h" -#include "external_interface.hh" #include "buckleyleverettproblem.hh" #include <dune/grid/common/gridinfo.hh> #include <dune/common/exceptions.hh> #include <dune/common/mpihelper.hh> +#include <dune/common/parametertreeparser.hh> #include <iostream> #include <boost/format.hpp> @@ -43,7 +43,7 @@ void usage(const char *progname) { - std::cout << boost::format("usage: %s tEnd\n")%progname; + std::cout << boost::format("usage: %s InputFileName\n")%progname; exit(1); } @@ -61,16 +61,30 @@ int main(int argc, char** argv) typedef GET_PROP_TYPE(TypeTag, PTAG(Problem)) Problem; typedef GET_PROP_TYPE(TypeTag, PTAG(TimeManager)) TimeManager; typedef Dune::FieldVector<Scalar, Grid::dimensionworld> GlobalPosition; + typedef typename GET_PROP(TypeTag, PTAG(ParameterTree)) Params; static const int dim = Grid::dimension; // initialize MPI, finalize is done automatically on exit Dune::MPIHelper::instance(argc, argv); + //////////////////////////////////////////////////////////// + // parse the command line arguments + //////////////////////////////////////////////////////////// + if (argc != 2) + usage(argv[0]); - //load interface-file - Dumux::InterfaceProblemProperties interfaceProbProps("interface_BL.xml"); - double discretizationLength = interfaceProbProps.IPP_DiscretizationLength; + std::string inputFileName; + inputFileName = argv[1]; + + + //////////////////////////////////////////////////////////// + // Read Input file + //////////////////////////////////////////////////////////// + + Dune::ParameterTreeParser::readINITree(inputFileName, Params::tree()); + + double discretizationLength = Params::tree().get<double>("Geometry.discretizationLength"); // define the problem dimensions Dune::FieldVector<Scalar, dim> lowerLeft(0); @@ -82,14 +96,8 @@ int main(int argc, char** argv) Dune::FieldVector<int, dim> cellNumbers(cellNumberX); cellNumbers[1] = cellNumberY; - if (argc != 2) - usage(argv[0]); - - std::string arg1(argv[1]); - std::istringstream is1(arg1); - double tEnd; - is1 >> tEnd; + double tEnd = Params::tree().get<double>("Problem.tEnd"); double dt = tEnd; // create a grid object @@ -100,15 +108,14 @@ int main(int argc, char** argv) // instantiate and run the concrete problem //////////////////////////////////////////////////////////// - Dumux::InterfaceFluidProperties interfaceFluidProps("interface_BL.xml"); typedef GET_PROP_TYPE(TypeTag, PTAG(WettingPhase)) WettingPhase; typedef GET_PROP_TYPE(TypeTag, PTAG(NonwettingPhase)) NonwettingPhase; - WettingPhase::Component::setViscosity(interfaceFluidProps.IFP_ViscosityWettingFluid); - NonwettingPhase::Component::setViscosity(interfaceFluidProps.IFP_ViscosityNonWettingFluid); + WettingPhase::Component::setViscosity(Params::tree().get<double>("Fluid.viscosityW")); + NonwettingPhase::Component::setViscosity(Params::tree().get<double>("Fluid.viscosityNW")); - WettingPhase::Component::setDensity(interfaceFluidProps.IFP_DensityWettingFluid); - NonwettingPhase::Component::setDensity(interfaceFluidProps.IFP_DensityNonWettingFluid); + WettingPhase::Component::setDensity(Params::tree().get<double>("Fluid.densityW")); + NonwettingPhase::Component::setDensity(Params::tree().get<double>("Fluid.densityNW")); TimeManager timeManager; Problem problem(timeManager, grid.leafView(), lowerLeft, upperRight); diff --git a/appl/lecture/msm/buckleyleverett/buckleyleverett_spatialparams.hh b/appl/lecture/msm/buckleyleverett/buckleyleverett_spatialparams.hh index 640f0b4f9837f0b81d6cc3ac425d5bc280300805..2196716478edef836305fc16dfddd9804fa2c7c1 100644 --- a/appl/lecture/msm/buckleyleverett/buckleyleverett_spatialparams.hh +++ b/appl/lecture/msm/buckleyleverett/buckleyleverett_spatialparams.hh @@ -69,6 +69,7 @@ class BuckleyLeverettSpatialParams: public FVSpatialParameters<TypeTag> typedef Dune::FieldVector<CoordScalar, dimWorld> GlobalPosition; typedef Dune::FieldMatrix<Scalar,dim,dim> FieldMatrix; + typedef typename GET_PROP(TypeTag, PTAG(ParameterTree)) Params; public: typedef typename GET_PROP_TYPE(TypeTag, PTAG(MaterialLaw)) MaterialLaw; @@ -95,30 +96,16 @@ public: BuckleyLeverettSpatialParams(const GridView& gridView) :ParentType(gridView) { - Dumux::InterfaceSoilProperties interfaceSoilProps("interface_BL.xml"); - - // residual saturations - materialLawParams_.setSwr(interfaceSoilProps.ISP_ResidualSaturationWetting); - materialLawParams_.setSnr(interfaceSoilProps.ISP_ResidualSaturationNonWetting); - - porosity_ = interfaceSoilProps.ISP_Porosity; - - // parameters for the Brooks-Corey Law - // entry pressures - materialLawParams_.setPe(interfaceSoilProps.ISP_BrooksCoreyEntryPressure); - // Brooks-Corey shape parameters - materialLawParams_.setLambda(interfaceSoilProps.ISP_BrooksCoreyLambda); - - constPermeability_ = interfaceSoilProps.ISP_Permeability; - - // parameters for the linear - // entry pressures function -// materialLawParams_.setEntryPC(0); -// materialLawParams_.setMaxPC(0); -// materialLawParams_.setEntryPC(2); -// materialLawParams_.setMaxPC(3); + Scalar permFactor = 0.001/(1000*9.81); + constPermeability_ = Params::tree().template get<double>("SpatialParameters.permeability")*permFactor; + //Lenses: + materialLawParams_.setSwr(Params::tree().template get<double>("SpatialParameters.swr")); + materialLawParams_.setSnr(Params::tree().template get<double>("SpatialParameters.snr")); + materialLawParams_.setPe(Params::tree().template get<double>("SpatialParameters.pe")); + materialLawParams_.setLambda(Params::tree().template get<double>("SpatialParameters.lambda")); + porosity_ = Params::tree().template get<double>("SpatialParameters.porosity"); } private: diff --git a/appl/lecture/msm/buckleyleverett/buckleyleverettproblem.hh b/appl/lecture/msm/buckleyleverett/buckleyleverettproblem.hh index 6e590eb15099822454315f9060977c9934808179..d7773b630d915035c7f5786a021225b33a965362 100644 --- a/appl/lecture/msm/buckleyleverett/buckleyleverettproblem.hh +++ b/appl/lecture/msm/buckleyleverett/buckleyleverettproblem.hh @@ -134,6 +134,7 @@ class BuckleyLeverettProblem: public IMPESProblem2P<TypeTag> typedef typename GridView::Traits::template Codim<0>::Entity Element; typedef typename GridView::Intersection Intersection; typedef Dune::FieldVector<Scalar, dimWorld> GlobalPosition; + typedef typename GET_PROP(TypeTag, PTAG(ParameterTree)) Params; public: BuckleyLeverettProblem(TimeManager& timeManager, const GridView &gridView, @@ -147,10 +148,28 @@ public: pLeftBc_(pleftbc), analyticSolution_(*this, 3e-7) { - //load interface-file - Dumux::InterfaceFluidProperties interfaceFluidProps("interface_BL.xml"); + densityNonWetting_ = Params::tree().template get<double>("Fluid.densityNW"); + + //Write header for ViPLab-Outputfile + double discretizationLength = Params::tree().template get<double>("Geometry.discretizationLength"); + int cellNumberX = static_cast<int>(300/discretizationLength); + int cellNumberY = static_cast<int>(75/discretizationLength); + + std::ofstream dataFile; + dataFile.open("dumux-out.vgfc"); + dataFile << "Gridplot" << std::endl; + dataFile << "## This is a DuMuX output for the ViPLab Graphics driver. \n"; + dataFile << "## This output file was generated at " << __TIME__ <<", "<< __DATE__<< "\n"; + dataFile << "# x-range 0 "<< 300 << "\n" ; + dataFile << "# y-range 0 "<< 75 << "\n" ; + dataFile << "# x-count " << cellNumberX << "\n" ; + dataFile << "# y-count " << cellNumberY << "\n" ; + dataFile << "# scale 1 1 1\n"; + + dataFile << "# min-color 255 0 0\n"; + dataFile << "# max-color 0 0 255\n"; + dataFile.close(); - densityNonWetting_ = interfaceFluidProps.IFP_DensityNonWettingFluid; } @@ -168,11 +187,9 @@ public: const char *name() const { std::string simName = "buckleyleverett_linear_run"; - Dumux::InterfaceProblemProperties interfaceProbProps("interface_BL.xml"); - Scalar simNum = interfaceProbProps.IPP_SimulationNumber; - return (str(boost::format("%s-%02d") - %simName%simNum).c_str()); + return (str(boost::format("%s-") + %simName).c_str()); } bool shouldWriteRestartFile() const @@ -267,12 +284,65 @@ public: values[SwIdx] = 0.2; } + + //Override outputfunction for ViPLab-Output +// void writeOutput() +// { +// +// //Todo: Diese Funktion weiterschreiben. +// std::cout<<"Writing output for time step.\n"; +// +// std::ofstream dataFile; +// dataFile.open("dumux-out.vgfc"); +// +// dataFile << "# time 0 \n" ; +// dataFile << "# label piezometric head \n"; +// +// for (int i=0; i< resolution[1]; i++) +// { +// for (int j=0; j<resolution[0]; j++) +// { +// int currentIdx = i*resolution[0]+j; +// dataFile << this->variables().pressure()[currentIdx]/(Fluid::density(0,0)*9.81); +// if(j != resolution[0]-1) // all but last entry +// dataFile << " "; +// else // write the last entry +// dataFile << "\n"; +// } +// } +//// dataFile.close(); +//// +//// //Textoutput: +//// std::cout << " x y h v_x v_y"<<std::endl; +//// std::cout << "------------------------------------------------------------"<<std::endl; +//// +//// ElementIterator eItEnd = this->gridView().template end<0> (); +//// for (ElementIterator eIt = this->gridView().template begin<0> (); eIt != eItEnd; ++eIt) +//// { +//// int cellIndex = this->variables().index(*eIt); +//// double v_x,v_y,piezo,x,y; +//// v_x= (this->variables().velocity()[cellIndex][0][0]+this->variables().velocity()[cellIndex][1][0])/2; +//// v_y= (this->variables().velocity()[cellIndex][2][1]+this->variables().velocity()[cellIndex][3][1])/2; +//// +//// if (std::abs(v_x)<1e-17) +//// v_x=0; +//// if (std::abs(v_y)<1e-17) +//// v_y=0; +//// piezo=this->variables().pressure()[cellIndex]/(Fluid::density(0,0)*9.81); +//// x = eIt->geometry().center()[0]; +//// y = eIt->geometry().center()[1]; +//// +//// printf("%10.4g %10.4g %10.4g %13.4g %13.4g\n",x,y,piezo,v_x,v_y); +//// } +// +// +// } + private: GlobalPosition lowerLeft_; GlobalPosition upperRight_; Scalar eps_; Scalar pLeftBc_; - Scalar simulationNumber_; Scalar densityNonWetting_; BuckleyLeverettAnalytic<TypeTag> analyticSolution_; }; diff --git a/appl/lecture/msm/buckleyleverett/dumux-in b/appl/lecture/msm/buckleyleverett/dumux-in new file mode 100644 index 0000000000000000000000000000000000000000..4485b27f1fd15cbf3f552ca077b16394f3daedab --- /dev/null +++ b/appl/lecture/msm/buckleyleverett/dumux-in @@ -0,0 +1,24 @@ +[SpatialParameters] + +permeability = 1e-7 +porosity = 0.2 + +swr = 0.2 +snr = 0.2 +pe = 0 +lambda = 2 + +[Fluid] + +densityW = 1e3 +densityNW = 1e3 +viscosityW = 1e-3 +viscosityNW = 1e-3 + +[Geometry] + +discretizationLength = 10 + +[Problem] + +tEnd = 5e7 diff --git a/appl/lecture/msm/buckleyleverett/external_interface.hh b/appl/lecture/msm/buckleyleverett/external_interface.hh deleted file mode 100644 index 114a4034dae9ef4e36f068ecdb4cd9939c4d5891..0000000000000000000000000000000000000000 --- a/appl/lecture/msm/buckleyleverett/external_interface.hh +++ /dev/null @@ -1,464 +0,0 @@ -/***************************************************************************** - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation, either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program. If not, see <http://www.gnu.org/licenses/>. * - *****************************************************************************/ -#ifndef PCM_PARAMETERS_HH -#define PCM_PARAMETERS_HH - -#include <stdlib.h> -#include <iostream> -#include <fstream> - -/** \todo Please doc me! */ -namespace Dumux -{ - -class InterfaceSoilProperties -//Class for Interface Soil Properties -//Integrate Parameters for Probabilistic Collocation Method (iPCM). -//Contained design and uncertainty parameters -{ -public: - //Interface Soil Properties (ISP): - float ISP_Permeability; // Permeability - float ISP_FinePermeability; // Fine Permeability - float ISP_CoarsePermeability; // Coarse Permeability - float ISP_Porosity; // Porosity - float ISP_FinePorosity; // Fine Porosity - float ISP_CoarsePorosity; // Coarse Porosity - float ISP_LeakageWellPermeability; // Leakage Well Permeability - float ISP_LongitudinalDispersivity; //Longitudinal dispersivity - float ISP_TransverseDispersivity; //Transverse dispersivity - float ISP_BrooksCoreyLambda; - float ISP_BrooksCoreyEntryPressure; - float ISP_FineBrooksCoreyLambda; - float ISP_FineBrooksCoreyEntryPressure; - float ISP_CoarseBrooksCoreyLambda; - float ISP_CoarseBrooksCoreyEntryPressure; - float ISP_ResidualSaturationWetting; - float ISP_ResidualSaturationNonWetting; - float ISP_FineResidualSaturationWetting; - float ISP_FineResidualSaturationNonWetting; - float ISP_CoarseResidualSaturationWetting; - float ISP_CoarseResidualSaturationNonWetting; - - InterfaceSoilProperties(const char* isp_filename) - //Initialization of ISP Parameters - { - using namespace std; - std::cout - << "-----> ISP: Interface Soil Properties Initialization ...\n"; - //ISP input file defenition - ifstream input; - - //ISP file check - input.open(isp_filename); - if (!input) - { - cout << "\n"; - cout << "-----> ISP: Fatal error! - Data read \n"; - cout << "-----> ISP: Could not open the input data file: \"" - << isp_filename << "\n"; - } - - //iPCM input file reading - char reader[100]; // variable for input value - while (!input.eof()) - { - input >> reader; - //if (reader==string("<SoilProperties>")) - //cout << "-----> ISP: Soil Properties reading ... \n"; - //ISP parameters initialization: - if (reader == string("<Permeability>")) - { - input >> reader; - ISP_Permeability = atof(reader); - cout << "-----> ISP: Permeability: " << ISP_Permeability - << "\n"; - } - if (reader == string("<FinePermeability>")) - { - input >> reader; - ISP_FinePermeability = atof(reader); - cout << "-----> ISP: Fine permeability: " - << ISP_FinePermeability << "\n"; - } - if (reader == string("<CoarsePermeability>")) - { - input >> reader; - ISP_CoarsePermeability = atof(reader); - cout << "-----> ISP: Coarse permeability: " - << ISP_CoarsePermeability << "\n"; - } - if (reader == string("<Porosity>")) - { - input >> reader; - ISP_Porosity = atof(reader); - cout << "-----> ISP: Porosity: " << ISP_Porosity << "\n"; - } - if (reader == string("<FinePorosity>")) - { - input >> reader; - ISP_FinePorosity = atof(reader); - cout << "-----> ISP: Fine porosity: " << ISP_FinePorosity - << "\n"; - } - if (reader == string("<CoarsePorosity>")) - { - input >> reader; - ISP_CoarsePorosity = atof(reader); - cout << "-----> ISP: Coarse porosity: " << ISP_CoarsePorosity - << "\n"; - } - if (reader == string("<LeakageWellPermeability>")) - { - input >> reader; - ISP_LeakageWellPermeability = atof(reader); - cout << "-----> ISP: Leakage Well Permeability: " - << ISP_LeakageWellPermeability << "\n"; - } - if (reader == string("<LongitudinalDispersivity>")) - { - input >> reader; - ISP_LongitudinalDispersivity = atof(reader); - cout << "-----> ISP: Longitudinal dispersivity: " - << ISP_LongitudinalDispersivity << "\n"; - } - if (reader == string("<TransverseDispersivity>")) - { - input >> reader; - ISP_TransverseDispersivity = atof(reader); - cout << "-----> ISP: Transverse dispersivity: " - << ISP_TransverseDispersivity << "\n"; - } - if (reader == string("<BrooksCoreyLambda>")) - { - input >> reader; - ISP_BrooksCoreyLambda = atof(reader); - cout << "-----> ISP: Brooks-Corey lambda: " - << ISP_BrooksCoreyLambda << "\n"; - } - - if (reader == string("<FineBrooksCoreyLambda>")) - { - input >> reader; - ISP_FineBrooksCoreyLambda = atof(reader); - cout << "-----> ISP: Brooks-Corey lambda, fine: " - << ISP_FineBrooksCoreyLambda << "\n"; - } - if (reader == string("<FineBrooksCoreyEntryPressure>")) - { - input >> reader; - ISP_FineBrooksCoreyEntryPressure = atof(reader); - cout << "-----> ISP: Brooks-Corey entry pressure, fine: " - << ISP_FineBrooksCoreyEntryPressure << "\n"; - } - if (reader == string("<CoarseBrooksCoreyLambda>")) - { - input >> reader; - ISP_CoarseBrooksCoreyLambda = atof(reader); - cout << "-----> ISP: Brooks-Corey lambda, coarse: " - << ISP_CoarseBrooksCoreyLambda << "\n"; - } - - if (reader == string("<BrooksCoreyEntryPressure>")) - { - input >> reader; - ISP_BrooksCoreyEntryPressure = atof(reader); - cout << "-----> ISP: Brooks-Corey entry pressure: " - << ISP_BrooksCoreyEntryPressure << "\n"; - } - if (reader == string("<CoarseBrooksCoreyEntryPressure>")) - { - input >> reader; - ISP_CoarseBrooksCoreyEntryPressure = atof(reader); - cout << "-----> ISP: Brooks-Corey entry pressure, coarse: " - << ISP_CoarseBrooksCoreyEntryPressure << "\n"; - } - if (reader == string("<ResidualSaturationWetting>")) - { - input >> reader; - ISP_ResidualSaturationWetting = atof(reader); - cout << "-----> ISP: Residual saturation wetting phase: " - << ISP_ResidualSaturationWetting << "\n"; - } - if (reader == string("<ResidualSaturationNonWetting>")) - { - input >> reader; - ISP_ResidualSaturationNonWetting = atof(reader); - cout << "-----> ISP: Residual saturation nonwetting phase: " - << ISP_ResidualSaturationNonWetting << "\n"; - } - if (reader == string("<FineResidualSaturationWetting>")) - { - input >> reader; - ISP_FineResidualSaturationWetting = atof(reader); - cout << "-----> ISP: Residual saturation wetting phase, fine: " - << ISP_FineResidualSaturationWetting << "\n"; - } - if (reader == string("<FineResidualSaturationNonWetting>")) - { - input >> reader; - ISP_FineResidualSaturationNonWetting = atof(reader); - cout << "-----> ISP: Residual saturation nonwetting phase, fine: " - << ISP_FineResidualSaturationNonWetting << "\n"; - } - if (reader == string("<CoarseResidualSaturationWetting>")) - { - input >> reader; - ISP_CoarseResidualSaturationWetting = atof(reader); - cout << "-----> ISP: Residual saturation wetting phase, coarse: " - << ISP_CoarseResidualSaturationWetting << "\n"; - } - if (reader == string("<CoarseResidualSaturationNonWetting>")) - { - input >> reader; - ISP_CoarseResidualSaturationNonWetting = atof(reader); - cout << "-----> ISP: Residual saturation nonwetting phase, coarse: " - << ISP_CoarseResidualSaturationNonWetting << "\n"; - } - } - input.close(); - } - -}; - -class InterfaceFluidProperties -//Class for Interface Fluid Properties -//Integrate Parameters for Probabilistic Collocation Method (iPCM). -//Contained design and uncertainty parameters -{ -public: - //Interface Fluid Properties (IFP): - float IFP_GasDiffCoeff;// Gas Diffusion Coefficient - float IFP_CO2ResidSat;// Residual Saturation of CO2 - float IFP_MolecularDiffusionCoefficient; - float IFP_ViscosityWettingFluid; - float IFP_ViscosityNonWettingFluid; - float IFP_DensityWettingFluid; - float IFP_DensityNonWettingFluid; - - InterfaceFluidProperties(const char* ifp_filename) - //Initialization of IFP Parameters - { - using namespace std; - std::cout - << "-----> IFP: Interface Fluid Properties Initialization ...\n"; - //IFP input file defenition - ifstream input; - - //IFP file check - input.open(ifp_filename); - if (!input) - { - cout << "\n"; - cout << "-----> IFP: Fatal error! - Data read \n"; - cout << "-----> IFP: Could not open the input data file: \"" - << ifp_filename << "\n"; - } - - //iPCM input file reading - char reader[100]; // variable for input value - //double K; - while (!input.eof()) - { - input >> reader; - //if (reader==string("<FluidProperties>")) - //cout << "-----> IFP: Fluid Properties reading ... \n"; - //IFP perameters initialization: - if (reader == string("<GasDiffusionCoeff>")) - { - input >> reader; - IFP_GasDiffCoeff = atof(reader); - cout << "-----> IFP: Gas Diffusion Coefficient: " - << IFP_GasDiffCoeff << "\n"; - } - if (reader == string("<CO2ResidualSaturation>")) - { - input >> reader; - IFP_CO2ResidSat = atof(reader); - cout << "-----> IFP: Residual Saturation of CO2: " - << IFP_CO2ResidSat << "\n"; - } - if (reader == string("<MolecularDiffusionCoefficient>")) - { - input >> reader; - IFP_MolecularDiffusionCoefficient = atof(reader); - cout << "-----> IFP: Molecular diffusion coefficient: " - << IFP_MolecularDiffusionCoefficient << "\n"; - } - if (reader == string("<ViscosityWettingFluid>")) - { - input >> reader; - IFP_ViscosityWettingFluid = atof(reader); - cout << "-----> IFP: Viscosity of the wetting phase fluid: " - << IFP_ViscosityWettingFluid << "\n"; - } - if (reader == string("<ViscosityNonWettingFluid>")) - { - input >> reader; - IFP_ViscosityNonWettingFluid = atof(reader); - cout << "-----> IFP: Viscosity of the non wetting phase fluid: " - << IFP_ViscosityNonWettingFluid << "\n"; - } - if (reader == string("<DensityWettingFluid>")) - { - input >> reader; - IFP_DensityWettingFluid = atof(reader); - cout << "-----> IFP: Density of the wetting phase fluid: " - << IFP_DensityWettingFluid << "\n"; - } - if (reader == string("<DensityNonWettingFluid>")) - { - input >> reader; - IFP_DensityNonWettingFluid = atof(reader); - cout << "-----> IFP: Density of the non wetting phase fluid: " - << IFP_DensityNonWettingFluid << "\n"; - } - } - input.close(); - } - -}; - -class InterfaceProblemProperties -//Class for Interface Problem Properties -//Integrate Parameters for Probabilistic Collocation Method (iPCM). -//Contained design and uncertainty parameters -{ -public: - //Interface Problem Properties (IPP): - float IPP_DepthBOR; // Depth BOR - float IPP_InjectionWellRate; // Injection Well Rate - float IPP_InjectionWindowSize; // Injection Well Window Size - float IPP_UpperPressure; // Pressure at a top boundary - float IPP_LowerPressure; // Pressure at a lower boundary - float IPP_InfiltrationRate; // A Infiltration rate - float IPP_MaxTimeStepSize; // Maximum time step size - float IPP_InfiltrationStartTime; // time to stop an infiltration - float IPP_InfiltrationEndTime; // time to stop an infiltration - float IPP_DiscretizationLength; - float IPP_SimulationNumber; // possibility to enumerate the model run outputs - - InterfaceProblemProperties(const char* ipp_filename) - //Initialization of IPP Parameters - { - using namespace std; - std::cout - << "-----> IPP: Interface Problem Properties Initialization ...\n"; - //IPP input file defenition - ifstream input; - - //IPP file check - input.open(ipp_filename); - if (!input) - { - cout << "\n"; - cout << "-----> IPP: Fatal error! - Data read \n"; - cout << "-----> IPP: Could not open the input data file: \"" - << ipp_filename << "\n"; - } - - //iPCM input file reading - char reader[100]; // variable for input value - //double K; - while (!input.eof()) - { - input >> reader; - //if (reader==string("<BoundaryAndInitialConditions>")) - //cout << "-----> IPP: Boundary and Initial Conditions reading ... \n"; - //IPP perameters initialization: - if (reader == string("<DepthBOR>")) - { - input >> reader; - IPP_DepthBOR = atof(reader); - cout << "-----> IPP: Depth BOR: " << IPP_DepthBOR << "\n"; - } - if (reader == string("<InjectionWellRate>")) - { - input >> reader; - IPP_InjectionWellRate = atof(reader); - cout << "-----> IPP: Injection Well Rate: " - << IPP_InjectionWellRate << "\n"; - } - if (reader == string("<InjectionWellWindowSize>")) - { - input >> reader; - IPP_InjectionWindowSize = atof(reader); - cout << "-----> IPP: Injection Well Window Size: " - << IPP_InjectionWindowSize << "\n"; - } - if (reader == string("<UpperPressure>")) - { - input >> reader; - IPP_UpperPressure = atof(reader); - cout << "-----> IPP: Upper pressure: " - << IPP_UpperPressure << "\n"; - } - if (reader == string("<LowerPressure>")) - { - input >> reader; - IPP_LowerPressure = atof(reader); - cout << "-----> IPP: Lower pressure: " - << IPP_LowerPressure << "\n"; - } - if (reader == string("<InfiltrationRate>")) - { - input >> reader; - IPP_InfiltrationRate = atof(reader); - cout << "-----> IPP: Infiltration rate: " - << IPP_InfiltrationRate << "\n"; - } - if (reader == string("<MaxTimeStepSize>")) - { - input >> reader; - IPP_MaxTimeStepSize = atof(reader); - cout << "-----> IPP: Maximum time step size: " - << IPP_MaxTimeStepSize << "\n"; - } - if (reader == string("<InfiltrationStartTime>")) - { - input >> reader; - IPP_InfiltrationStartTime = atof(reader); - cout << "-----> IPP: Start time of infiltration: " - << IPP_InfiltrationStartTime << "\n"; - } - if (reader == string("<InfiltrationEndTime>")) - { - input >> reader; - IPP_InfiltrationEndTime = atof(reader); - cout << "-----> IPP: End time of infiltration: " - << IPP_InfiltrationEndTime << "\n"; - } - if (reader == string("<DiscretizationLength>")) - { - input >> reader; - IPP_DiscretizationLength = atof(reader); - cout << "-----> IPP: Discretization length: " - << IPP_DiscretizationLength << "\n"; - } - if (reader == string("<SimulationNumber>")) - { - input >> reader; - IPP_SimulationNumber = atof(reader); - cout << "-----> IPP: Output Name: " - << IPP_SimulationNumber << "\n"; - } - } - input.close(); - } - -}; - -} // end namespace -#endif diff --git a/appl/lecture/msm/buckleyleverett/interface_BL.xml b/appl/lecture/msm/buckleyleverett/interface_BL.xml deleted file mode 100755 index 1d02f69c2fa556e9714fe7e1b3d56d90a6f8c2f9..0000000000000000000000000000000000000000 --- a/appl/lecture/msm/buckleyleverett/interface_BL.xml +++ /dev/null @@ -1,48 +0,0 @@ -<iPCM_problem> - - <SoilProperties> - <Permeability> - 1e-7 - </Permeability> - <Porosity> - 0.2 - </Porosity> - <BrooksCoreyLambda> - 2.0 - </BrooksCoreyLambda> - <BrooksCoreyEntryPressure> - 0.0 - </BrooksCoreyEntryPressure> - <ResidualSaturationWetting> - 0.2 - </ResidualSaturationWetting> - <ResidualSaturationNonWetting> - 0.2 - </ResidualSaturationNonWetting> - </SoilProperties> - - <FluidProperties> - <DensityWettingFluid> - 1e3 - </DensityWettingFluid> - <DensityNonWettingFluid> - 1e3 - </DensityNonWettingFluid> - <ViscosityWettingFluid> - 1e-3 - </ViscosityWettingFluid> - <ViscosityNonWettingFluid> - 1e-3 - </ViscosityNonWettingFluid> - </FluidProperties> - - <BoundaryAndInitialConditions> - <DiscretizationLength> - 10 - </DiscretizationLength> - <SimulationNumber> - 1 - </SimulationNumber> - </BoundaryAndInitialConditions> - -</iPCM_problem>