This is a bit tricky.
So in grocery CRUD for security reasons you need to specify all the fields that you want to save at the fields method. Then you can simply have this type as invisible. As you can see at the documentation for invisible field there is an example for the callback_before_insert . So in your case you will simply have:
public function brandstof()
{
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
$crud->set_table('invoer');
$crud->set_subject('Brandstof');
$crud->required_fields('datum', 'aant_km', 'ltr', 'prijs');
$crud->fields('datum', 'aant_dagen', 'aant_km', 'ltr',
'prijs','tot','een_op','ltr_per_100_km'); //Don't forget to add these fields
$crud->field_type('tot','invisible');
$crud->field_type('een_op','invisible');
$crud->field_type('ltr_per_100_km','invisible');
$crud->order_by('datum', 'desc');
$crud->callback_before_insert(array($this,'calculate'));
$output = $crud->render();
$this->_example_output($output);
}
function calculate($post_array)
{
$post_array['tot'] = 100;
$post_array['een_op'] = $post_array['aant_km'] / $post_array['ltr'];
$post_array['ltr_per_100_km'] = $post_array['ltr'] / $post_array['aant_km'];
return $post_array;
}