foreach ($products as $product) {
$product->set_width(10);
$product->save();
$childs = $product->get_children(array(
'limit' => -1,
));
foreach ($childs as $child) {
$my_super_product = wc_get_product( $child );
$my_super_product->set_width(10);
$my_super_product->save();