{"action":"created","issue":{"url":"https://api.github.com/repos/OPM/opm-autodiff/issues/301","labels_url":"https://api.github.com/repos/OPM/opm-autodiff/issues/301/labels{/name}","comments_url":"https://api.github.com/repos/OPM/opm-autodiff/issues/301/comments","events_url":"https://api.github.com/repos/OPM/opm-autodiff/issues/301/events","html_url":"https://github.com/OPM/opm-autodiff/pull/301","id":57333161,"number":301,"title":"Do a fuzzy comparison when checking for broken ctrl_index of wells.","user":{"login":"blattms","id":1944640,"avatar_url":"https://avatars.githubusercontent.com/u/1944640?v=3","gravatar_id":"","url":"https://api.github.com/users/blattms","html_url":"https://github.com/blattms","followers_url":"https://api.github.com/users/blattms/followers","following_url":"https://api.github.com/users/blattms/following{/other_user}","gists_url":"https://api.github.com/users/blattms/gists{/gist_id}","starred_url":"https://api.github.com/users/blattms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blattms/subscriptions","organizations_url":"https://api.github.com/users/blattms/orgs","repos_url":"https://api.github.com/users/blattms/repos","events_url":"https://api.github.com/users/blattms/events{/privacy}","received_events_url":"https://api.github.com/users/blattms/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-11T15:47:03Z","updated_at":"2015-02-19T14:54:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OPM/opm-autodiff/pulls/301","html_url":"https://github.com/OPM/opm-autodiff/pull/301","diff_url":"https://github.com/OPM/opm-autodiff/pull/301.diff","patch_url":"https://github.com/OPM/opm-autodiff/pull/301.patch"},"body":"Previously, the control mode of a well got switched for Ug and not for Cp due to\r\ndifferent rounding. With this commit we use `Dune::FloatCmp` to do\r\nthe comparisons up to an epsilon and get the same behaviour for both grids.\r\n\r\nCloses #300\r\n\r\nPlease note that there are still differences between the well values for both grids."},"comment":{"url":"https://api.github.com/repos/OPM/opm-autodiff/issues/comments/75064567","html_url":"https://github.com/OPM/opm-autodiff/pull/301#issuecomment-75064567","issue_url":"https://api.github.com/repos/OPM/opm-autodiff/issues/301","id":75064567,"user":{"login":"atgeirr","id":1876621,"avatar_url":"https://avatars.githubusercontent.com/u/1876621?v=3","gravatar_id":"","url":"https://api.github.com/users/atgeirr","html_url":"https://github.com/atgeirr","followers_url":"https://api.github.com/users/atgeirr/followers","following_url":"https://api.github.com/users/atgeirr/following{/other_user}","gists_url":"https://api.github.com/users/atgeirr/gists{/gist_id}","starred_url":"https://api.github.com/users/atgeirr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atgeirr/subscriptions","organizations_url":"https://api.github.com/users/atgeirr/orgs","repos_url":"https://api.github.com/users/atgeirr/repos","events_url":"https://api.github.com/users/atgeirr/events{/privacy}","received_events_url":"https://api.github.com/users/atgeirr/received_events","type":"User","site_admin":false},"created_at":"2015-02-19T14:54:04Z","updated_at":"2015-02-19T14:54:04Z","body":"I am unsure about what to do with this PR. The SPE1 problem (actually, two problems, one hidden by the other) have been solved without this, but the question remains: should we use a fuzzy comparison here.\r\n\r\nOn one hand it may prevent some switching in marginal cases: such as if an injection bhp of 100 bar is specified and we have 100.00000001 bar we will not switch to bhp control.\r\n\r\nOn the other hand, such a switch will not change the solution at all, so it does not matter. Also, if we are operating with a certain active control, for example bhp == 100 bar, the bhp in the simulator will be set to exactly 100 bar, and not trigger oscillation in the controls.\r\n\r\nAll in all, I am inclined to reject this PR, but if someone can bring forth a scenario where not being fuzzy leads to oscillation of controls or other undesirable effects I will listen."}}